public class SSTableReader extends SSTable
Modifier and Type | Class and Description |
---|---|
protected class |
SSTableReader.EmptyCompactionScanner |
static class |
SSTableReader.Operator
TODO: Move someplace reusable
|
static class |
SSTableReader.SizeComparator |
Modifier and Type | Field and Description |
---|---|
long |
maxDataAge
maxDataAge is a timestamp in local server time (e.g.
|
COMPONENT_DATA, COMPONENT_DIGEST, COMPONENT_FILTER, COMPONENT_INDEX, COMPONENT_STATS, components, compression, descriptor, first, last, maxTimestampComparator, metadata, partitioner, sstableComparator, sstableOrdering, TEMPFILE_MARKER, TOMBSTONE_HISTOGRAM_BIN_SIZE
Modifier and Type | Method and Description |
---|---|
boolean |
acquireReference() |
static boolean |
acquireReferences(java.lang.Iterable<SSTableReader> sstables) |
void |
cacheKey(DecoratedKey key,
RowIndexEntry info) |
void |
createLinks(java.lang.String snapshotDirectoryPath) |
long |
estimatedKeys() |
long |
estimatedKeysForRanges(java.util.Collection<Range<Token>> ranges) |
void |
forceFilterFailures()
For testing purposes only.
|
java.util.Set<java.lang.Integer> |
getAncestors() |
static long |
getApproximateKeyCount(java.lang.Iterable<SSTableReader> sstables,
CFMetaData metadata) |
IFilter |
getBloomFilter() |
long |
getBloomFilterFalsePositiveCount() |
long |
getBloomFilterSerializedSize() |
long |
getBloomFilterTruePositiveCount() |
RowIndexEntry |
getCachedPosition(DecoratedKey key,
boolean updateStats) |
CompressionMetadata |
getCompressionMetadata()
Returns the compression metadata for this sstable.
|
double |
getCompressionRatio() |
long |
getCreationTimeFor(Component component) |
double |
getDroppableTombstonesBefore(int gcBefore) |
EstimatedHistogram |
getEstimatedColumnCount() |
double |
getEstimatedDroppableTombstoneRatio(int gcBefore) |
EstimatedHistogram |
getEstimatedRowSize() |
FileDataInput |
getFileDataInput(long position) |
long |
getIndexScanPosition(RowPosition key)
get the position in the index file to start scanning to find the given key (at most indexInterval keys away)
|
InstrumentingCache<KeyCacheKey,RowIndexEntry> |
getKeyCache() |
long |
getKeyCacheHit() |
long |
getKeyCacheRequest() |
byte[] |
getKeySample(int position) |
java.lang.Iterable<DecoratedKey> |
getKeySamples(Range<Token> range) |
int |
getKeySampleSize() |
long |
getMaxTimestamp() |
long |
getMinTimestamp() |
RowIndexEntry |
getPosition(RowPosition key,
SSTableReader.Operator op)
Get position updating key cache and stats.
|
RowIndexEntry |
getPosition(RowPosition key,
SSTableReader.Operator op,
boolean updateCacheAndStats) |
java.util.List<Pair<java.lang.Long,java.lang.Long>> |
getPositionsForRanges(java.util.Collection<Range<Token>> ranges)
Determine the minimal set of sections that can be extracted from this SSTable to cover the given ranges.
|
long |
getRecentBloomFilterFalsePositiveCount() |
long |
getRecentBloomFilterTruePositiveCount() |
ReplayPosition |
getReplayPosition() |
SSTableScanner |
getScanner()
I/O SSTableScanner
|
SSTableScanner |
getScanner(DataRange dataRange) |
ICompactionScanner |
getScanner(Range<Token> range,
com.google.common.util.concurrent.RateLimiter limiter)
Direct I/O SSTableScanner over a defined range of tokens.
|
SSTableScanner |
getScanner(com.google.common.util.concurrent.RateLimiter limiter) |
int |
getSSTableLevel() |
SSTableMetadata |
getSSTableMetadata() |
boolean |
isMarkedSuspect() |
static boolean |
loadSummary(SSTableReader reader,
SegmentedFile.Builder ibuilder,
SegmentedFile.Builder dbuilder,
CFMetaData metadata) |
static void |
logOpenException(Descriptor descriptor,
java.io.IOException e) |
boolean |
markObsolete()
Mark the sstable as obsolete, i.e., compacted into newer sstables.
|
void |
markSuspect() |
boolean |
newSince(long age)
Tests if the sstable contains data newer than the given age param (in localhost currentMilli time).
|
long |
onDiskLength() |
static SSTableReader |
open(Descriptor descriptor) |
static SSTableReader |
open(Descriptor desc,
CFMetaData metadata) |
static SSTableReader |
open(Descriptor descriptor,
java.util.Set<Component> components,
CFMetaData metadata,
IPartitioner partitioner) |
static java.util.Collection<SSTableReader> |
openAll(java.util.Set<java.util.Map.Entry<Descriptor,java.util.Set<Component>>> entries,
CFMetaData metadata,
IPartitioner partitioner) |
RandomAccessReader |
openDataReader() |
RandomAccessReader |
openDataReader(com.google.common.util.concurrent.RateLimiter limiter) |
static SSTableReader |
openForBatch(Descriptor descriptor,
java.util.Set<Component> components,
CFMetaData metadata,
IPartitioner partitioner) |
RandomAccessReader |
openIndexReader() |
static SSTableReader |
openNoValidation(Descriptor descriptor,
java.util.Set<Component> components,
CFMetaData metadata) |
void |
preheat(java.util.Map<DecoratedKey,RowIndexEntry> cachedKeys) |
void |
releaseReference() |
static void |
releaseReferences(java.lang.Iterable<SSTableReader> sstables) |
void |
releaseSummary() |
void |
reloadSSTableMetadata()
Reloads the sstable metadata from disk.
|
static void |
saveSummary(SSTableReader reader,
SegmentedFile.Builder ibuilder,
SegmentedFile.Builder dbuilder) |
void |
setTrackedBy(DataTracker tracker) |
long |
uncompressedLength() |
addComponents, appendTOC, bytesOnDisk, delete, getColumnFamilyName, getFilename, getIndexFilename, getKeyspaceName, getMinimalKey, getTotalBytes, readTOC, toString, tryComponentFromFilename
public final long maxDataAge
public static long getApproximateKeyCount(java.lang.Iterable<SSTableReader> sstables, CFMetaData metadata)
public static SSTableReader open(Descriptor descriptor) throws java.io.IOException
java.io.IOException
public static SSTableReader open(Descriptor desc, CFMetaData metadata) throws java.io.IOException
java.io.IOException
public static SSTableReader openNoValidation(Descriptor descriptor, java.util.Set<Component> components, CFMetaData metadata) throws java.io.IOException
java.io.IOException
public static SSTableReader openForBatch(Descriptor descriptor, java.util.Set<Component> components, CFMetaData metadata, IPartitioner partitioner) throws java.io.IOException
java.io.IOException
public static SSTableReader open(Descriptor descriptor, java.util.Set<Component> components, CFMetaData metadata, IPartitioner partitioner) throws java.io.IOException
java.io.IOException
public static void logOpenException(Descriptor descriptor, java.io.IOException e)
public static java.util.Collection<SSTableReader> openAll(java.util.Set<java.util.Map.Entry<Descriptor,java.util.Set<Component>>> entries, CFMetaData metadata, IPartitioner partitioner)
public void setTrackedBy(DataTracker tracker)
public static boolean loadSummary(SSTableReader reader, SegmentedFile.Builder ibuilder, SegmentedFile.Builder dbuilder, CFMetaData metadata)
public static void saveSummary(SSTableReader reader, SegmentedFile.Builder ibuilder, SegmentedFile.Builder dbuilder)
public void releaseSummary()
public long getIndexScanPosition(RowPosition key)
public CompressionMetadata getCompressionMetadata()
java.lang.IllegalStateException
- if the sstable is not compressedpublic void forceFilterFailures()
public IFilter getBloomFilter()
public long getBloomFilterSerializedSize()
public long estimatedKeys()
public long estimatedKeysForRanges(java.util.Collection<Range<Token>> ranges)
ranges
- public int getKeySampleSize()
public byte[] getKeySample(int position)
public java.lang.Iterable<DecoratedKey> getKeySamples(Range<Token> range)
public java.util.List<Pair<java.lang.Long,java.lang.Long>> getPositionsForRanges(java.util.Collection<Range<Token>> ranges)
public void cacheKey(DecoratedKey key, RowIndexEntry info)
public void preheat(java.util.Map<DecoratedKey,RowIndexEntry> cachedKeys) throws java.io.IOException
java.io.IOException
public RowIndexEntry getCachedPosition(DecoratedKey key, boolean updateStats)
public RowIndexEntry getPosition(RowPosition key, SSTableReader.Operator op)
public RowIndexEntry getPosition(RowPosition key, SSTableReader.Operator op, boolean updateCacheAndStats)
key
- The key to apply as the rhs to the given Operator. A 'fake' key is allowed to
allow key selection by token bounds but only if op != * EQop
- The Operator defining matching keys: the nearest key to the target matching the operator wins.updateCacheAndStats
- true if updating stats and cachepublic long uncompressedLength()
public long onDiskLength()
public boolean acquireReference()
public void releaseReference()
public boolean markObsolete()
public void markSuspect()
public boolean isMarkedSuspect()
public SSTableScanner getScanner(DataRange dataRange)
dataRange
- filter to use when reading the columnspublic SSTableScanner getScanner()
public SSTableScanner getScanner(com.google.common.util.concurrent.RateLimiter limiter)
public ICompactionScanner getScanner(Range<Token> range, com.google.common.util.concurrent.RateLimiter limiter)
range
- the range of keys to coverpublic FileDataInput getFileDataInput(long position)
public boolean newSince(long age)
age
- The age to compare the maxDataAre of this sstable. Measured in millisec since epoc on this hostpublic void createLinks(java.lang.String snapshotDirectoryPath)
public long getBloomFilterFalsePositiveCount()
public long getRecentBloomFilterFalsePositiveCount()
public long getBloomFilterTruePositiveCount()
public long getRecentBloomFilterTruePositiveCount()
public InstrumentingCache<KeyCacheKey,RowIndexEntry> getKeyCache()
public EstimatedHistogram getEstimatedRowSize()
public EstimatedHistogram getEstimatedColumnCount()
public double getEstimatedDroppableTombstoneRatio(int gcBefore)
public double getDroppableTombstonesBefore(int gcBefore)
public double getCompressionRatio()
public ReplayPosition getReplayPosition()
public long getMinTimestamp()
public long getMaxTimestamp()
public java.util.Set<java.lang.Integer> getAncestors()
public int getSSTableLevel()
public void reloadSSTableMetadata() throws java.io.IOException
java.io.IOException
public SSTableMetadata getSSTableMetadata()
public RandomAccessReader openDataReader(com.google.common.util.concurrent.RateLimiter limiter)
public RandomAccessReader openDataReader()
public RandomAccessReader openIndexReader()
public long getCreationTimeFor(Component component)
component
- component to get timestamp.public long getKeyCacheHit()
public long getKeyCacheRequest()
public static boolean acquireReferences(java.lang.Iterable<SSTableReader> sstables)
sstables
- public static void releaseReferences(java.lang.Iterable<SSTableReader> sstables)
Copyright © 2013 The Apache Software Foundation