UnmodifiableReplicaException unmodifiable() throws DatabaseException { mDatabase.checkClosed(); return new UnmodifiableReplicaException(); }
UnmodifiableReplicaException unmodifiable() throws DatabaseException { mDatabase.checkClosed(); return new UnmodifiableReplicaException(); }
@Override public Snapshot beginSnapshot() throws IOException { if (!(mPageDb.isDurable())) { throw new UnsupportedOperationException("Snapshot only allowed for durable databases"); } checkClosed(); DurablePageDb pageDb = (DurablePageDb) mPageDb; return pageDb.beginSnapshot(this); }
@Override public Snapshot beginSnapshot() throws IOException { if (!(mPageDb.isDurable())) { throw new UnsupportedOperationException("Snapshot only allowed for durable databases"); } checkClosed(); DurablePageDb pageDb = (DurablePageDb) mPageDb; return pageDb.beginSnapshot(this); }
@Override public Snapshot beginSnapshot() throws IOException { if (!(mPageDb.isDurable())) { throw new UnsupportedOperationException("Snapshot only allowed for durable databases"); } checkClosed(); DurablePageDb pageDb = (DurablePageDb) mPageDb; return pageDb.beginSnapshot(this); }
@Override public Sorter newSorter(Executor executor) throws IOException { if (executor == null && (executor = mSorterExecutor) == null) { mOpenTreesLatch.acquireExclusive(); try { checkClosed(); executor = mSorterExecutor; if (executor == null) { ExecutorService es = Executors.newCachedThreadPool(r -> { Thread t = new Thread(r); t.setDaemon(true); t.setName("Sorter-" + Long.toUnsignedString(t.getId())); return t; }); mSorterExecutor = es; executor = es; } } finally { mOpenTreesLatch.releaseExclusive(); } } return new ParallelSorter(this, executor); }
mDatabase.checkClosed();
mDatabase.checkClosed();
protected final IOException handleException(Throwable e, boolean reset) throws IOException { // Checks if cause of exception is likely due to the database being closed. If so, the // given exception is discarded and a new DatabaseException is thrown. mTree.mDatabase.checkClosed(); if (mLeaf == null && e instanceof IllegalStateException) { // Exception is caused by cursor state; store is safe. if (reset) { reset(); } throw (IllegalStateException) e; } if (e instanceof DatabaseException) { DatabaseException de = (DatabaseException) e; if (de.isRecoverable()) { if (reset) { reset(); } throw de; } } // Any unexpected exception can corrupt the internal store state. Closing down // protects the persisted state. try { throw closeOnFailure(mTree.mDatabase, e); } finally { reset(); } }
protected final IOException handleException(Throwable e, boolean reset) throws IOException { // Checks if cause of exception is likely due to the database being closed. If so, the // given exception is discarded and a new DatabaseException is thrown. mTree.mDatabase.checkClosed(); if (mLeaf == null && e instanceof IllegalStateException) { // Exception is caused by cursor state; store is safe. if (reset) { reset(); } throw (IllegalStateException) e; } if (e instanceof DatabaseException) { DatabaseException de = (DatabaseException) e; if (de.isRecoverable()) { if (reset) { reset(); } throw de; } } // Any unexpected exception can corrupt the internal store state. Closing down // protects the persisted state. try { throw closeOnFailure(mTree.mDatabase, e); } finally { reset(); } }
private IOException handleException(Throwable e, boolean reset) throws IOException { // Checks if cause of exception is likely due to the database being closed. If so, the // given exception is discarded and a new DatabaseException is thrown. mTree.mDatabase.checkClosed(); if (mFrame == null && e instanceof IllegalStateException) { // Exception is caused by cursor state; store is safe. if (reset) { reset(); } throw (IllegalStateException) e; } if (e instanceof DatabaseException) { DatabaseException de = (DatabaseException) e; if (de.isRecoverable()) { if (reset) { reset(); } throw de; } } // Any unexpected exception can corrupt the internal store state. Closing down // protects the persisted state. try { throw closeOnFailure(mTree.mDatabase, e); } finally { reset(); } }
mDatabase.checkClosed();
checkClosed(); return null;
private Tree openInternalTree(long treeId, boolean create, DatabaseConfig config) throws IOException { CommitLock.Shared shared = mCommitLock.acquireShared(); try { checkClosed(); byte[] treeIdBytes = new byte[8]; encodeLongBE(treeIdBytes, 0, treeId); byte[] rootIdBytes = mRegistry.load(Transaction.BOGUS, treeIdBytes); long rootId; if (rootIdBytes != null) { rootId = decodeLongLE(rootIdBytes, 0); } else { if (!create) { return null; } rootId = 0; } Node root = loadTreeRoot(treeId, rootId); // Cannot call newTreeInstance because mRedoWriter isn't set yet. if (config != null && config.mReplManager != null) { return new TxnTree(this, treeId, treeIdBytes, root); } return newTreeInstance(treeId, treeIdBytes, null, root); } finally { shared.release(); } }
private Tree openInternalTree(long treeId, boolean create, DatabaseConfig config) throws IOException { CommitLock.Shared shared = mCommitLock.acquireShared(); try { checkClosed(); byte[] treeIdBytes = new byte[8]; encodeLongBE(treeIdBytes, 0, treeId); byte[] rootIdBytes = mRegistry.load(Transaction.BOGUS, treeIdBytes); long rootId; if (rootIdBytes != null) { rootId = decodeLongLE(rootIdBytes, 0); } else { if (!create) { return null; } rootId = 0; } Node root = loadTreeRoot(treeId, rootId); // Cannot call newTreeInstance because mRedoWriter isn't set yet. if (config != null && config.mReplManager != null) { return new TxnTree(this, treeId, treeIdBytes, root); } return newTreeInstance(treeId, treeIdBytes, null, root); } finally { shared.release(); } }
checkClosed(); return null;
checkClosed(); return null;