org.apache.hadoop.hbase.regionserver
Class ColumnCount

java.lang.Object
  extended by org.apache.hadoop.hbase.regionserver.ColumnCount

public class ColumnCount
extends Object

Simple wrapper for a byte buffer and a counter. Does not copy.

NOT thread-safe because it is not used in a multi-threaded context, yet.


Constructor Summary
ColumnCount(byte[] column)
          Constructor
ColumnCount(byte[] column, int count)
          Constructor
ColumnCount(byte[] column, int offset, int length, int count)
          Constuctor
 
Method Summary
 int decrement()
          Decrement the current version count
 byte[] getBuffer()
           
 int getLength()
           
 int getOffset()
           
 int increment()
          Increment the current version count
 boolean needMore(int max)
          Check to see if needed to fetch more versions
 void setCount(int count)
          Set the current count to a new count
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnCount

public ColumnCount(byte[] column)
Constructor

Parameters:
column - the qualifier to count the versions for

ColumnCount

public ColumnCount(byte[] column,
                   int count)
Constructor

Parameters:
column - the qualifier to count the versions for
count - initial count

ColumnCount

public ColumnCount(byte[] column,
                   int offset,
                   int length,
                   int count)
Constuctor

Parameters:
column - the qualifier to count the versions for
offset - in the passed buffer where to start the qualifier from
length - of the qualifier
count - initial count
Method Detail

getBuffer

public byte[] getBuffer()
Returns:
the buffer

getOffset

public int getOffset()
Returns:
the offset

getLength

public int getLength()
Returns:
the length

decrement

public int decrement()
Decrement the current version count

Returns:
current count

increment

public int increment()
Increment the current version count

Returns:
current count

setCount

public void setCount(int count)
Set the current count to a new count

Parameters:
count - new count to set

needMore

public boolean needMore(int max)
Check to see if needed to fetch more versions

Parameters:
max -
Returns:
true if more versions are needed, false otherwise


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