org.apache.cassandra.db
Class CounterColumn
java.lang.Object
org.apache.cassandra.db.Column
org.apache.cassandra.db.CounterColumn
- All Implemented Interfaces:
- IColumn
public class CounterColumn
- extends Column
A column that represents a partitioned counter.
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)
|
Methods inherited from class org.apache.cassandra.db.Column |
addColumn, getLocalDeletionTime, getMarkedForDeleteAt, getSubColumn, getSubColumns, isLive, isMarkedForDelete, mostRecentLiveChangeAt, mostRecentNonGCableChangeAt, name, serializedSize, serializer, timestamp, validateName, value |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
contextManager
protected static final CounterContext contextManager
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)
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)
- 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, interning column names and making copies of other underlying byte buffers
- 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.
mergeAndRemoveOldShards
public static void mergeAndRemoveOldShards(DecoratedKey key,
ColumnFamily cf,
int gcBefore,
int mergeBefore)
- There is two phase to the removal of old shards.
First phase: we merge the old shard value to the current shard and
'nulify' the old one. We then send the counter context with the old
shard nulified to all other replica.
Second phase: once an old shard has been nulified for longer than
gc_grace (to be sure all other replica had been aware of the merge), we
simply remove that old shard from the context (it's value is 0).
This method does both phases.
Copyright © 2012 The Apache Software Foundation