org.apache.hadoop.hbase.rest.client
Class RemoteHTable

java.lang.Object
  extended by org.apache.hadoop.hbase.rest.client.RemoteHTable
All Implemented Interfaces:
Closeable, HTableInterface

@InterfaceAudience.Public
@InterfaceStability.Stable
public class RemoteHTable
extends Object
implements HTableInterface

HTable interface to remote tables accessed via REST gateway


Constructor Summary
RemoteHTable(Client client, org.apache.hadoop.conf.Configuration conf, byte[] name)
          Constructor
RemoteHTable(Client client, org.apache.hadoop.conf.Configuration conf, String name)
          Constructor
RemoteHTable(Client client, String name)
          Constructor
 
Method Summary
 Result append(Append append)
           
 Object[] batch(List<? extends Row> actions)
           
 void batch(List<? extends Row> actions, Object[] results)
           
<R> Object[]
batchCallback(List<? extends Row> actions, Batch.Callback<R> callback)
           
<R> void
batchCallback(List<? extends Row> actions, Object[] results, Batch.Callback<R> callback)
           
protected  CellSetModel buildModelFromPut(Put put)
           
protected  String buildMultiRowSpec(byte[][] rows, int maxVersions)
           
protected  Result[] buildResultFromModel(CellSetModel model)
           
protected  String buildRowSpec(byte[] row, Map familyMap, long startTime, long endTime, int maxVersions)
           
 boolean checkAndDelete(byte[] row, byte[] family, byte[] qualifier, byte[] value, Delete delete)
           
 boolean checkAndPut(byte[] row, byte[] family, byte[] qualifier, byte[] value, Put put)
           
 void close()
           
 CoprocessorRpcChannel coprocessorService(byte[] row)
           
<T extends com.google.protobuf.Service,R>
Map<byte[],R>
coprocessorService(Class<T> service, byte[] startKey, byte[] endKey, Batch.Call<T,R> callable)
           
<T extends com.google.protobuf.Service,R>
void
coprocessorService(Class<T> service, byte[] startKey, byte[] endKey, Batch.Call<T,R> callable, Batch.Callback<R> callback)
           
 void delete(Delete delete)
           
 void delete(List<Delete> deletes)
           
 boolean exists(Get get)
           
 Boolean[] exists(List<Get> gets)
          exists(List) is really a list of get() calls.
 void flushCommits()
           
 Result get(Get get)
           
 Result[] get(List<Get> gets)
           
 org.apache.hadoop.conf.Configuration getConfiguration()
           
 TableName getName()
           
 Result getRowOrBefore(byte[] row, byte[] family)
           
 ResultScanner getScanner(byte[] family)
           
 ResultScanner getScanner(byte[] family, byte[] qualifier)
           
 ResultScanner getScanner(Scan scan)
           
 HTableDescriptor getTableDescriptor()
           
 byte[] getTableName()
           
 long getWriteBufferSize()
           
 Result increment(Increment increment)
           
 long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount)
           
 long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, boolean writeToWAL)
           
 long incrementColumnValue(byte[] row, byte[] family, byte[] qualifier, long amount, Durability durability)
           
 boolean isAutoFlush()
           
 void mutateRow(RowMutations rm)
           
 void put(List<Put> puts)
           
 void put(Put put)
           
 void setAutoFlush(boolean autoFlush)
           
 void setAutoFlush(boolean autoFlush, boolean clearBufferOnFail)
           
 void setAutoFlushTo(boolean autoFlush)
           
 void setWriteBufferSize(long writeBufferSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteHTable

public RemoteHTable(Client client,
                    String name)
Constructor

Parameters:
client -
name -

RemoteHTable

public RemoteHTable(Client client,
                    org.apache.hadoop.conf.Configuration conf,
                    String name)
Constructor

Parameters:
client -
conf -
name -

RemoteHTable

public RemoteHTable(Client client,
                    org.apache.hadoop.conf.Configuration conf,
                    byte[] name)
Constructor

Parameters:
client -
conf -
name -
Method Detail

buildRowSpec

protected String buildRowSpec(byte[] row,
                              Map familyMap,
                              long startTime,
                              long endTime,
                              int maxVersions)

buildMultiRowSpec

protected String buildMultiRowSpec(byte[][] rows,
                                   int maxVersions)

buildResultFromModel

protected Result[] buildResultFromModel(CellSetModel model)

buildModelFromPut

protected CellSetModel buildModelFromPut(Put put)

getTableName

public byte[] getTableName()
Specified by:
getTableName in interface HTableInterface

getName

public TableName getName()
Specified by:
getName in interface HTableInterface

getConfiguration

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

getTableDescriptor

public HTableDescriptor getTableDescriptor()
                                    throws IOException
Specified by:
getTableDescriptor in interface HTableInterface
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in interface HTableInterface
Throws:
IOException

get

public Result get(Get get)
           throws IOException
Specified by:
get in interface HTableInterface
Throws:
IOException

get

public Result[] get(List<Get> gets)
             throws IOException
Specified by:
get in interface HTableInterface
Throws:
IOException

exists

public boolean exists(Get get)
               throws IOException
Specified by:
exists in interface HTableInterface
Throws:
IOException

exists

public Boolean[] exists(List<Get> gets)
                 throws IOException
exists(List) is really a list of get() calls. Just use get().

Specified by:
exists in interface HTableInterface
Parameters:
gets - list of Get to test for the existence
Throws:
IOException

put

public void put(Put put)
         throws IOException
Specified by:
put in interface HTableInterface
Throws:
IOException

put

public void put(List<Put> puts)
         throws IOException
Specified by:
put in interface HTableInterface
Throws:
IOException

delete

public void delete(Delete delete)
            throws IOException
Specified by:
delete in interface HTableInterface
Throws:
IOException

delete

public void delete(List<Delete> deletes)
            throws IOException
Specified by:
delete in interface HTableInterface
Throws:
IOException

flushCommits

public void flushCommits()
                  throws IOException
Specified by:
flushCommits in interface HTableInterface
Throws:
IOException

getScanner

public ResultScanner getScanner(Scan scan)
                         throws IOException
Specified by:
getScanner in interface HTableInterface
Throws:
IOException

getScanner

public ResultScanner getScanner(byte[] family)
                         throws IOException
Specified by:
getScanner in interface HTableInterface
Throws:
IOException

getScanner

public ResultScanner getScanner(byte[] family,
                                byte[] qualifier)
                         throws IOException
Specified by:
getScanner in interface HTableInterface
Throws:
IOException

isAutoFlush

public boolean isAutoFlush()
Specified by:
isAutoFlush in interface HTableInterface

getRowOrBefore

public Result getRowOrBefore(byte[] row,
                             byte[] family)
                      throws IOException
Specified by:
getRowOrBefore in interface HTableInterface
Throws:
IOException

checkAndPut

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

checkAndDelete

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

increment

public Result increment(Increment increment)
                 throws IOException
Specified by:
increment in interface HTableInterface
Throws:
IOException

append

public Result append(Append append)
              throws IOException
Specified by:
append in interface HTableInterface
Throws:
IOException

incrementColumnValue

public long incrementColumnValue(byte[] row,
                                 byte[] family,
                                 byte[] qualifier,
                                 long amount)
                          throws IOException
Specified by:
incrementColumnValue in interface HTableInterface
Throws:
IOException

incrementColumnValue

public long incrementColumnValue(byte[] row,
                                 byte[] family,
                                 byte[] qualifier,
                                 long amount,
                                 Durability durability)
                          throws IOException
Specified by:
incrementColumnValue in interface HTableInterface
Throws:
IOException

batch

public void batch(List<? extends Row> actions,
                  Object[] results)
           throws IOException
Specified by:
batch in interface HTableInterface
Throws:
IOException

batch

public Object[] batch(List<? extends Row> actions)
               throws IOException
Specified by:
batch in interface HTableInterface
Throws:
IOException

batchCallback

public <R> void batchCallback(List<? extends Row> actions,
                              Object[] results,
                              Batch.Callback<R> callback)
                   throws IOException,
                          InterruptedException
Specified by:
batchCallback in interface HTableInterface
Throws:
IOException
InterruptedException

batchCallback

public <R> Object[] batchCallback(List<? extends Row> actions,
                                  Batch.Callback<R> callback)
                       throws IOException,
                              InterruptedException
Specified by:
batchCallback in interface HTableInterface
Throws:
IOException
InterruptedException

coprocessorService

public CoprocessorRpcChannel coprocessorService(byte[] row)
Specified by:
coprocessorService in interface HTableInterface

coprocessorService

public <T extends com.google.protobuf.Service,R> Map<byte[],R> coprocessorService(Class<T> service,
                                                                                  byte[] startKey,
                                                                                  byte[] endKey,
                                                                                  Batch.Call<T,R> callable)
                                 throws com.google.protobuf.ServiceException,
                                        Throwable
Specified by:
coprocessorService in interface HTableInterface
Throws:
com.google.protobuf.ServiceException
Throwable

coprocessorService

public <T extends com.google.protobuf.Service,R> void coprocessorService(Class<T> service,
                                                                         byte[] startKey,
                                                                         byte[] endKey,
                                                                         Batch.Call<T,R> callable,
                                                                         Batch.Callback<R> callback)
                        throws com.google.protobuf.ServiceException,
                               Throwable
Specified by:
coprocessorService in interface HTableInterface
Throws:
com.google.protobuf.ServiceException
Throwable

mutateRow

public void mutateRow(RowMutations rm)
               throws IOException
Specified by:
mutateRow in interface HTableInterface
Throws:
IOException

setAutoFlush

public void setAutoFlush(boolean autoFlush)
Specified by:
setAutoFlush in interface HTableInterface

setAutoFlush

public void setAutoFlush(boolean autoFlush,
                         boolean clearBufferOnFail)
Specified by:
setAutoFlush in interface HTableInterface

setAutoFlushTo

public void setAutoFlushTo(boolean autoFlush)
Specified by:
setAutoFlushTo in interface HTableInterface

getWriteBufferSize

public long getWriteBufferSize()
Specified by:
getWriteBufferSize in interface HTableInterface

setWriteBufferSize

public void setWriteBufferSize(long writeBufferSize)
                        throws IOException
Specified by:
setWriteBufferSize in interface HTableInterface
Throws:
IOException

incrementColumnValue

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


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