|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.client.Increment
public class Increment
Used to perform Increment operations on a single row.
This operation does not appear atomic to readers. Increments are done under a single row lock, so write operations to a row are synchronized, but readers do not take row locks so get and scan operations can see this operation partially completed.
To increment columns of a row, instantiate an Increment object with the row
to increment. At least one column to increment must be specified using the
addColumn(byte[], byte[], long)
method.
Constructor Summary | |
---|---|
Increment()
Constructor for Writable. |
|
Increment(byte[] row)
Create a Increment operation for the specified row. |
|
Increment(byte[] row,
RowLock rowLock)
Create a Increment operation for the specified row, using an existing row lock. |
Method Summary | |
---|---|
Increment |
addColumn(byte[] family,
byte[] qualifier,
long amount)
Increment the column from the specific family with the specified qualifier by the specified amount. |
Set<byte[]> |
familySet()
Method for retrieving the keys in the familyMap |
Map<byte[],NavigableMap<byte[],Long>> |
getFamilyMap()
Method for retrieving the increment's familyMap |
long |
getLockId()
Method for retrieving the increment's lockId |
byte[] |
getRow()
Method for retrieving the increment's row |
RowLock |
getRowLock()
Method for retrieving the increment's RowLock |
TimeRange |
getTimeRange()
Gets the TimeRange used for this increment. |
boolean |
getWriteToWAL()
Method for retrieving whether WAL will be written to or not |
boolean |
hasFamilies()
Method for checking if any families have been inserted into this Increment |
int |
numColumns()
Method for retrieving the number of columns to increment |
int |
numFamilies()
Method for retrieving the number of families to increment from |
void |
readFields(DataInput in)
|
Increment |
setTimeRange(long minStamp,
long maxStamp)
Sets the TimeRange to be used on the Get for this increment. |
Increment |
setWriteToWAL(boolean writeToWAL)
Sets whether this operation should write to the WAL or not. |
String |
toString()
|
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Increment()
public Increment(byte[] row)
At least one column must be incremented.
row
- row keypublic Increment(byte[] row, RowLock rowLock)
At least one column must be incremented.
row
- row keyrowLock
- previously acquired row lock, or nullMethod Detail |
---|
public Increment addColumn(byte[] family, byte[] qualifier, long amount)
Overrides previous calls to addColumn for this family and qualifier.
family
- family namequalifier
- column qualifieramount
- amount to increment by
public byte[] getRow()
public RowLock getRowLock()
public long getLockId()
public boolean getWriteToWAL()
public Increment setWriteToWAL(boolean writeToWAL)
writeToWAL
- true if WAL should be used, false if not
public TimeRange getTimeRange()
public Increment setTimeRange(long minStamp, long maxStamp) throws IOException
This is useful for when you have counters that only last for specific periods of time (ie. counters that are partitioned by time). By setting the range of valid times for this increment, you can potentially gain some performance with a more optimal Get operation.
This range is used as [minStamp, maxStamp).
minStamp
- minimum timestamp value, inclusivemaxStamp
- maximum timestamp value, exclusive
IOException
- if invalid time rangepublic Set<byte[]> familySet()
public int numFamilies()
public int numColumns()
public boolean hasFamilies()
public Map<byte[],NavigableMap<byte[],Long>> getFamilyMap()
public String toString()
toString
in class Object
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |