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(byte[] table, byte[] key, byte[] family)
          Constructor.
GetRequest(byte[] table, byte[] key, byte[][] families, byte[][][] qualifiers)
          Constructor.
GetRequest(byte[] table, byte[] key, byte[] family, byte[] qualifier)
          Constructor.
GetRequest(String table, byte[] key)
          Constructor.
GetRequest(String table, String key)
          Constructor.
GetRequest(String table, String key, String family)
          Constructor.
GetRequest(String table, String key, String family, String qualifier)
          Constructor.
 
Method Summary
 GetRequest families(byte[][] families)
          Specifies the set of column families to get.
 GetRequest families(String[] families)
          Specifies the set of column families to get.
 byte[] family()
          Returns the first family of this RPC.
 GetRequest family(byte[] family)
          Specifies a particular column family to get.
 GetRequest family(String family)
          Specifies a particular column family to get.
 byte[][] getFamilies()
          Returns all families of this RPC.
 byte[][][] getQualifiers()
          Returns the column qualifiers all column families of this RPC.
 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 for the first column family of this RPC.
 GetRequest qualifiers(byte[][] qualifiers)
          Specifies a particular set of column qualifiers to get.
 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 org.hbase.async.HBaseRpc
failfast, setFailfast
 
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.

GetRequest

public GetRequest(byte[] table,
                  byte[] key,
                  byte[] family)
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.
family - The column family.
Since:
1.5

GetRequest

public GetRequest(String table,
                  String key,
                  String family)
Constructor.

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

GetRequest

public GetRequest(byte[] table,
                  byte[] key,
                  byte[] family,
                  byte[] qualifier)
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.
family - The column family.
qualifier - The column qualifier.
Since:
1.5

GetRequest

public GetRequest(byte[] table,
                  byte[] key,
                  byte[][] families,
                  byte[][][] qualifiers)
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.
families - The column families.
qualifiers - The column qualifiers.
Since:
1.5

GetRequest

public GetRequest(String table,
                  String key,
                  String family,
                  String qualifier)
Constructor.

Parameters:
table - The non-empty name of the table to use.
key - The row key to get in that table.
family - The column family.
qualifier - The column qualifier.
Since:
1.5
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.


families

public GetRequest families(byte[][] families)
Specifies the set of column families to get.

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

families

public GetRequest families(String[] families)
Specifies the set of column families 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

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 first family of this RPC.

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
family in interface HBaseRpc.HasFamily

getFamilies

public byte[][] getFamilies()
Description copied from interface: HBaseRpc.HasFamily
Returns all families of this RPC.

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
getFamilies in interface HBaseRpc.HasFamily

qualifiers

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

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
qualifiers in interface HBaseRpc.HasQualifiers

getQualifiers

public byte[][][] getQualifiers()
Description copied from interface: HBaseRpc.HasQualifiers
Returns the column qualifiers all column families of this RPC.

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
getQualifiers in interface HBaseRpc.HasQualifiers

toString

public String toString()
Overrides:
toString in class HBaseRpc


Copyright © 2010-2015, The Async HBase Authors