org.apache.hadoop.hive.ql.lockmgr
Class DbLockManager

java.lang.Object
  extended by org.apache.hadoop.hive.ql.lockmgr.DbLockManager
All Implemented Interfaces:
HiveLockManager

public class DbLockManager
extends Object
implements HiveLockManager

An implementation of HiveLockManager for use with DbTxnManager. Note, this lock manager is not meant to stand alone. It cannot be used without the DbTxnManager.


Method Summary
 void close()
           
 org.apache.hadoop.hive.metastore.api.ShowLocksResponse getLocks()
           
 List<HiveLock> getLocks(boolean verifyTablePartitions, boolean fetchData)
           
 List<HiveLock> getLocks(HiveLockObject key, boolean verifyTablePartitions, boolean fetchData)
           
 HiveLock lock(HiveLockObject key, HiveLockMode mode, boolean keepAlive)
           
 List<HiveLock> lock(List<HiveLockObj> objs, boolean keepAlive)
           
 void prepareRetry()
           
 void refresh()
          refresh to enable new configurations.
 void releaseLocks(List<HiveLock> hiveLocks)
           
 void setContext(HiveLockManagerCtx ctx)
           
 void unlock(HiveLock hiveLock)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setContext

public void setContext(HiveLockManagerCtx ctx)
                throws LockException
Specified by:
setContext in interface HiveLockManager
Throws:
LockException

lock

public HiveLock lock(HiveLockObject key,
                     HiveLockMode mode,
                     boolean keepAlive)
              throws LockException
Specified by:
lock in interface HiveLockManager
Parameters:
key - object to be locked
mode - mode of the lock (SHARED/EXCLUSIVE)
keepAlive - if the lock needs to be persisted after the statement
Throws:
LockException

lock

public List<HiveLock> lock(List<HiveLockObj> objs,
                           boolean keepAlive)
                    throws LockException
Specified by:
lock in interface HiveLockManager
Throws:
LockException

unlock

public void unlock(HiveLock hiveLock)
            throws LockException
Specified by:
unlock in interface HiveLockManager
Throws:
LockException

releaseLocks

public void releaseLocks(List<HiveLock> hiveLocks)
Specified by:
releaseLocks in interface HiveLockManager

getLocks

public List<HiveLock> getLocks(boolean verifyTablePartitions,
                               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

getLocks

public org.apache.hadoop.hive.metastore.api.ShowLocksResponse getLocks()
                                                                throws LockException
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

refresh

public void refresh()
Description copied from interface: HiveLockManager
refresh to enable new configurations.

Specified by:
refresh in interface HiveLockManager


Copyright © 2014 The Apache Software Foundation. All rights reserved.