final LockResult lockShared(long indexId, byte[] key, int hash, long nanosTimeout) throws LockFailureException { return lock(TYPE_SHARED, indexId, key, hash, nanosTimeout); }
final LockResult lockExclusive(long indexId, byte[] key, int hash, long nanosTimeout) throws LockFailureException { return lock(TYPE_EXCLUSIVE, indexId, key, hash, nanosTimeout); }
final LockResult lockShared(long indexId, byte[] key, int hash, long nanosTimeout) throws LockFailureException { return lock(TYPE_SHARED, indexId, key, hash, nanosTimeout); }
final LockResult lockShared(long indexId, byte[] key, int hash, long nanosTimeout) throws LockFailureException { return lock(TYPE_SHARED, indexId, key, hash, nanosTimeout); }
final LockResult lockExclusive(long indexId, byte[] key, int hash, long nanosTimeout) throws LockFailureException { return lock(TYPE_EXCLUSIVE, indexId, key, hash, nanosTimeout); }
final LockResult lockUpgradable(long indexId, byte[] key, int hash, long nanosTimeout) throws LockFailureException { return lock(TYPE_UPGRADABLE, indexId, key, hash, nanosTimeout); }
final LockResult lockUpgradable(long indexId, byte[] key, int hash, long nanosTimeout) throws LockFailureException { return lock(TYPE_UPGRADABLE, indexId, key, hash, nanosTimeout); }
final LockResult lockExclusive(long indexId, byte[] key, int hash, long nanosTimeout) throws LockFailureException { return lock(TYPE_EXCLUSIVE, indexId, key, hash, nanosTimeout); }
final LockResult lockUpgradable(long indexId, byte[] key, int hash, long nanosTimeout) throws LockFailureException { return lock(TYPE_UPGRADABLE, indexId, key, hash, nanosTimeout); }
/** * Attempts to acquire an exclusive lock for the given key, denying any * additional locks. If return value is {@link LockResult#alreadyOwned owned}, * transaction already owns exclusive lock, and no extra unlock should be * performed. * * <p><i>Note: This method is intended for advanced use cases.</i> * * @param key non-null key to lock; instance is not cloned * @param nanosTimeout maximum time to wait for lock; negative timeout is infinite * @return {@link LockResult#ACQUIRED ACQUIRED}, {@link LockResult#UPGRADED * UPGRADED}, or {@link LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws LockFailureException if interrupted, timed out, or illegal upgrade * @throws DeadlockException if deadlock was detected after waiting full timeout */ public final LockResult lockExclusive(long indexId, byte[] key, long nanosTimeout) throws LockFailureException { return lock(TYPE_EXCLUSIVE, indexId, key, hash(indexId, key), nanosTimeout); }
/** * Attempts to acquire an exclusive lock for the given key, denying any * additional locks. If return value is {@link LockResult#alreadyOwned owned}, * transaction already owns exclusive lock, and no extra unlock should be * performed. * * <p><i>Note: This method is intended for advanced use cases.</i> * * @param key non-null key to lock; instance is not cloned * @param nanosTimeout maximum time to wait for lock; negative timeout is infinite * @return {@link LockResult#ACQUIRED ACQUIRED}, {@link LockResult#UPGRADED * UPGRADED}, or {@link LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws LockFailureException if interrupted, timed out, or illegal upgrade * @throws DeadlockException if deadlock was detected after waiting full timeout */ public final LockResult lockExclusive(long indexId, byte[] key, long nanosTimeout) throws LockFailureException { return lock(TYPE_EXCLUSIVE, indexId, key, hash(indexId, key), nanosTimeout); }
/** * Attempts to acquire an upgradable lock for the given key, denying * exclusive and additional upgradable locks. If return value is {@link * LockResult#alreadyOwned owned}, transaction already owns a strong enough * lock, and no extra unlock should be performed. * * <p><i>Note: This method is intended for advanced use cases.</i> * * @param key non-null key to lock; instance is not cloned * @param nanosTimeout maximum time to wait for lock; negative timeout is infinite * @return {@link LockResult#ACQUIRED ACQUIRED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws LockFailureException if interrupted, timed out, or illegal upgrade * @throws DeadlockException if deadlock was detected after waiting full timeout */ public final LockResult lockUpgradable(long indexId, byte[] key, long nanosTimeout) throws LockFailureException { return lock(TYPE_UPGRADABLE, indexId, key, hash(indexId, key), nanosTimeout); }
/** * Attempts to acquire a shared lock for the given key, denying exclusive * locks. If return value is {@link LockResult#alreadyOwned owned}, transaction * already owns a strong enough lock, and no extra unlock should be * performed. * * <p><i>Note: This method is intended for advanced use cases.</i> * * @param key non-null key to lock; instance is not cloned * @param nanosTimeout maximum time to wait for lock; negative timeout is infinite * @return {@link LockResult#ACQUIRED ACQUIRED}, {@link * LockResult#OWNED_SHARED OWNED_SHARED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws IllegalStateException if too many shared locks * @throws LockFailureException if interrupted or timed out * @throws DeadlockException if deadlock was detected after waiting full timeout */ public final LockResult lockShared(long indexId, byte[] key, long nanosTimeout) throws LockFailureException { return lock(TYPE_SHARED, indexId, key, hash(indexId, key), nanosTimeout); }
/** * Attempts to acquire a shared lock for the given key, denying exclusive * locks. If return value is {@link LockResult#alreadyOwned owned}, transaction * already owns a strong enough lock, and no extra unlock should be * performed. * * <p><i>Note: This method is intended for advanced use cases.</i> * * @param key non-null key to lock; instance is not cloned * @param nanosTimeout maximum time to wait for lock; negative timeout is infinite * @return {@link LockResult#ACQUIRED ACQUIRED}, {@link * LockResult#OWNED_SHARED OWNED_SHARED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws IllegalStateException if too many shared locks * @throws LockFailureException if interrupted or timed out * @throws DeadlockException if deadlock was detected after waiting full timeout */ public final LockResult lockShared(long indexId, byte[] key, long nanosTimeout) throws LockFailureException { return lock(TYPE_SHARED, indexId, key, hash(indexId, key), nanosTimeout); }
/** * Attempts to acquire an exclusive lock for the given key, denying any * additional locks. If return value is {@link LockResult#alreadyOwned owned}, * transaction already owns exclusive lock, and no extra unlock should be * performed. * * <p><i>Note: This method is intended for advanced use cases.</i> * * @param key non-null key to lock; instance is not cloned * @param nanosTimeout maximum time to wait for lock; negative timeout is infinite * @return {@link LockResult#ACQUIRED ACQUIRED}, {@link LockResult#UPGRADED * UPGRADED}, or {@link LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws LockFailureException if interrupted, timed out, or illegal upgrade * @throws DeadlockException if deadlock was detected after waiting full timeout */ public final LockResult lockExclusive(long indexId, byte[] key, long nanosTimeout) throws LockFailureException { return lock(TYPE_EXCLUSIVE, indexId, key, hash(indexId, key), nanosTimeout); }
/** * Attempts to acquire an upgradable lock for the given key, denying * exclusive and additional upgradable locks. If return value is {@link * LockResult#alreadyOwned owned}, transaction already owns a strong enough * lock, and no extra unlock should be performed. * * <p><i>Note: This method is intended for advanced use cases.</i> * * @param key non-null key to lock; instance is not cloned * @param nanosTimeout maximum time to wait for lock; negative timeout is infinite * @return {@link LockResult#ACQUIRED ACQUIRED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws LockFailureException if interrupted, timed out, or illegal upgrade * @throws DeadlockException if deadlock was detected after waiting full timeout */ public final LockResult lockUpgradable(long indexId, byte[] key, long nanosTimeout) throws LockFailureException { return lock(TYPE_UPGRADABLE, indexId, key, hash(indexId, key), nanosTimeout); }
/** * Attempts to acquire an upgradable lock for the given key, denying * exclusive and additional upgradable locks. If return value is {@link * LockResult#alreadyOwned owned}, transaction already owns a strong enough * lock, and no extra unlock should be performed. * * <p><i>Note: This method is intended for advanced use cases.</i> * * @param key non-null key to lock; instance is not cloned * @param nanosTimeout maximum time to wait for lock; negative timeout is infinite * @return {@link LockResult#ACQUIRED ACQUIRED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws LockFailureException if interrupted, timed out, or illegal upgrade * @throws DeadlockException if deadlock was detected after waiting full timeout */ public final LockResult lockUpgradable(long indexId, byte[] key, long nanosTimeout) throws LockFailureException { return lock(TYPE_UPGRADABLE, indexId, key, hash(indexId, key), nanosTimeout); }
/** * Attempts to acquire a shared lock for the given key, denying exclusive * locks. If return value is {@link LockResult#alreadyOwned owned}, transaction * already owns a strong enough lock, and no extra unlock should be * performed. * * <p><i>Note: This method is intended for advanced use cases.</i> * * @param key non-null key to lock; instance is not cloned * @param nanosTimeout maximum time to wait for lock; negative timeout is infinite * @return {@link LockResult#ACQUIRED ACQUIRED}, {@link * LockResult#OWNED_SHARED OWNED_SHARED}, {@link * LockResult#OWNED_UPGRADABLE OWNED_UPGRADABLE}, or {@link * LockResult#OWNED_EXCLUSIVE OWNED_EXCLUSIVE} * @throws IllegalStateException if too many shared locks * @throws LockFailureException if interrupted or timed out * @throws DeadlockException if deadlock was detected after waiting full timeout */ public final LockResult lockShared(long indexId, byte[] key, long nanosTimeout) throws LockFailureException { return lock(TYPE_SHARED, indexId, key, hash(indexId, key), nanosTimeout); }