public class ZooKeeperHiveLockManager extends Object implements HiveLockManager
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
| Constructor and Description |
|---|
ZooKeeperHiveLockManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
List<HiveLock> |
getLocks(boolean verifyTablePartition,
boolean fetchData) |
List<HiveLock> |
getLocks(HiveLockObject key,
boolean verifyTablePartitions,
boolean fetchData) |
ZooKeeperHiveLock |
lock(HiveLockObject key,
HiveLockMode mode,
boolean keepAlive) |
List<HiveLock> |
lock(List<HiveLockObj> lockObjects,
boolean keepAlive,
Driver.LockedDriverState lDrvState) |
void |
prepareRetry() |
void |
refresh()
refresh to enable new configurations.
|
static void |
releaseAllLocks(HiveConf conf) |
void |
releaseLocks(List<HiveLock> hiveLocks) |
void |
setContext(HiveLockManagerCtx ctx) |
void |
unlock(HiveLock hiveLock) |
public void setContext(HiveLockManagerCtx ctx) throws LockException
setContext in interface HiveLockManagerctx - The lock manager context (containing the Hive configuration file)
Start the ZooKeeper client based on the zookeeper cluster specified in the conf.LockExceptionpublic void refresh()
HiveLockManagerrefresh in interface HiveLockManagerpublic List<HiveLock> lock(List<HiveLockObj> lockObjects, boolean keepAlive, Driver.LockedDriverState lDrvState) throws LockException
lock in interface HiveLockManagerlockObjects - List of objects and the modes of the locks requestedkeepAlive - Whether the lock is to be persisted after the statement
Acuire all the locks. Release all the locks and return null if any lock
could not be acquired.LockExceptionpublic void releaseLocks(List<HiveLock> hiveLocks)
releaseLocks in interface HiveLockManagerhiveLocks - list of hive locks to be released Release all the locks specified. If some of the
locks have already been released, ignore thempublic ZooKeeperHiveLock lock(HiveLockObject key, HiveLockMode mode, boolean keepAlive) throws LockException
lock in interface HiveLockManagerkey - The object to be lockedmode - The mode of the lockkeepAlive - Whether the lock is to be persisted after the statement Acquire the
lock. Return null if a conflicting lock is present.LockExceptionpublic void unlock(HiveLock hiveLock) throws LockException
unlock in interface HiveLockManagerLockExceptionpublic static void releaseAllLocks(HiveConf conf) throws Exception
Exceptionpublic List<HiveLock> getLocks(boolean verifyTablePartition, boolean fetchData) throws LockException
getLocks in interface HiveLockManagerLockExceptionpublic List<HiveLock> getLocks(HiveLockObject key, boolean verifyTablePartitions, boolean fetchData) throws LockException
getLocks in interface HiveLockManagerLockExceptionpublic void close()
throws LockException
close in interface HiveLockManagerLockExceptionpublic void prepareRetry()
throws LockException
prepareRetry in interface HiveLockManagerLockExceptionCopyright © 2019 The Apache Software Foundation. All Rights Reserved.