|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hadoop.hive.ql.lockmgr.DbTxnManager
public class DbTxnManager
An implementation of HiveTxnManager that stores the transactions in the metastore database.
Method Summary | |
---|---|
void |
acquireLocks(QueryPlan plan,
Context ctx,
String username)
Acquire all of the locks needed by a query. |
void |
closeTxnManager()
This call closes down the transaction manager. |
void |
commitTxn()
Commit the current transaction. |
HiveLockManager |
getLockManager()
Get the lock manager. |
ValidTxnList |
getValidTxns()
Get the transactions that are currently valid. |
void |
heartbeat()
Send a heartbeat to the transaction management storage so other Hive clients know that the transaction and locks held by this client are still valid. |
void |
openTxn(String user)
Open a new transaction. |
void |
rollbackTxn()
Abort the current transaction. |
boolean |
supportsExplicitLock()
Indicate whether this lock manager supports the use of lock
database or lock table . |
boolean |
useNewShowLocksFormat()
Indicate whether this transaction manager returns information about locks in the new format for show locks or the old one. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void openTxn(String user) throws LockException
HiveTxnManager
user
- Hive user who is opening this transaction.
LockException
- if a transaction is already open.public HiveLockManager getLockManager() throws LockException
HiveTxnManager
LockException
- if there is an issue obtaining the lock manager.public void acquireLocks(QueryPlan plan, Context ctx, String username) throws LockException
HiveTxnManager
HiveTxnManager.openTxn(String)
.
A list of acquired locks will be stored in the
Context
object and can be retrieved
via Context.getHiveLocks()
.
plan
- query planctx
- Context for this queryusername
- name of the user for this query
LockException
- if there is an error getting the lockspublic void commitTxn() throws LockException
HiveTxnManager
HiveTxnManager.acquireLocks(org.apache.hadoop.hive.ql.QueryPlan,
org.apache.hadoop.hive.ql.Context, java.lang.String)
.
LockException
- if there is no current transaction or the
transaction has already been committed or aborted.public void rollbackTxn() throws LockException
HiveTxnManager
HiveTxnManager.acquireLocks(org.apache.hadoop.hive.ql.QueryPlan,
org.apache.hadoop.hive.ql.Context, java.lang.String)
.
LockException
- if there is no current transaction or the
transaction has already been committed or aborted.public void heartbeat() throws LockException
HiveTxnManager
LockException
- If current transaction exists or the transaction
has already been committed or aborted.public ValidTxnList getValidTxns() throws LockException
HiveTxnManager
ValidTxnList
object is a thrift object and can
be passed to the processing
tasks for use in the reading the data. This call should be made once up
front by the planner and should never be called on the backend,
as this will violate the isolation level semantics.
LockException
public boolean supportsExplicitLock()
HiveTxnManager
lock
database
or lock table
.
public boolean useNewShowLocksFormat()
HiveTxnManager
public void closeTxnManager()
HiveTxnManager
closeTxnManager
in interface HiveTxnManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |