@Override public TreeCursor newCursor(Transaction txn) { return new TreeCursor(this, txn); }
@Override public TreeCursor newCursor(Transaction txn) { return new TreeCursor(this, txn); }
/** * Non-transactionally deletes all entries in the tree. No other cursors or threads can be * active in the tree. The root node is prepared for deletion as a side effect. * * @return false if stopped because database is closed */ final boolean deleteAll() throws IOException { return new TreeCursor(this, Transaction.BOGUS).deleteAll(); }
/** * Non-transactionally deletes all entries in the tree. No other cursors or threads can be * active in the tree. The root node is prepared for deletion as a side effect. */ final void deleteAll() throws IOException { new TreeCursor(this, Transaction.BOGUS).deleteAll(); }
void ready(Tree tree) throws IOException { TreeCursor c = new TreeCursor(tree, Transaction.BOGUS); initPosition(c); mCursor = c; }
@Override public byte[] exchange(Transaction txn, byte[] key, byte[] value) throws IOException { keyCheck(key); return new TreeCursor(this, txn).findAndStore(key, value); }
@Override public boolean update(Transaction txn, byte[] key, byte[] oldValue, byte[] newValue) throws IOException { keyCheck(key); return new TreeCursor(this, txn).findAndModify(key, oldValue, newValue); }
private TreeCursor copyNoValue() { TreeCursor copy = new TreeCursor(mTree, mTxn); CursorFrame frame = mLeaf; if (frame != null) { CursorFrame frameCopy = new CursorFrame(); frame.copyInto(frameCopy); copy.mLeaf = frameCopy; } copy.mKey = mKey; copy.mKeyHash = mKeyHash; return copy; }
private TreeCursor copyNoValue() { TreeCursor copy = new TreeCursor(mTree, mTxn); CursorFrame frame = mLeaf; if (frame != null) { CursorFrame frameCopy = new CursorFrame(); frame.copyInto(frameCopy); copy.mLeaf = frameCopy; } copy.mKey = mKey; copy.mKeyHash = mKeyHash; return copy; }
@Override public byte[] exchange(Transaction txn, byte[] key, byte[] value) throws IOException { keyCheck(key); return new TreeCursor(this, txn).findAndStore(key, value); }
@Override public boolean update(Transaction txn, byte[] key, byte[] oldValue, byte[] newValue) throws IOException { keyCheck(key); return new TreeCursor(this, txn).findAndModify(key, oldValue, newValue); }
private TreeCursor copyNoValue() { TreeCursor copy = new TreeCursor(mTree, mTxn); CursorFrame frame = mFrame; if (frame != null) { CursorFrame frameCopy = new CursorFrame(); frame.copyInto(frameCopy); copy.mFrame = frameCopy; } copy.mKey = mKey; copy.mKeyHash = mKeyHash; return copy; }
@Override public void store(Transaction txn, byte[] key, byte[] value) throws IOException { keyCheck(key); TreeCursor cursor = new TreeCursor(this, txn); cursor.autoload(false); cursor.findAndStore(key, value); }
@Override public boolean replace(Transaction txn, byte[] key, byte[] value) throws IOException { keyCheck(key); TreeCursor cursor = new TreeCursor(this, txn); cursor.autoload(false); return cursor.findAndModify(key, TreeCursor.MODIFY_REPLACE, value); }
@Override public boolean replace(Transaction txn, byte[] key, byte[] value) throws IOException { keyCheck(key); TreeCursor cursor = new TreeCursor(this, txn); cursor.autoload(false); return cursor.findAndModify(key, TreeCursor.MODIFY_REPLACE, value); }
@Override public void store(Transaction txn, byte[] key, byte[] value) throws IOException { keyCheck(key); TreeCursor cursor = new TreeCursor(this, txn); cursor.autoload(false); cursor.findAndStore(key, value); }
@Override public boolean insert(Transaction txn, byte[] key, byte[] value) throws IOException { keyCheck(key); TreeCursor cursor = new TreeCursor(this, txn); cursor.autoload(false); return cursor.findAndModify(key, TreeCursor.MODIFY_INSERT, value); }
@Override public boolean insert(Transaction txn, byte[] key, byte[] value) throws IOException { keyCheck(key); TreeCursor cursor = new TreeCursor(this, txn); cursor.autoload(false); return cursor.findAndModify(key, TreeCursor.MODIFY_INSERT, value); }
@Override public Stats analyze(byte[] lowKey, byte[] highKey) throws IOException { TreeCursor cursor = new TreeCursor(this, Transaction.BOGUS); try { cursor.autoload(false); cursor.random(lowKey, highKey); return cursor.key() == null ? new Stats(0, 0, 0, 0, 0) : cursor.analyze(); } catch (Throwable e) { cursor.reset(); throw e; } }
@Override public Stats analyze(byte[] lowKey, byte[] highKey) throws IOException { TreeCursor cursor = new TreeCursor(this, Transaction.BOGUS); try { cursor.autoload(false); cursor.random(lowKey, highKey); return cursor.key() == null ? new Stats(0, 0, 0, 0, 0) : cursor.analyze(); } catch (Throwable e) { cursor.reset(); throw e; } }