public abstract class ColumnFamily extends java.lang.Object implements java.lang.Iterable<Column>, IRowCacheEntry
Modifier and Type | Class and Description |
---|---|
static class |
ColumnFamily.Factory<T extends ColumnFamily> |
Modifier and Type | Field and Description |
---|---|
protected CFMetaData |
metadata |
static ColumnFamilySerializer |
serializer |
Modifier | Constructor and Description |
---|---|
protected |
ColumnFamily(CFMetaData metadata) |
Modifier and Type | Method and Description |
---|---|
void |
addAll(ColumnFamily cf,
Allocator allocator) |
abstract void |
addAll(ColumnFamily cm,
Allocator allocator,
com.google.common.base.Function<Column,Column> transformation)
Adds all the columns of a given column map to this column map.
|
void |
addAtom(OnDiskAtom atom) |
void |
addColumn(java.nio.ByteBuffer name,
java.nio.ByteBuffer value,
long timestamp) |
void |
addColumn(java.nio.ByteBuffer name,
java.nio.ByteBuffer value,
long timestamp,
int timeToLive) |
void |
addColumn(Column column) |
abstract void |
addColumn(Column column,
Allocator allocator)
Adds a column to this column map.
|
void |
addCounter(java.nio.ByteBuffer name,
long value) |
void |
addIfRelevant(Column column,
DeletionInfo.InOrderTester tester,
int gcBefore) |
void |
addTombstone(java.nio.ByteBuffer name,
java.nio.ByteBuffer localDeletionTime,
long timestamp) |
void |
addTombstone(java.nio.ByteBuffer name,
int localDeletionTime,
long timestamp) |
java.util.Map<java.nio.ByteBuffer,java.nio.ByteBuffer> |
asMap() |
abstract void |
clear()
Clear this column family, removing all columns and deletion info.
|
abstract ColumnFamily |
cloneMe()
Clones the column map.
|
ColumnFamily |
cloneMeShallow() |
<T extends ColumnFamily> |
cloneMeShallow(ColumnFamily.Factory<T> factory,
boolean reversedInsertOrder) |
void |
delete(ColumnFamily columns) |
abstract void |
delete(DeletionInfo info) |
abstract void |
delete(DeletionTime deletionTime) |
protected abstract void |
delete(RangeTombstone tombstone) |
abstract DeletionInfo |
deletionInfo() |
ColumnFamily |
diff(ColumnFamily cfComposite) |
static ColumnFamily |
diff(ColumnFamily cf1,
ColumnFamily cf2) |
static java.nio.ByteBuffer |
digest(ColumnFamily cf) |
boolean |
equals(java.lang.Object o) |
static ColumnFamily |
fromBytes(java.nio.ByteBuffer bytes) |
abstract Column |
getColumn(java.nio.ByteBuffer name)
Get a column given its name, returning null if the column is not
present.
|
abstract int |
getColumnCount()
Returns the number of columns in this map.
|
abstract java.lang.Iterable<java.nio.ByteBuffer> |
getColumnNames()
Returns an iterable with the names of columns in this column map in the same order
as the underlying columns themselves.
|
ColumnStats |
getColumnStats() |
AbstractType<?> |
getComparator() |
abstract ColumnFamily.Factory |
getFactory()
Returns the factory used for this ISortedColumns implementation.
|
abstract java.util.Collection<Column> |
getReverseSortedColumns()
Returns the columns of this column map as a collection.
|
abstract java.util.Collection<Column> |
getSortedColumns()
Returns the columns of this column map as a collection.
|
ColumnFamilyType |
getType() |
int |
hashCode() |
boolean |
hasIrrelevantData(int gcBefore) |
boolean |
hasOnlyTombstones(long now) |
java.util.UUID |
id() |
DeletionInfo.InOrderTester |
inOrderDeletionTester()
Returns a
DeletionInfo.InOrderTester for the deletionInfo() of
this column family. |
boolean |
isEmpty()
Returns true if this contains no columns or deletion info
|
abstract boolean |
isInsertReversed()
Returns if this map only support inserts in reverse order.
|
boolean |
isMarkedForDelete() |
java.util.Iterator<Column> |
iterator() |
abstract java.util.Iterator<Column> |
iterator(ColumnSlice[] slices)
Returns an iterator over the columns of this map that returns only the matching @param slices.
|
long |
maxTimestamp() |
abstract void |
maybeResetDeletionTimes(int gcBefore) |
long |
memorySize() |
CFMetaData |
metadata() |
abstract boolean |
replace(Column oldColumn,
Column newColumn)
Replace oldColumn if present by newColumn.
|
void |
resolve(ColumnFamily cf) |
void |
resolve(ColumnFamily cf,
Allocator allocator) |
abstract java.util.Iterator<Column> |
reverseIterator(ColumnSlice[] slices)
Returns a reversed iterator over the columns of this map that returns only the matching @param slices.
|
abstract void |
setDeletionInfo(DeletionInfo info) |
java.nio.ByteBuffer |
toBytes() |
java.lang.String |
toString() |
void |
updateDigest(java.security.MessageDigest digest) |
public static final ColumnFamilySerializer serializer
protected final CFMetaData metadata
protected ColumnFamily(CFMetaData metadata)
public <T extends ColumnFamily> T cloneMeShallow(ColumnFamily.Factory<T> factory, boolean reversedInsertOrder)
public ColumnFamily cloneMeShallow()
public ColumnFamilyType getType()
public abstract ColumnFamily cloneMe()
public java.util.UUID id()
public CFMetaData metadata()
public void addIfRelevant(Column column, DeletionInfo.InOrderTester tester, int gcBefore)
public void addColumn(Column column)
public void addColumn(java.nio.ByteBuffer name, java.nio.ByteBuffer value, long timestamp)
public void addColumn(java.nio.ByteBuffer name, java.nio.ByteBuffer value, long timestamp, int timeToLive)
public void addCounter(java.nio.ByteBuffer name, long value)
public void addTombstone(java.nio.ByteBuffer name, java.nio.ByteBuffer localDeletionTime, long timestamp)
public void addTombstone(java.nio.ByteBuffer name, int localDeletionTime, long timestamp)
public void addAtom(OnDiskAtom atom)
public abstract void clear()
public DeletionInfo.InOrderTester inOrderDeletionTester()
DeletionInfo.InOrderTester
for the deletionInfo() of
this column family. Please note that for ThreadSafe implementation of ColumnFamily,
this tester will remain valid even if new tombstones are added to this ColumnFamily
*as long as said addition is done in comparator order*. For AtomicSortedColumns,
the tester will correspond to the state of when this method is called.public abstract ColumnFamily.Factory getFactory()
public abstract DeletionInfo deletionInfo()
public abstract void setDeletionInfo(DeletionInfo info)
public abstract void delete(DeletionInfo info)
public abstract void delete(DeletionTime deletionTime)
protected abstract void delete(RangeTombstone tombstone)
public abstract void maybeResetDeletionTimes(int gcBefore)
public abstract void addColumn(Column column, Allocator allocator)
public abstract void addAll(ColumnFamily cm, Allocator allocator, com.google.common.base.Function<Column,Column> transformation)
for (Column c : cm)
addColumn(c, ...);
but is potentially faster.public abstract boolean replace(Column oldColumn, Column newColumn)
public abstract Column getColumn(java.nio.ByteBuffer name)
public abstract java.lang.Iterable<java.nio.ByteBuffer> getColumnNames()
public abstract java.util.Collection<Column> getSortedColumns()
public abstract java.util.Collection<Column> getReverseSortedColumns()
public abstract int getColumnCount()
public boolean isEmpty()
public abstract java.util.Iterator<Column> iterator(ColumnSlice[] slices)
public abstract java.util.Iterator<Column> reverseIterator(ColumnSlice[] slices)
public abstract boolean isInsertReversed()
public void delete(ColumnFamily columns)
public void addAll(ColumnFamily cf, Allocator allocator)
public ColumnFamily diff(ColumnFamily cfComposite)
public long memorySize()
memorySize
in interface IMeasurableMemory
public long maxTimestamp()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static java.nio.ByteBuffer digest(ColumnFamily cf)
public void updateDigest(java.security.MessageDigest digest)
public static ColumnFamily diff(ColumnFamily cf1, ColumnFamily cf2)
public void resolve(ColumnFamily cf)
public void resolve(ColumnFamily cf, Allocator allocator)
public ColumnStats getColumnStats()
public boolean isMarkedForDelete()
public AbstractType<?> getComparator()
public boolean hasOnlyTombstones(long now)
public java.util.Iterator<Column> iterator()
iterator
in interface java.lang.Iterable<Column>
public boolean hasIrrelevantData(int gcBefore)
public java.util.Map<java.nio.ByteBuffer,java.nio.ByteBuffer> asMap()
public static ColumnFamily fromBytes(java.nio.ByteBuffer bytes)
public java.nio.ByteBuffer toBytes()
Copyright © 2013 The Apache Software Foundation