org.apache.hadoop.hive.ql.lockmgr.zookeeper
Class ZooKeeperHiveLockManager
java.lang.Object
org.apache.hadoop.hive.ql.lockmgr.zookeeper.ZooKeeperHiveLockManager
- All Implemented Interfaces:
- HiveLockManager
public class ZooKeeperHiveLockManager
- extends Object
- implements HiveLockManager
Field Summary |
static org.apache.commons.logging.Log |
LOG
|
LOG
public static final org.apache.commons.logging.Log LOG
ZooKeeperHiveLockManager
public ZooKeeperHiveLockManager()
setContext
public void setContext(HiveLockManagerCtx ctx)
throws LockException
- Specified by:
setContext
in interface HiveLockManager
- Parameters:
ctx
- The lock manager context (containing the Hive configuration file)
Start the ZooKeeper client based on the zookeeper cluster specified in the conf.
- Throws:
LockException
refresh
public void refresh()
- Description copied from interface:
HiveLockManager
- refresh to enable new configurations.
- Specified by:
refresh
in interface HiveLockManager
lock
public List<HiveLock> lock(List<HiveLockObj> lockObjects,
boolean keepAlive)
throws LockException
- Specified by:
lock
in interface HiveLockManager
- Parameters:
lockObjects
- 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.
- Throws:
LockException
releaseLocks
public void releaseLocks(List<HiveLock> hiveLocks)
- Specified by:
releaseLocks
in interface HiveLockManager
- Parameters:
hiveLocks
- list of hive locks to be released Release all the locks specified. If some of the
locks have already been released, ignore them
lock
public ZooKeeperHiveLock lock(HiveLockObject key,
HiveLockMode mode,
boolean keepAlive)
throws LockException
- Specified by:
lock
in interface HiveLockManager
- Parameters:
key
- The object to be lockedmode
- The mode of the lockkeepAlive
- Whether the lock is to be persisted after the statement Acuire the
lock. Return null if a conflicting lock is present.
- Throws:
LockException
unlock
public void unlock(HiveLock hiveLock)
throws LockException
- Specified by:
unlock
in interface HiveLockManager
- Throws:
LockException
releaseAllLocks
public static void releaseAllLocks(HiveConf conf)
throws Exception
- Throws:
Exception
getLocks
public List<HiveLock> getLocks(boolean verifyTablePartition,
boolean fetchData)
throws LockException
- Specified by:
getLocks
in interface HiveLockManager
- Throws:
LockException
getLocks
public List<HiveLock> getLocks(HiveLockObject key,
boolean verifyTablePartitions,
boolean fetchData)
throws LockException
- Specified by:
getLocks
in interface HiveLockManager
- Throws:
LockException
close
public void close()
throws LockException
- Specified by:
close
in interface HiveLockManager
- Throws:
LockException
prepareRetry
public void prepareRetry()
throws LockException
- Specified by:
prepareRetry
in interface HiveLockManager
- Throws:
LockException
Copyright © 2014 The Apache Software Foundation. All rights reserved.