org.apache.cassandra.db.context
Class CounterContext.ContextState
java.lang.Object
org.apache.cassandra.db.context.CounterContext.ContextState
- Enclosing class:
- CounterContext
public static class CounterContext.ContextState
- extends java.lang.Object
Helper class to work on contexts (works by iterating over them).
A context being abstractly a list of tuple (nodeid, clock, count), a
ContextState encapsulate a context and a position to one of the tuple.
It also allow to create new context iteratively.
Note: this is intrinsically a private class intended for use by the
methods of CounterContext only. It is however public because it is
convenient to create handcrafted context for unit tests.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
context
public final java.nio.ByteBuffer context
headerLength
public final int headerLength
CounterContext.ContextState
public CounterContext.ContextState(java.nio.ByteBuffer context,
int headerLength)
CounterContext.ContextState
public CounterContext.ContextState(java.nio.ByteBuffer context)
isDelta
public boolean isDelta()
hasRemaining
public boolean hasRemaining()
remainingHeaderLength
public int remainingHeaderLength()
remainingBodyLength
public int remainingBodyLength()
moveToNext
public void moveToNext()
copyTo
public void copyTo(CounterContext.ContextState other)
compareIdTo
public int compareIdTo(CounterContext.ContextState other)
reset
public void reset()
getNodeId
public NodeId getNodeId()
getClock
public long getClock()
getCount
public long getCount()
writeElement
public void writeElement(NodeId id,
long clock,
long count,
boolean isDelta)
writeElement
public void writeElement(NodeId id,
long clock,
long count)
elementIdx
public int elementIdx()
duplicate
public CounterContext.ContextState duplicate()
allocate
public static CounterContext.ContextState allocate(int elementCount,
int deltaCount)
allocate
public static CounterContext.ContextState allocate(int elementCount,
int deltaCount,
Allocator allocator)
Copyright © 2011 The Apache Software Foundation