public abstract class SSTable
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<Component> |
components |
boolean |
compression |
Descriptor |
descriptor |
DecoratedKey |
first |
DecoratedKey |
last |
protected TableMetadataRef |
metadata |
protected DiskOptimizationStrategy |
optimizationStrategy |
static int |
TOMBSTONE_HISTOGRAM_BIN_SIZE |
static int |
TOMBSTONE_HISTOGRAM_SPOOL_SIZE |
static int |
TOMBSTONE_HISTOGRAM_TTL_ROUND_SECONDS |
Modifier | Constructor and Description |
---|---|
protected |
SSTable(Descriptor descriptor,
java.util.Set<Component> components,
TableMetadataRef metadata,
DiskOptimizationStrategy optimizationStrategy) |
Modifier and Type | Method and Description |
---|---|
void |
addComponents(java.util.Collection<Component> newComponents)
Registers new custom components.
|
protected static void |
appendTOC(Descriptor descriptor,
java.util.Collection<Component> components)
Appends new component names to the TOC component.
|
long |
bytesOnDisk() |
static java.util.Set<Component> |
componentsFor(Descriptor desc)
Discovers existing components for the descriptor.
|
DecoratedKey |
decorateKey(java.nio.ByteBuffer key) |
static boolean |
delete(Descriptor desc,
java.util.Set<Component> components)
We use a ReferenceQueue to manage deleting files that have been compacted
and for which no more SSTable references exist.
|
static java.util.Set<Component> |
discoverComponentsFor(Descriptor desc) |
static long |
estimateRowsFromIndex(RandomAccessReader ifile,
Descriptor descriptor) |
java.util.List<java.lang.String> |
getAllFilePaths() |
AbstractBounds<Token> |
getBounds() |
java.lang.String |
getColumnFamilyName() |
java.lang.String |
getFilename() |
java.lang.String |
getIndexFilename() |
java.lang.String |
getKeyspaceName() |
static DecoratedKey |
getMinimalKey(DecoratedKey key)
If the given @param key occupies only part of a larger buffer, allocate a new buffer that is only
as large as necessary.
|
IPartitioner |
getPartitioner() |
TableMetadata |
metadata() |
protected static java.util.Set<Component> |
readTOC(Descriptor descriptor)
Reads the list of components from the TOC component.
|
protected static java.util.Set<Component> |
readTOC(Descriptor descriptor,
boolean skipMissing)
Reads the list of components from the TOC component.
|
java.lang.String |
toString() |
static Pair<Descriptor,Component> |
tryComponentFromFilename(java.io.File file)
Parse a sstable filename into both a
Descriptor and Component object. |
static Descriptor |
tryDescriptorFromFilename(java.io.File file)
Parse a sstable filename into a
Descriptor object. |
static void |
validateRepairedMetadata(long repairedAt,
java.util.UUID pendingRepair,
boolean isTransient) |
public static final int TOMBSTONE_HISTOGRAM_BIN_SIZE
public static final int TOMBSTONE_HISTOGRAM_SPOOL_SIZE
public static final int TOMBSTONE_HISTOGRAM_TTL_ROUND_SECONDS
public final Descriptor descriptor
protected final java.util.Set<Component> components
public final boolean compression
public DecoratedKey first
public DecoratedKey last
protected final DiskOptimizationStrategy optimizationStrategy
protected final TableMetadataRef metadata
protected SSTable(Descriptor descriptor, java.util.Set<Component> components, TableMetadataRef metadata, DiskOptimizationStrategy optimizationStrategy)
public static boolean delete(Descriptor desc, java.util.Set<Component> components)
public TableMetadata metadata()
public IPartitioner getPartitioner()
public DecoratedKey decorateKey(java.nio.ByteBuffer key)
public static DecoratedKey getMinimalKey(DecoratedKey key)
public java.lang.String getFilename()
public java.lang.String getIndexFilename()
public java.lang.String getColumnFamilyName()
public java.lang.String getKeyspaceName()
public java.util.List<java.lang.String> getAllFilePaths()
public static Pair<Descriptor,Component> tryComponentFromFilename(java.io.File file)
Descriptor
and Component
object.file
- the filename to parse.Descriptor
and Component
corresponding to file
if it corresponds to
a valid and supported sstable filename, null
otherwise. Note that components of an unknown type will be
returned as CUSTOM ones.public static Descriptor tryDescriptorFromFilename(java.io.File file)
Descriptor
object.
Note that this method ignores the component part of the filename; if this is not what you want, use
tryComponentFromFilename(java.io.File)
instead.
file
- the filename to parse.Descriptor
corresponding to file
if it corresponds to a valid and supported sstable
filename, null
otherwise.public static java.util.Set<Component> componentsFor(Descriptor desc)
public static java.util.Set<Component> discoverComponentsFor(Descriptor desc)
public static long estimateRowsFromIndex(RandomAccessReader ifile, Descriptor descriptor) throws java.io.IOException
java.io.IOException
public long bytesOnDisk()
public java.lang.String toString()
toString
in class java.lang.Object
protected static java.util.Set<Component> readTOC(Descriptor descriptor) throws java.io.IOException
java.io.IOException
protected static java.util.Set<Component> readTOC(Descriptor descriptor, boolean skipMissing) throws java.io.IOException
skipMissing,
- skip adding the component to the returned set if the corresponding file is missing.java.io.IOException
protected static void appendTOC(Descriptor descriptor, java.util.Collection<Component> components)
public void addComponents(java.util.Collection<Component> newComponents)
newComponents
- collection of components to be addedpublic AbstractBounds<Token> getBounds()
public static void validateRepairedMetadata(long repairedAt, java.util.UUID pendingRepair, boolean isTransient)
Copyright © 2009-2022 The Apache Software Foundation