org.hbase.async
Class AtomicIncrementRequest

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

public final class AtomicIncrementRequest
extends HBaseRpc
implements HBaseRpc.HasTable, HBaseRpc.HasKey, HBaseRpc.HasFamily, HBaseRpc.HasQualifier

Atomically increments a value in 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
AtomicIncrementRequest(byte[] table, byte[] key, byte[] family, byte[] qualifier)
          Constructor.
AtomicIncrementRequest(byte[] table, byte[] key, byte[] family, byte[] qualifier, long amount)
          Constructor.
AtomicIncrementRequest(String table, String key, String family, String qualifier)
          Constructor.
AtomicIncrementRequest(String table, String key, String family, String qualifier, long amount)
          Constructor.
 
Method Summary
 byte[] family()
          Returns the family this RPC is for.
 long getAmount()
          Returns the amount by which the value is going to be incremented.
 byte[] key()
          Returns the row key this RPC is for.
 byte[] qualifier()
          Returns the column qualifier this RPC is for.
 void setAmount(long amount)
          Changes the amount by which the value is going to be incremented.
 byte[] table()
          Returns the name of the table this RPC is for.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AtomicIncrementRequest

public AtomicIncrementRequest(byte[] table,
                              byte[] key,
                              byte[] family,
                              byte[] qualifier,
                              long amount)
Constructor. These byte arrays will NOT be copied.

Parameters:
table - The non-empty name of the table to use.
key - The row key of the value to increment.
family - The column family of the value to increment.
qualifier - The column qualifier of the value to increment.
amount - Amount by which to increment the value in HBase. If negative, the value in HBase will be decremented.

AtomicIncrementRequest

public AtomicIncrementRequest(byte[] table,
                              byte[] key,
                              byte[] family,
                              byte[] qualifier)
Constructor. This is equivalent to: AtomicIncrementRequest(table, key, family, qualifier, 1)

These byte arrays will NOT be copied.

Parameters:
table - The non-empty name of the table to use.
key - The row key of the value to increment.
family - The column family of the value to increment.
qualifier - The column qualifier of the value to increment.

AtomicIncrementRequest

public AtomicIncrementRequest(String table,
                              String key,
                              String family,
                              String qualifier,
                              long amount)
Constructor. All strings are assumed to use the platform's default charset.

Parameters:
table - The non-empty name of the table to use.
key - The row key of the value to increment.
family - The column family of the value to increment.
qualifier - The column qualifier of the value to increment.
amount - Amount by which to increment the value in HBase. If negative, the value in HBase will be decremented.

AtomicIncrementRequest

public AtomicIncrementRequest(String table,
                              String key,
                              String family,
                              String qualifier)
Constructor. This is equivalent to: All strings are assumed to use the platform's default charset. AtomicIncrementRequest(table, key, family, qualifier, 1)

Parameters:
table - The non-empty name of the table to use.
key - The row key of the value to increment.
family - The column family of the value to increment.
qualifier - The column qualifier of the value to increment.
Method Detail

getAmount

public long getAmount()
Returns the amount by which the value is going to be incremented.


setAmount

public void setAmount(long amount)
Changes the amount by which the value is going to be incremented.

Parameters:
amount - The new amount. If negative, the value will be decremented.

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

qualifier

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

DO NOT MODIFY THE CONTENTS OF THE ARRAY RETURNED.

Specified by:
qualifier in interface HBaseRpc.HasQualifier

toString

public String toString()
Overrides:
toString in class HBaseRpc