src/java/org/apache/cassandra/db/context/CounterContext.java
/**
     * Creates an initial counter context with an initial value for the local node.
     *
     *
     * @param value the value for this initial update
     *
     * @param allocator
     * @return an empty counter context.
     */
Creates an initial counter context with an initial value for the local node.
@param value the value for this initial update

@param allocator
@return an empty counter context.
Creates an initial counter context with an initial value for the local node . @param value the value for this initial update @param allocator @return an empty counter context .
public ByteBuffer create(long value, long timestamp, ByteBuffer coordinatorKey, Allocator allocator)
    {
        ByteBuffer context = allocator.allocate(HEADER_SIZE_LENGTH + HEADER_ELT_LENGTH + STEP_LENGTH);
        context.putShort(context.position(), (short)1);
        context.putShort(context.position() + HEADER_SIZE_LENGTH, (short)0);
        writeElementAtOffset(context, context.position() + HEADER_SIZE_LENGTH + HEADER_ELT_LENGTH, NodeId.getLocalId(), 1L, value, timestamp, coordinatorKey);
        return context;
    }
public ByteBuffer create ( long value , long timestamp , ByteBuffer coordinatorKey , Allocator allocator ) { ByteBuffer context = allocator . allocate ( HEADER_SIZE_LENGTH + HEADER_ELT_LENGTH + STEP_LENGTH ) ; context . putShort ( context . position ( ) , ( short ) 1 ) ; context . putShort ( context . position ( ) + HEADER_SIZE_LENGTH , ( short ) 0 ) ; writeElementAtOffset ( context , context . position ( ) + HEADER_SIZE_LENGTH + HEADER_ELT_LENGTH , NodeId . getLocalId ( ) , 1L , value , timestamp , coordinatorKey ) ; return context ; }
Creates an initial counter context with an initial value for the local node.
Creates an initial counter context with an initial value for the local node .
// The first (and only) elt is a delta