@Override public boolean renameIndex(long txnId, long indexId, byte[] newName) throws IOException { checkHighest(txnId); Index ix = openIndex(indexId); if (ix != null) { mDatabase.renameIndex(ix, newName, txnId); } return true; }
@Override public boolean store(long indexId, byte[] key, byte[] value) throws IOException { // No need to actually acquire a lock for log based recovery. return storeNoLock(indexId, key, value); }
@Override public boolean txnRollback(long txnId) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.exit(); } return true; }
@Override public boolean txnStoreCommitFinal(long txnId, long indexId, byte[] key, byte[] value) throws IOException { txnStore(txnId, indexId, key, value); return txnCommitFinal(txnId); }
private LocalTransaction txn(long txnId) { checkHighest(txnId); return mTransactions.getValue(txnId); }
@Override public boolean cursorValueClear(long cursorId, long txnId, long pos, long length) throws IOException { LHashTable.ObjEntry<TreeCursor> entry = mCursors.get(cursorId); if (entry != null) { LocalTransaction txn = txn(txnId); if (txn != null) { readyCursorValueOp(entry, txn).valueClear(pos, length); } } return true; }
@Override public boolean storeNoLock(long indexId, byte[] key, byte[] value) throws IOException { Index ix = openIndex(indexId); if (ix != null) { ix.store(Transaction.BOGUS, key, value); } return true; }
@Override public boolean txnStoreCommitFinal(long txnId, long indexId, byte[] key, byte[] value) throws IOException { txnStore(txnId, indexId, key, value); return txnCommitFinal(txnId); }
private LocalTransaction txn(long txnId) { checkHighest(txnId); return mTransactions.getValue(txnId); }
@Override public boolean cursorValueSetLength(long cursorId, long txnId, long length) throws IOException { LHashTable.ObjEntry<TreeCursor> entry = mCursors.get(cursorId); if (entry != null) { LocalTransaction txn = txn(txnId); if (txn != null) { readyCursorValueOp(entry, txn).valueLength(length); } } return true; }
@Override public boolean storeNoLock(long indexId, byte[] key, byte[] value) throws IOException { Index ix = openIndex(indexId); if (ix != null) { ix.store(Transaction.BOGUS, key, value); } return true; }
@Override public boolean txnLockShared(long txnId, long indexId, byte[] key) throws IOException { Transaction txn = txn(txnId); if (txn != null) { txn.lockShared(indexId, key); } return true; }
@Override public boolean renameIndex(long txnId, long indexId, byte[] newName) throws IOException { checkHighest(txnId); Index ix = openIndex(indexId); if (ix != null) { mDatabase.renameIndex(ix, newName, txnId); } return true; }
@Override public boolean txnStoreCommitFinal(long txnId, long indexId, byte[] key, byte[] value) throws IOException { txnStore(txnId, indexId, key, value); return txnCommitFinal(txnId); }