/** * Similar to markDirty method except no new page is reserved, and old page * is not immediately deleted. Caller must hold commit lock and exclusive * latch on node. Latch is never released by this method, unless an * exception is thrown. */ void prepareToDelete(Node node) throws IOException { // Hello. My name is Inigo Montoya. You killed my father. Prepare to die. if (node.mCachedState == mCheckpointFlushState) { // Node must be committed with the current checkpoint, and so // it must be written out before it can be deleted. try { node.write(mPageDb); } catch (Throwable e) { node.releaseExclusive(); throw e; } } }
/** * Similar to markDirty method except no new page is reserved, and old page * is not immediately deleted. Caller must hold commit lock and exclusive * latch on node. Latch is never released by this method, unless an * exception is thrown. */ void prepareToDelete(Node node) throws IOException { // Hello. My name is Inigo Montoya. You killed my father. Prepare to die. if (node.mCachedState == mCheckpointFlushState) { // Node must be committed with the current checkpoint, and so // it must be written out before it can be deleted. try { node.write(mPageDb); } catch (Throwable e) { node.releaseExclusive(); throw e; } } }
/** * Similar to markDirty method except no new page is reserved, and old page * is not immediately deleted. Caller must hold commit lock and exclusive * latch on node. Latch is never released by this method, unless an * exception is thrown. */ void prepareToDelete(Node node) throws IOException { // Hello. My name is Inigo Montoya. You killed my father. Prepare to die. if (node.mCachedState == mCheckpointFlushState) { // Node must be committed with the current checkpoint, and so // it must be written out before it can be deleted. try { node.write(mPageDb); } catch (Throwable e) { node.releaseExclusive(); throw e; } } }
/** * Mark an unmapped node as dirty. Caller must hold commit lock and exclusive latch on * node. Method does nothing if node is already dirty. Latch is never released by this * method, even if an exception is thrown. */ void markUnmappedDirty(Node node) throws IOException { if (node.mCachedState != mCommitState) { node.write(mPageDb); long newId = mPageDb.allocPage(); long oldId = node.mId; try { mPageDb.deletePage(oldId); } catch (Throwable e) { try { mPageDb.recyclePage(newId); } catch (Throwable e2) { // Panic. e.addSuppressed(e2); close(e); } throw e; } dirty(node, newId); } }
} else { if (node.mCachedState != CACHED_CLEAN) { node.write(mPageDb);
childNode.write(mTree.mDatabase.mPageDb); } catch (Throwable e) { childNode.releaseExclusive();
/** * Mark an unmapped node as dirty. Caller must hold commit lock and exclusive latch on * node. Method does nothing if node is already dirty. Latch is never released by this * method, even if an exception is thrown. */ void markUnmappedDirty(Node node) throws IOException { if (node.mCachedState != mCommitState) { node.write(mPageDb); long newId = mPageDb.allocPage(); long oldId = node.mId; try { // No need to force delete when dirtying. Caller is responsible for cleaning up. mPageDb.deletePage(oldId, false); } catch (Throwable e) { try { mPageDb.recyclePage(newId); } catch (Throwable e2) { // Panic. Utils.suppress(e, e2); close(e); } throw e; } dirty(node, newId); } }
/** * Mark an unmapped node as dirty. Caller must hold commit lock and exclusive latch on * node. Method does nothing if node is already dirty. Latch is never released by this * method, even if an exception is thrown. */ void markUnmappedDirty(Node node) throws IOException { if (node.mCachedState != mCommitState) { node.write(mPageDb); long newId = mPageDb.allocPage(); long oldId = node.mId; try { mPageDb.deletePage(oldId); } catch (Throwable e) { try { mPageDb.recyclePage(newId); } catch (Throwable e2) { // Panic. Utils.suppress(e, e2); close(e); } throw e; } dirty(node, newId); } }
node.write(mPageDb);
childNode.write(mTree.mDatabase.mPageDb); } catch (Throwable e) { childNode.releaseExclusive();
childNode.write(mPageDb); } catch (Throwable e) { childNode.releaseExclusive();
} else { if (node.mCachedState != CACHED_CLEAN) { node.write(mPageDb);
} else { if (node.mCachedState != CACHED_CLEAN) { node.write(mPageDb);
childNode.write(mTree.mDatabase.mPageDb); } catch (Throwable e) { childNode.releaseExclusive();
childNode.write(mPageDb); } catch (Throwable e) { childNode.releaseExclusive();
node.write(pageDb);
node.write(mPageDb);
node.write(mPageDb);
node.write(pageDb);
childNode.write(mTree.mDatabase.mPageDb); } catch (Throwable e) { childNode.releaseExclusive();