public class TxnStoreMutex extends Object implements TxnStore.MutexAPI
| Modifier and Type | Class and Description |
|---|---|
static class |
TxnStoreMutex.LockHandleImpl |
TxnStore.MutexAPI.LockHandle| Constructor and Description |
|---|
TxnStoreMutex(SQLGenerator sqlGenerator,
MultiDataSourceJdbcResource jdbcResource) |
| Modifier and Type | Method and Description |
|---|---|
TxnStore.MutexAPI.LockHandle |
acquireLock(String key)
The
key is name of the lock. |
void |
acquireLock(String key,
TxnStore.MutexAPI.LockHandle handle)
Same as
TxnStore.MutexAPI.acquireLock(String) but takes an already existing handle as input. |
public TxnStoreMutex(SQLGenerator sqlGenerator, MultiDataSourceJdbcResource jdbcResource)
public TxnStore.MutexAPI.LockHandle acquireLock(String key) throws MetaException
TxnStore.MutexAPIkey is name of the lock. Will acquire an exclusive lock or block. It returns
a handle which must be used to release the lock. Each invocation returns a new handle.acquireLock in interface TxnStore.MutexAPIMetaExceptionpublic void acquireLock(String key, TxnStore.MutexAPI.LockHandle handle) throws MetaException
TxnStore.MutexAPITxnStore.MutexAPI.acquireLock(String) but takes an already existing handle as input. This
will associate the lock on key with the same handle. All locks associated with
the same handle will be released together.acquireLock in interface TxnStore.MutexAPIhandle - not NULLMetaExceptionCopyright © 2024 The Apache Software Foundation. All rights reserved.