|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.btree.BTree.PartitionedCounter
public static class BTree.PartitionedCounter
Places the counter values into a namespace formed by the partition
identifier. The partition identifier is found in the high int32 word and
the counter value from the underlying BTree is found in the low
int32 word.
| Constructor Summary | |
|---|---|
BTree.PartitionedCounter(int partitionId,
ICounter src)
|
|
| Method Summary | |
|---|---|
static long |
combine(int pid,
int ctr)
Combines the partition identifier and the local counter using the same logic as the BTree.PartitionedCounter. |
long |
get()
The current value of the counter (initially zero). |
static int |
getLocalCounter(long v)
Return the local counter from the low word of a partitioned counter. |
static int |
getPartitionId(long v)
Return the partition identifier from the high word of a partitioned counter. |
long |
incrementAndGet()
Increment the current value of the counter and then return its value (atomic). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BTree.PartitionedCounter(int partitionId,
ICounter src)
| Method Detail |
|---|
public long get()
ICounter
get in interface ICounterpublic long incrementAndGet()
ICounter
incrementAndGet in interface ICounterpublic static int getPartitionId(long v)
v - The partitioned counter.
public static int getLocalCounter(long v)
v - The partitioned counter.
public static long combine(int pid,
int ctr)
BTree.PartitionedCounter.
pid - The partition identifier.ctr - The local counter.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||