public class SSTableReader extends SSTable
Modifier and Type | Class and Description |
---|---|
protected class |
SSTableReader.EmptyCompactionScanner |
static class |
SSTableReader.OpenReason |
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.
|
static java.util.Comparator<SSTableReader> |
maxTimestampComparator |
SSTableReader.OpenReason |
openReason |
RestorableMeter |
readMeter |
static java.util.Comparator<SSTableReader> |
sstableComparator |
static com.google.common.collect.Ordering<SSTableReader> |
sstableOrdering |
components, compression, descriptor, first, last, metadata, partitioner, 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) |
SSTableReader |
cloneWithNewStart(DecoratedKey newStart,
java.lang.Runnable runOnClose) |
SSTableReader |
cloneWithNewSummarySamplingLevel(ColumnFamilyStore parent,
int samplingLevel)
Returns a new SSTableReader with the same properties as this SSTableReader except that a new IndexSummary will
be built at the target samplingLevel.
|
void |
createLinks(java.lang.String snapshotDirectoryPath) |
boolean |
equals(java.lang.Object that) |
long |
estimatedKeys() |
long |
estimatedKeysForRanges(java.util.Collection<Range<Token>> ranges) |
DecoratedKey |
firstKeyBeyond(RowPosition token)
Finds and returns the first key beyond a given token in this SSTable or null if no such key exists.
|
void |
forceFilterFailures()
For testing purposes only.
|
java.util.Set<java.lang.Integer> |
getAncestors() |
static long |
getApproximateKeyCount(java.util.Collection<SSTableReader> sstables)
Calculate approximate key count.
|
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) |
SSTableReader |
getCurrentReplacement() |
double |
getDroppableTombstonesBefore(int gcBefore) |
double |
getEffectiveIndexInterval() |
EstimatedHistogram |
getEstimatedColumnCount() |
double |
getEstimatedDroppableTombstoneRatio(int gcBefore) |
EstimatedHistogram |
getEstimatedRowSize() |
FileDataInput |
getFileDataInput(long position) |
java.lang.String |
getFilename() |
java.lang.String |
getIndexFilename() |
long |
getIndexScanPosition(RowPosition key)
Gets the position in the index file to start scanning to find the given key (at most indexInterval keys away,
modulo downsampling of the index summary).
|
byte[] |
getIndexSummaryKey(int index)
Returns the key for the index summary entry at `index`.
|
long |
getIndexSummaryOffHeapSize() |
int |
getIndexSummarySamplingLevel() |
int |
getIndexSummarySize()
Returns the number of entries in the IndexSummary.
|
InstrumentingCache<KeyCacheKey,RowIndexEntry> |
getKeyCache() |
long |
getKeyCacheHit() |
long |
getKeyCacheRequest() |
java.lang.Iterable<DecoratedKey> |
getKeySamples(Range<Token> range) |
int |
getMaxIndexSummarySize()
Returns the approximate number of entries the IndexSummary would contain if it were at full sampling.
|
long |
getMaxTimestamp() |
int |
getMinIndexInterval() |
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
|
ICompactionScanner |
getScanner(java.util.Collection<Range<Token>> ranges,
com.google.common.util.concurrent.RateLimiter limiter)
Direct I/O SSTableScanner over a defined collection of ranges of tokens.
|
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() |
StatsMetadata |
getSSTableMetadata() |
static long |
getTotalBytes(java.lang.Iterable<SSTableReader> sstables) |
int |
hashCode() |
void |
incrementReadCount()
Increment the total row read count and read rate for this SSTable.
|
void |
invalidateCacheKey(DecoratedKey key) |
boolean |
isMarkedCompacted() |
boolean |
isMarkedSuspect() |
boolean |
isRepaired() |
boolean |
loadSummary(SegmentedFile.Builder ibuilder,
SegmentedFile.Builder dbuilder)
Load index summary from Summary.db file if it exists.
|
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)
Open SSTable reader to be used in batch mode(such as sstableloader).
|
RandomAccessReader |
openIndexReader() |
static SSTableReader |
openNoValidation(Descriptor descriptor,
java.util.Set<Component> components,
CFMetaData metadata) |
void |
releaseReference()
Release reference to this SSTableReader.
|
static void |
releaseReferences(java.lang.Iterable<SSTableReader> sstables) |
void |
releaseSummary() |
void |
reloadSSTableMetadata()
Reloads the sstable metadata from disk.
|
void |
saveSummary(SegmentedFile.Builder ibuilder,
SegmentedFile.Builder dbuilder)
Save index summary to Summary.db file.
|
void |
setReplacedBy(SSTableReader replacement) |
void |
setTrackedBy(DataTracker tracker) |
long |
uncompressedLength() |
addComponents, appendTOC, bytesOnDisk, componentsFor, delete, getColumnFamilyName, getKeyspaceName, getMinimalKey, readTOC, toString, tryComponentFromFilename
public static final java.util.Comparator<SSTableReader> maxTimestampComparator
public static final java.util.Comparator<SSTableReader> sstableComparator
public static final com.google.common.collect.Ordering<SSTableReader> sstableOrdering
public final long maxDataAge
public final SSTableReader.OpenReason openReason
public RestorableMeter readMeter
public static long getApproximateKeyCount(java.util.Collection<SSTableReader> sstables)
sstables
- SSTables to calculate key countpublic 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 open(Descriptor descriptor, java.util.Set<Component> components, CFMetaData metadata, IPartitioner partitioner) 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
descriptor
- components
- metadata
- partitioner
- 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 static long getTotalBytes(java.lang.Iterable<SSTableReader> sstables)
public boolean equals(java.lang.Object that)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String getFilename()
getFilename
in class SSTable
public java.lang.String getIndexFilename()
getIndexFilename
in class SSTable
public void setTrackedBy(DataTracker tracker)
public boolean loadSummary(SegmentedFile.Builder ibuilder, SegmentedFile.Builder dbuilder)
ibuilder
- dbuilder
- public void saveSummary(SegmentedFile.Builder ibuilder, SegmentedFile.Builder dbuilder)
ibuilder
- dbuilder
- public void setReplacedBy(SSTableReader replacement)
public SSTableReader cloneWithNewStart(DecoratedKey newStart, java.lang.Runnable runOnClose)
public SSTableReader cloneWithNewSummarySamplingLevel(ColumnFamilyStore parent, int samplingLevel) throws java.io.IOException
samplingLevel
- the desired sampling level for the index summary on the new SSTableReaderjava.io.IOException
public int getIndexSummarySamplingLevel()
public long getIndexSummaryOffHeapSize()
public int getMinIndexInterval()
public double getEffectiveIndexInterval()
public void releaseSummary() throws java.io.IOException
java.io.IOException
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 getIndexSummarySize()
public int getMaxIndexSummarySize()
public byte[] getIndexSummaryKey(int index)
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 invalidateCacheKey(DecoratedKey key)
public void cacheKey(DecoratedKey key, RowIndexEntry info)
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 DecoratedKey firstKeyBeyond(RowPosition token)
public long uncompressedLength()
public long onDiskLength()
public boolean acquireReference()
public void releaseReference()
public boolean markObsolete()
public boolean isMarkedCompacted()
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 ICompactionScanner getScanner(java.util.Collection<Range<Token>> ranges, com.google.common.util.concurrent.RateLimiter limiter)
ranges
- 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 boolean isRepaired()
public SSTableReader getCurrentReplacement()
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 StatsMetadata 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)
public void incrementReadCount()
Copyright © 2014 The Apache Software Foundation