/** * Checks the lock ownership for the given key. * * <p><i>Note: This method is intended for advanced use cases.</i> * * @return {@link LockResult#UNOWNED UNOWNED}, {@link * LockResult#OWNED_SHARED OWNED_SHARED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} */ public final LockResult lockCheck(long indexId, byte[] key) { return manager().check(this, indexId, key, hash(indexId, key)); }
/** * Checks the lock ownership for the given key. * * <p><i>Note: This method is intended for advanced use cases.</i> * * @return {@link LockResult#UNOWNED UNOWNED}, {@link * LockResult#OWNED_SHARED OWNED_SHARED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} */ public final LockResult lockCheck(long indexId, byte[] key) { return manager().check(this, indexId, key, hash(indexId, key)); }
/** * Checks the lock ownership for the given key. * * <p><i>Note: This method is intended for advanced use cases.</i> * * @return {@link LockResult#UNOWNED UNOWNED}, {@link * LockResult#OWNED_SHARED OWNED_SHARED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} */ public final LockResult lockCheck(long indexId, byte[] key) { return manager().check(this, indexId, key, hash(indexId, key)); }
@Override public final LockResult skip(long amount) throws IOException { if (amount == 0) { LocalTransaction txn = mTxn; if (txn != null && txn != Transaction.BOGUS) { byte[] key = mKey; if (key != null) { return txn.mManager.check(txn, mTree.mId, key, keyHash()); } } return LockResult.UNOWNED; } try { CursorFrame frame = leafSharedNotSplit(); if (amount > 0) { if (amount > 1 && (frame = skipNextGap(frame, amount - 1, null)) == null) { return LockResult.UNOWNED; } return next(mTxn, frame); } else { if (amount < -1 && (frame = skipPreviousGap(frame, -1 - amount, null)) == null) { return LockResult.UNOWNED; } return previous(mTxn, frame); } } catch (Throwable e) { throw handleException(e, false); } }
@Override public final LockResult skip(long amount) throws IOException { if (amount == 0) { LocalTransaction txn = mTxn; if (txn != null && txn != Transaction.BOGUS) { byte[] key = mKey; if (key != null) { return txn.mManager.check(txn, mTree.mId, key, keyHash()); } } return LockResult.UNOWNED; } try { CursorFrame frame = leafSharedNotSplit(); if (amount > 0) { if (amount > 1 && (frame = skipNextGap(frame, amount - 1, null)) == null) { return LockResult.UNOWNED; } return next(mTxn, frame); } else { if (amount < -1 && (frame = skipPreviousGap(frame, -1 - amount, null)) == null) { return LockResult.UNOWNED; } return previous(mTxn, frame); } } catch (Throwable e) { throw handleException(e, false); } }
@Override public final LockResult skip(long amount) throws IOException { if (amount == 0) { LocalTransaction txn = mTxn; if (txn != null && txn != Transaction.BOGUS) { byte[] key = mKey; if (key != null) { return txn.mManager.check(txn, mTree.mId, key, keyHash()); } } return LockResult.UNOWNED; } mCursorId &= ~(1L << 63); // key will change, but cursor isn't reset try { CursorFrame frame = frameSharedNotSplit(); if (amount > 0) { if (amount > 1 && (frame = skipNextGap(frame, amount - 1, null)) == null) { return LockResult.UNOWNED; } return next(mTxn, frame); } else { if (amount < -1 && (frame = skipPreviousGap(frame, -1 - amount, null)) == null) { return LockResult.UNOWNED; } return previous(mTxn, frame); } } catch (Throwable e) { throw handleException(e, false); } }