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

java.lang.Object
  extended by org.apache.hadoop.hive.ql.lockmgr.TxnManagerFactory

public class TxnManagerFactory
extends Object

A factory to get an instance of HiveTxnManager. This should always be called rather than building a transaction manager via reflection. This factory will read the configuration file to determine which transaction manager to instantiate. It will stash the chosen transaction manager into the Context object, and subsequently return it from there so that if there are multiple Hive threads running, each will get it's appropriate transaction manager.


Method Summary
 HiveTxnManager getTxnManager(HiveConf conf)
          Create a new transaction manager.
static TxnManagerFactory getTxnManagerFactory()
          Get the singleton instance of this factory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTxnManagerFactory

public static TxnManagerFactory getTxnManagerFactory()
Get the singleton instance of this factory.

Returns:
this factory

getTxnManager

public HiveTxnManager getTxnManager(HiveConf conf)
                             throws LockException
Create a new transaction manager. The transaction manager to instantiate will be determined by the hive.txn.manager value in the configuration. This should not be called if a transaction manager has already been constructed and stored in the Context object.

Parameters:
conf - HiveConf object used to construct the transaction manager
Returns:
the transaction manager
Throws:
LockException - if there is an error constructing the transaction manager.


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