public abstract class ColumnFamily extends java.lang.Object implements java.lang.Iterable<Cell>, 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 |
---|---|
abstract void |
addAll(ColumnFamily cm)
Adds all the columns of a given column map to this column map.
|
void |
addAtom(OnDiskAtom atom) |
abstract void |
addColumn(Cell cell)
Adds a cell to this cell map.
|
void |
addColumn(CellName name,
java.nio.ByteBuffer value,
long timestamp) |
void |
addColumn(CellName name,
java.nio.ByteBuffer value,
long timestamp,
int timeToLive) |
void |
addCounter(CellName name,
long value) |
void |
addTombstone(CellName name,
java.nio.ByteBuffer localDeletionTime,
long timestamp) |
void |
addTombstone(CellName name,
int localDeletionTime,
long timestamp) |
java.util.Map<CellName,java.nio.ByteBuffer> |
asMap() |
abstract BatchRemoveIterator<Cell> |
batchRemoveIterator() |
abstract void |
clear()
Clear this column family, removing all columns and deletion info.
|
abstract ColumnFamily |
cloneMe()
Clones the column map.
|
ColumnFamily |
cloneMeShallow() |
ColumnFamily |
cloneMeShallow(boolean reversed) |
<T extends ColumnFamily> |
cloneMeShallow(ColumnFamily.Factory<T> factory,
boolean reversedInsertOrder) |
long |
dataSize() |
void |
delete(ColumnFamily columns)
If `columns` has any tombstones (top-level or range tombstones), they will be applied to this set of 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 Cell |
getColumn(CellName 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<CellName> |
getColumnNames()
Returns an iterable with the names of columns in this column map in the same order
as the underlying columns themselves.
|
ColumnStats |
getColumnStats() |
CellNameType |
getComparator() |
abstract ColumnFamily.Factory |
getFactory()
Returns the factory used for this ISortedColumns implementation.
|
abstract java.util.Collection<Cell> |
getReverseSortedColumns()
Returns the columns of this column map as a collection.
|
abstract java.util.Collection<Cell> |
getSortedColumns()
Returns the columns of this column map as a collection.
|
ColumnFamilyType |
getType() |
abstract boolean |
hasColumns()
Returns whether or not there are any columns present.
|
int |
hashCode() |
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<Cell> |
iterator() |
abstract java.util.Iterator<Cell> |
iterator(ColumnSlice[] slices)
Returns an iterator over the columns of this map that returns only the matching @param slices.
|
int |
liveCQL3RowCount(long now) |
long |
maxTimestamp() |
abstract void |
maybeAppendColumn(Cell cell,
DeletionInfo.InOrderTester tester,
int gcBefore)
Adds a cell if it's non-gc-able and isn't shadowed by a partition/range tombstone with a higher timestamp.
|
CFMetaData |
metadata() |
abstract void |
purgeTombstones(int gcBefore)
Purges top-level and range tombstones whose localDeletionTime is older than gcBefore.
|
java.util.Iterator<Cell> |
reverseIterator() |
abstract java.util.Iterator<Cell> |
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 ColumnFamily cloneMeShallow(boolean reversed)
public ColumnFamilyType getType()
public int liveCQL3RowCount(long now)
public abstract ColumnFamily cloneMe()
public java.util.UUID id()
public CFMetaData metadata()
public void addColumn(CellName name, java.nio.ByteBuffer value, long timestamp)
public void addColumn(CellName name, java.nio.ByteBuffer value, long timestamp, int timeToLive)
public void addCounter(CellName name, long value)
public void addTombstone(CellName name, java.nio.ByteBuffer localDeletionTime, long timestamp)
public void addTombstone(CellName 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 purgeTombstones(int gcBefore)
gcBefore
- a timestamp (in seconds) before which tombstones should be purgedpublic abstract void addColumn(Cell cell)
public abstract void maybeAppendColumn(Cell cell, DeletionInfo.InOrderTester tester, int gcBefore)
public abstract void addAll(ColumnFamily cm)
for (Cell c : cm)
addColumn(c, ...);
but is potentially faster.public abstract Cell getColumn(CellName name)
public abstract java.lang.Iterable<CellName> getColumnNames()
public abstract java.util.Collection<Cell> getSortedColumns()
public abstract java.util.Collection<Cell> getReverseSortedColumns()
public abstract int getColumnCount()
public abstract boolean hasColumns()
public boolean isEmpty()
public abstract java.util.Iterator<Cell> iterator(ColumnSlice[] slices)
public abstract java.util.Iterator<Cell> reverseIterator(ColumnSlice[] slices)
public abstract boolean isInsertReversed()
public void delete(ColumnFamily columns)
public ColumnFamily diff(ColumnFamily cfComposite)
public long dataSize()
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 ColumnStats getColumnStats()
public boolean isMarkedForDelete()
public CellNameType getComparator()
public boolean hasOnlyTombstones(long now)
public java.util.Iterator<Cell> iterator()
iterator
in interface java.lang.Iterable<Cell>
public java.util.Iterator<Cell> reverseIterator()
public java.util.Map<CellName,java.nio.ByteBuffer> asMap()
public static ColumnFamily fromBytes(java.nio.ByteBuffer bytes)
public java.nio.ByteBuffer toBytes()
public abstract BatchRemoveIterator<Cell> batchRemoveIterator()
Copyright © 2017 The Apache Software Foundation