org.apache.cassandra.db
Class CounterColumn

java.lang.Object
  extended by org.apache.cassandra.db.Column
      extended by org.apache.cassandra.db.CounterColumn
All Implemented Interfaces:
IColumn

public class CounterColumn
extends Column

A column that represents a partitioned counter.


Field Summary
protected static CounterContext contextManager
           
 
Fields inherited from class org.apache.cassandra.db.Column
name, timestamp, value
 
Fields inherited from interface org.apache.cassandra.db.IColumn
MAX_NAME_LENGTH
 
Constructor Summary
CounterColumn(java.nio.ByteBuffer name, java.nio.ByteBuffer value, long timestamp)
           
CounterColumn(java.nio.ByteBuffer name, java.nio.ByteBuffer value, long timestamp, long timestampOfLastDelete)
           
CounterColumn(java.nio.ByteBuffer name, long value, long timestamp)
           
CounterColumn(java.nio.ByteBuffer name, long value, long timestamp, long timestampOfLastDelete)
           
 
Method Summary
 CounterColumn computeOldShardMerger()
           
static CounterColumn create(java.nio.ByteBuffer name, java.nio.ByteBuffer value, long timestamp, long timestampOfLastDelete, boolean fromRemote)
           
 IColumn diff(IColumn column)
           
 boolean equals(java.lang.Object o)
           
 java.lang.String getString(AbstractType comparator)
           
 int hashCode()
           
 boolean hasNodeId(NodeId id)
          Check if a given nodeId is found in this CounterColumn context.
 IColumn localCopy(ColumnFamilyStore cfs)
          clones the column for the row cache, interning column names and making copies of other underlying byte buffers
 IColumn localCopy(ColumnFamilyStore cfs, Allocator allocator)
          clones the column for the memtable, interning column names and making copies of other underlying byte buffers.
 IColumn markDeltaToBeCleared()
           
 IColumn reconcile(IColumn column, Allocator allocator)
           
static void removeOldShards(ColumnFamily cf, int gcBefore)
           
 int serializationFlags()
           
 int size()
           
 long timestampOfLastDelete()
           
 long total()
           
 void updateDigest(java.security.MessageDigest digest)
           
 void validateFields(CFMetaData metadata)
           
 
Methods inherited from class org.apache.cassandra.db.Column
addColumn, addColumn, getLocalDeletionTime, getMarkedForDeleteAt, getSubColumn, getSubColumns, isLive, isMarkedForDelete, maxTimestamp, minTimestamp, mostRecentLiveChangeAt, name, reconcile, serializedSize, serializer, timestamp, validateName, value
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contextManager

protected static final CounterContext contextManager
Constructor Detail

CounterColumn

public CounterColumn(java.nio.ByteBuffer name,
                     long value,
                     long timestamp)

CounterColumn

public CounterColumn(java.nio.ByteBuffer name,
                     long value,
                     long timestamp,
                     long timestampOfLastDelete)

CounterColumn

public CounterColumn(java.nio.ByteBuffer name,
                     java.nio.ByteBuffer value,
                     long timestamp)

CounterColumn

public CounterColumn(java.nio.ByteBuffer name,
                     java.nio.ByteBuffer value,
                     long timestamp,
                     long timestampOfLastDelete)
Method Detail

create

public static CounterColumn create(java.nio.ByteBuffer name,
                                   java.nio.ByteBuffer value,
                                   long timestamp,
                                   long timestampOfLastDelete,
                                   boolean fromRemote)

timestampOfLastDelete

public long timestampOfLastDelete()

total

public long total()

size

public int size()
Specified by:
size in interface IColumn
Overrides:
size in class Column

diff

public IColumn diff(IColumn column)
Specified by:
diff in interface IColumn
Overrides:
diff in class Column

updateDigest

public void updateDigest(java.security.MessageDigest digest)
Specified by:
updateDigest in interface IColumn
Overrides:
updateDigest in class Column

reconcile

public IColumn reconcile(IColumn column,
                         Allocator allocator)
Specified by:
reconcile in interface IColumn
Overrides:
reconcile in class Column

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class Column

hashCode

public int hashCode()
Overrides:
hashCode in class Column

localCopy

public IColumn localCopy(ColumnFamilyStore cfs)
Description copied from interface: IColumn
clones the column for the row cache, interning column names and making copies of other underlying byte buffers

Specified by:
localCopy in interface IColumn
Overrides:
localCopy in class Column

localCopy

public IColumn localCopy(ColumnFamilyStore cfs,
                         Allocator allocator)
Description copied from interface: IColumn
clones the column for the memtable, interning column names and making copies of other underlying byte buffers. Unlike the other localCopy, this uses Allocator to allocate values in contiguous memory regions, which helps avoid heap fragmentation.

Specified by:
localCopy in interface IColumn
Overrides:
localCopy in class Column

getString

public java.lang.String getString(AbstractType comparator)
Specified by:
getString in interface IColumn
Overrides:
getString in class Column

serializationFlags

public int serializationFlags()
Specified by:
serializationFlags in interface IColumn
Overrides:
serializationFlags in class Column

validateFields

public void validateFields(CFMetaData metadata)
                    throws MarshalException
Specified by:
validateFields in interface IColumn
Overrides:
validateFields in class Column
Throws:
MarshalException

hasNodeId

public boolean hasNodeId(NodeId id)
Check if a given nodeId is found in this CounterColumn context.


computeOldShardMerger

public CounterColumn computeOldShardMerger()

removeOldShards

public static void removeOldShards(ColumnFamily cf,
                                   int gcBefore)

markDeltaToBeCleared

public IColumn markDeltaToBeCleared()


Copyright © 2011 The Apache Software Foundation