This project has retired. For details please refer to its Attic page.
HBaseTableConnection (Apache Gora 0.2 API)

org.apache.gora.hbase.store
Class HBaseTableConnection

java.lang.Object
  extended by org.apache.gora.hbase.store.HBaseTableConnection
All Implemented Interfaces:
org.apache.hadoop.hbase.client.HTableInterface

public class HBaseTableConnection
extends Object
implements org.apache.hadoop.hbase.client.HTableInterface

Thread safe implementation to connect to a HBase table.


Constructor Summary
HBaseTableConnection(org.apache.hadoop.conf.Configuration conf, String tableName, boolean autoflush)
          Instantiate new connection.
 
Method Summary
 Object[] batch(List<org.apache.hadoop.hbase.client.Row> actions)
           
 void batch(List<org.apache.hadoop.hbase.client.Row> actions, Object[] results)
           
 boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, org.apache.hadoop.hbase.client.Delete delete)
           
 boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier, byte[] value, org.apache.hadoop.hbase.client.Put put)
           
 void close()
           
 void delete(org.apache.hadoop.hbase.client.Delete delete)
           
 void delete(List<org.apache.hadoop.hbase.client.Delete> deletes)
           
 boolean exists(org.apache.hadoop.hbase.client.Get get)
           
 void flushCommits()
           
 org.apache.hadoop.hbase.client.Result get(org.apache.hadoop.hbase.client.Get get)
           
 org.apache.hadoop.hbase.client.Result[] get(List<org.apache.hadoop.hbase.client.Get> gets)
           
 org.apache.hadoop.conf.Configuration getConfiguration()
           
 org.apache.hadoop.hbase.HRegionLocation getRegionLocation(byte[] bs)
          getRegionLocation provided by HTable but not HTableInterface.
 org.apache.hadoop.hbase.client.Result getRowOrBefore(byte[] row, byte[] family)
           
 org.apache.hadoop.hbase.client.ResultScanner getScanner(byte[] family)
           
 org.apache.hadoop.hbase.client.ResultScanner getScanner(byte[] family, byte[] qualifier)
           
 org.apache.hadoop.hbase.client.ResultScanner getScanner(org.apache.hadoop.hbase.client.Scan scan)
           
 org.apache.hadoop.hbase.util.Pair<byte[][],byte[][]> getStartEndKeys()
          getStartEndKeys provided by HTable but not HTableInterface.
 org.apache.hadoop.hbase.HTableDescriptor getTableDescriptor()
           
 byte[] getTableName()
           
 org.apache.hadoop.hbase.client.Result increment(org.apache.hadoop.hbase.client.Increment increment)
           
 long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount)
           
 long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL)
           
 boolean isAutoFlush()
           
 org.apache.hadoop.hbase.client.RowLock lockRow(byte[] row)
           
 void put(List<org.apache.hadoop.hbase.client.Put> puts)
           
 void put(org.apache.hadoop.hbase.client.Put put)
           
 void unlockRow(org.apache.hadoop.hbase.client.RowLock rl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HBaseTableConnection

public HBaseTableConnection(org.apache.hadoop.conf.Configuration conf,
                            String tableName,
                            boolean autoflush)
                     throws IOException
Instantiate new connection.

Parameters:
conf -
tableName -
autoflush -
Throws:
IOException
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

getTableName

public byte[] getTableName()
Specified by:
getTableName in interface org.apache.hadoop.hbase.client.HTableInterface

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()
Specified by:
getConfiguration in interface org.apache.hadoop.hbase.client.HTableInterface

isAutoFlush

public boolean isAutoFlush()
Specified by:
isAutoFlush in interface org.apache.hadoop.hbase.client.HTableInterface

getStartEndKeys

public org.apache.hadoop.hbase.util.Pair<byte[][],byte[][]> getStartEndKeys()
                                                                     throws IOException
getStartEndKeys provided by HTable but not HTableInterface.

Throws:
IOException
See Also:
HTable.getStartEndKeys()

getRegionLocation

public org.apache.hadoop.hbase.HRegionLocation getRegionLocation(byte[] bs)
                                                          throws IOException
getRegionLocation provided by HTable but not HTableInterface.

Throws:
IOException
See Also:
HTable.getRegionLocation(byte[])

getTableDescriptor

public org.apache.hadoop.hbase.HTableDescriptor getTableDescriptor()
                                                            throws IOException
Specified by:
getTableDescriptor in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

exists

public boolean exists(org.apache.hadoop.hbase.client.Get get)
               throws IOException
Specified by:
exists in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

batch

public void batch(List<org.apache.hadoop.hbase.client.Row> actions,
                  Object[] results)
           throws IOException,
                  InterruptedException
Specified by:
batch in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException
InterruptedException

batch

public Object[] batch(List<org.apache.hadoop.hbase.client.Row> actions)
               throws IOException,
                      InterruptedException
Specified by:
batch in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException
InterruptedException

get

public org.apache.hadoop.hbase.client.Result get(org.apache.hadoop.hbase.client.Get get)
                                          throws IOException
Specified by:
get in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

get

public org.apache.hadoop.hbase.client.Result[] get(List<org.apache.hadoop.hbase.client.Get> gets)
                                            throws IOException
Specified by:
get in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

getRowOrBefore

public org.apache.hadoop.hbase.client.Result getRowOrBefore(byte[] row,
                                                            byte[] family)
                                                     throws IOException
Specified by:
getRowOrBefore in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

getScanner

public org.apache.hadoop.hbase.client.ResultScanner getScanner(org.apache.hadoop.hbase.client.Scan scan)
                                                        throws IOException
Specified by:
getScanner in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

getScanner

public org.apache.hadoop.hbase.client.ResultScanner getScanner(byte[] family)
                                                        throws IOException
Specified by:
getScanner in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

getScanner

public org.apache.hadoop.hbase.client.ResultScanner getScanner(byte[] family,
                                                               byte[] qualifier)
                                                        throws IOException
Specified by:
getScanner in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

put

public void put(org.apache.hadoop.hbase.client.Put put)
         throws IOException
Specified by:
put in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

put

public void put(List<org.apache.hadoop.hbase.client.Put> puts)
         throws IOException
Specified by:
put in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

checkAndPut

public boolean checkAndPut(byte[] row,
                           byte[] family,
                           byte[] qualifier,
                           byte[] value,
                           org.apache.hadoop.hbase.client.Put put)
                    throws IOException
Specified by:
checkAndPut in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

delete

public void delete(org.apache.hadoop.hbase.client.Delete delete)
            throws IOException
Specified by:
delete in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

delete

public void delete(List<org.apache.hadoop.hbase.client.Delete> deletes)
            throws IOException
Specified by:
delete in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

checkAndDelete

public boolean checkAndDelete(byte[] row,
                              byte[] family,
                              byte[] qualifier,
                              byte[] value,
                              org.apache.hadoop.hbase.client.Delete delete)
                       throws IOException
Specified by:
checkAndDelete in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

increment

public org.apache.hadoop.hbase.client.Result increment(org.apache.hadoop.hbase.client.Increment increment)
                                                throws IOException
Specified by:
increment in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

incrementColumnValue

public long incrementColumnValue(byte[] row,
                                 byte[] family,
                                 byte[] qualifier,
                                 long amount)
                          throws IOException
Specified by:
incrementColumnValue in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

incrementColumnValue

public long incrementColumnValue(byte[] row,
                                 byte[] family,
                                 byte[] qualifier,
                                 long amount,
                                 boolean writeToWAL)
                          throws IOException
Specified by:
incrementColumnValue in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

flushCommits

public void flushCommits()
                  throws IOException
Specified by:
flushCommits in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

lockRow

public org.apache.hadoop.hbase.client.RowLock lockRow(byte[] row)
                                               throws IOException
Specified by:
lockRow in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException

unlockRow

public void unlockRow(org.apache.hadoop.hbase.client.RowLock rl)
               throws IOException
Specified by:
unlockRow in interface org.apache.hadoop.hbase.client.HTableInterface
Throws:
IOException


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.