/** * Caller must hold commit lock and exclusive latch on node. The * prepareToDelete method must have been called first. Latch is always * released by this method, even if an exception is thrown. */ void finishDeleteNode(Node node) throws IOException { finishDeleteNode(node, true); }
/** * Caller must hold commit lock and exclusive latch on node. The * prepareToDelete method must have been called first. Latch is always * released by this method, even if an exception is thrown. */ void finishDeleteNode(Node node) throws IOException { finishDeleteNode(node, true); }
/** * Caller must hold commit lock and exclusive latch on node. Latch is always released by * this method, even if an exception is thrown. */ void deleteNode(Node node, boolean canRecycle) throws IOException { prepareToDelete(node); finishDeleteNode(node, canRecycle); }
/** * Caller must hold commit lock and exclusive latch on node. Latch is always released by * this method, even if an exception is thrown. */ void deleteNode(Node node, boolean canRecycle) throws IOException { prepareToDelete(node); finishDeleteNode(node, canRecycle); }
private void cleanupSplit(Throwable cause, Node newNode, Split split) { if (split != null) { cleanupFragments(cause, split.fragmentedKey()); } try { // No need to prepare for delete because node contents are unreferenced. getDatabase().finishDeleteNode(newNode); } catch (Throwable e) { Utils.suppress(cause, e); panic(cause); } }
private void cleanupSplit(Throwable cause, Node newNode, Split split) { if (split != null) { cleanupFragments(cause, split.fragmentedKey()); } try { // No need to prepare for delete because node contents are unreferenced. getDatabase().finishDeleteNode(newNode); } catch (Throwable e) { Utils.suppress(cause, e); panic(cause); } }
/** * Delete this non-leaf root node, after all keys have been deleted. Caller must hold * exclusive latches for root node, lone child, and stub. Caller must also ensure that both * nodes are not splitting. All latches are released, even if an exception is thrown. * * @param stub frames bound to root node move here */ void rootDelete(Tree tree, Node child, Node stub) throws IOException { try { tree.mDatabase.prepareToDelete(child); try { doRootDelete(tree, child, stub); } catch (Throwable e) { child.releaseExclusive(); throw e; } // The node can be deleted earlier in the method, but doing it here might prevent // corruption if an unexpected exception occurs. tree.mDatabase.finishDeleteNode(child); } finally { stub.releaseExclusive(); releaseExclusive(); } }
/** * Delete this non-leaf root node, after all keys have been deleted. Caller must hold * exclusive latches for root node, lone child, and stub. Caller must also ensure that both * nodes are not splitting. All latches are released, even if an exception is thrown. * * @param stub frames bound to root node move here */ void rootDelete(Tree tree, Node child, Node stub) throws IOException { try { tree.mDatabase.prepareToDelete(child); try { doRootDelete(tree, child, stub); } catch (Throwable e) { child.releaseExclusive(); throw e; } // The node can be deleted earlier in the method, but doing it here might prevent // corruption if an unexpected exception occurs. tree.mDatabase.finishDeleteNode(child); } finally { stub.releaseExclusive(); releaseExclusive(); } }
} else { if (!deleteLowestNode(parentFrame, parentNode)) { db.finishDeleteNode(node); return false; next.releaseExclusive(); db.finishDeleteNode(node);
} else { if (!deleteLowestNode(parentFrame, parentNode)) { db.finishDeleteNode(node); return false; next.releaseExclusive(); db.finishDeleteNode(node);
} else { if (!deleteHighestNode(parentFrame, parentNode)) { db.finishDeleteNode(node); return false; previous.releaseExclusive(); db.finishDeleteNode(node);
tree.mDatabase.finishDeleteNode(rightNode);
tree.mDatabase.finishDeleteNode(rightNode);
tree.mDatabase.finishDeleteNode(rightNode);
tree.mDatabase.finishDeleteNode(rightNode);