org.apache.hadoop.hbase.client.transactional
Class LocalTransactionLogger

java.lang.Object
  extended by org.apache.hadoop.hbase.client.transactional.LocalTransactionLogger
All Implemented Interfaces:
TransactionLogger

public class LocalTransactionLogger
extends Object
implements TransactionLogger

A local, in-memory implementation of the transaction logger. Does not provide a global view, so it can't be relighed on by


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.client.transactional.TransactionLogger
TransactionLogger.TransactionStatus
 
Method Summary
 long createNewTransactionLog()
          Create a new transaction log.
static LocalTransactionLogger getInstance()
          Creates singleton if it does not exist
 TransactionLogger.TransactionStatus getStatusForTransaction(long transactionId)
           
 void setStatusForTransaction(long transactionId, TransactionLogger.TransactionStatus status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static LocalTransactionLogger getInstance()
Creates singleton if it does not exist

Returns:
reference to singleton

createNewTransactionLog

public long createNewTransactionLog()
Description copied from interface: TransactionLogger
Create a new transaction log. Return the transaction's globally unique id. Log's initial value should be PENDING

Specified by:
createNewTransactionLog in interface TransactionLogger
Returns:
random longs to minimize possibility of collision

getStatusForTransaction

public TransactionLogger.TransactionStatus getStatusForTransaction(long transactionId)
Specified by:
getStatusForTransaction in interface TransactionLogger
Returns:
transaction status

setStatusForTransaction

public void setStatusForTransaction(long transactionId,
                                    TransactionLogger.TransactionStatus status)
Specified by:
setStatusForTransaction in interface TransactionLogger


Copyright © 2008 The Apache Software Foundation