/** * 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); } }
long newId = mPageDb.allocPage(); long oldId = node.mId;
/** * 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); } }
/** * 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); } }
long newId = mPageDb.allocPage(); long oldId = node.mId;
long newId = mPageDb.allocPage(); long oldId = node.mId;
long newId = mPageDb.allocPage(); long oldId = node.mId;
long newId = mPageDb.allocPage(); long oldId = node.mId;
long newId = mPageDb.allocPage(); long oldId = node.mId;
rootId = mPageDb.allocPage(); rootIdBytes = new byte[8]; } else {