org.hbase.async
Class GetRequest

java.lang.Object
  extended by org.hbase.async.HBaseRpc
      extended by org.hbase.async.GetRequest
All Implemented Interfaces:
HBaseRpc.HasFamily, HBaseRpc.HasKey, HBaseRpc.HasQualifiers, HBaseRpc.HasTable

public final class GetRequest
extends HBaseRpc
implements HBaseRpc.HasTable, HBaseRpc.HasKey, HBaseRpc.HasFamily, HBaseRpc.HasQualifiers

Reads something from HBase.

A note on passing byte arrays in argument

None of the method that receive a byte[] in argument will copy it. For more info, please refer to the documentation of HBaseRpc.

A note on passing Strings in argument

All strings are assumed to use the platform's default charset.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.hbase.async.HBaseRpc
HBaseRpc.HasFamily, HBaseRpc.HasKey, HBaseRpc.HasQualifier, HBaseRpc.HasQualifiers, HBaseRpc.HasTable, HBaseRpc.HasTimestamp, HBaseRpc.HasValue, HBaseRpc.HasValues
 
Constructor Summary
GetRequest(byte[] table, byte[] key)
          Constructor.
GetRequest(String table, byte[] key)
          Constructor.
GetRequest(String table, String key)
          Constructor.
 
Method Summary
 byte[] family()
          Returns the family this RPC is for.
 GetRequest family(byte[] family)
          Specifies a particular column family to get.
 GetRequest family(String family)
          Specifies a particular column family to get.
 byte[] key()
          Returns the row key this RPC is for.
 int maxVersions()
          Returns the maximum number of versions to return for each cell scanned.
 GetRequest maxVersions(int versions)
          Sets the maximum number of versions to return for each cell read.
 GetRequest qualifier(byte[] qualifier)
          Specifies a particular column qualifier to get.
 GetRequest qualifier(String qualifier)
          Specifies a particular column qualifier to get.
 byte[][] qualifiers()
          Returns the column qualifiers this RPC is for.
 GetRequest qualifiers(byte[][] qualifiers)
          Specifies a particular set of column qualifiers to get.
 byte[] table()
          Returns the name of the table this RPC is for.
 String toString()
           
 GetRequest withRowLock(RowLock lock)
          Specifies an explicit row lock to use with this request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GetRequest

public GetRequest(byte[] table,
                  byte[] key)
Constructor. These byte arrays will NOT be copied.

Parameters:
table - The non-empty name of the table to use.
key - The row key to get in that table.

GetRequest

public GetRequest(String table,
                  byte[] key)
Constructor.

Parameters:
table - The non-empty name of the table to use.
key - The row key to get in that table. This byte array will NOT be copied.

GetRequest

public GetRequest(String table,
                  String key)
Constructor.

Parameters:
table - The non-empty name of the table to use.
key - The row key to get in that table.
Method Detail

family

public GetRequest family(byte[] family)
Specifies a particular column family to get.

Parameters:
family - The column family. This byte array will NOT be copied.
Returns:
this, always.

family

public GetRequest family(String family)
Specifies a particular column family to get.


qualifier

public GetRequest qualifier(byte[] qualifier)
Specifies a particular column qualifier to get.

Parameters:
qualifier - The column qualifier. This byte array will NOT be copied.
Returns:
this, always.

qualifiers

public GetRequest qualifiers(byte[][] qualifiers)
Specifies a particular set of column qualifiers to get.

Parameters:
qualifiers - The column qualifiers. This byte array will NOT be copied.
Returns:
this, always.
Since:
1.1

qualifier

public GetRequest qualifier(String qualifier)
Specifies a particular column qualifier to get.


withRowLock

public GetRequest withRowLock(RowLock lock)
Specifies an explicit row lock to use with this request.


maxVersions

public GetRequest maxVersions(int versions)
Sets the maximum number of versions to return for each cell read.

By default only the most recent version of each cell is read. If you want to get all possible versions available, pass Integer.MAX_VALUE in argument.

Parameters:
versions - A strictly positive number of versions to return.
Returns:
this, always.
Throws:
IllegalArgumentException - if versions <= 0
Since:
1.4

maxVersions

public int maxVersions()
Returns the maximum number of versions to return for each cell scanned.

Returns:
A strictly positive integer.
Since:
1.4

table

public byte[] table()
Description copied from interface: HBaseRpc.HasTable
Returns the name of the table this RPC is for.

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
table in interface HBaseRpc.HasTable

key

public byte[] key()
Description copied from interface: HBaseRpc.HasKey
Returns the row key this RPC is for.

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
key in interface HBaseRpc.HasKey

family

public byte[] family()
Description copied from interface: HBaseRpc.HasFamily
Returns the family this RPC is for.

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
family in interface HBaseRpc.HasFamily

qualifiers

public byte[][] qualifiers()
Description copied from interface: HBaseRpc.HasQualifiers
Returns the column qualifiers this RPC is for.

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
qualifiers in interface HBaseRpc.HasQualifiers

toString

public String toString()
Overrides:
toString in class HBaseRpc