/** * _Lock acquisition used by recovery. * * @param lock _Lock instance to insert, unless another already exists. The mIndexId, * mKey, and mHashCode fields must be set. */ final LockResult lockExclusive(_Lock lock) throws LockFailureException { return super.lockExclusive(lock, mLockTimeoutNanos); }
/** * _Lock acquisition used by recovery. * * @param lock _Lock instance to insert, unless another already exists. The mIndexId, * mKey, and mHashCode fields must be set. */ final LockResult lockExclusive(_Lock lock) throws LockFailureException { return super.lockExclusive(lock, mLockTimeoutNanos); }
final LockResult lockExclusive(long indexId, byte[] key, int hash) throws LockFailureException { return super.lockExclusive(indexId, key, hash, mLockTimeoutNanos); }
/** * _Lock acquisition used by recovery. * * @param lock _Lock instance to insert, unless another already exists. The mIndexId, * mKey, and mHashCode fields must be set. */ final LockResult lockExclusive(_Lock lock) throws LockFailureException { return super.lockExclusive(lock, mLockTimeoutNanos); }
final LockResult lockExclusive(long indexId, byte[] key, int hash) throws LockFailureException { return super.lockExclusive(indexId, key, hash, mLockTimeoutNanos); }
@Override public final LockResult lockExclusive(long indexId, byte[] key) throws LockFailureException { return super.lockExclusive(indexId, key, mLockTimeoutNanos); }
final LockResult lockExclusive(long indexId, byte[] key, int hash) throws LockFailureException { return super.lockExclusive(indexId, key, hash, mLockTimeoutNanos); }
@Override public final LockResult lockExclusive(long indexId, byte[] key) throws LockFailureException { return super.lockExclusive(indexId, key, mLockTimeoutNanos); }
@Override public final LockResult lockExclusive(long indexId, byte[] key) throws LockFailureException { return super.lockExclusive(indexId, key, mLockTimeoutNanos); }
@Override public boolean store(long indexId, byte[] key, byte[] value) throws IOException { Index ix = getIndex(indexId); // Allow side-effect free operations to be performed before acquiring latch. mOpLatch.acquireShared(); // Locks must be acquired in their original order to avoid // deadlock, so don't allow another task thread to run yet. _Locker locker = mDatabase.mLockManager.localLocker(); locker.lockExclusive(indexId, key, INFINITE_TIMEOUT); // Allow another task thread to run while operation completes. nextTask(); try { while (ix != null) { try { ix.store(Transaction.BOGUS, key, value); break; } catch (ClosedIndexException e) { // User closed the shared index reference, so re-open it. ix = openIndex(indexId, null); } } } finally { locker.scopeUnlockAll(); } // Only release if no exception. mOpLatch.releaseShared(); notifyStore(ix, key, value); // Return false to prevent RedoDecoder from looping back. return false; }