|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.io.sstable.SSTable
org.apache.cassandra.io.sstable.SSTableReader
public class SSTableReader
SSTableReaders are open()ed by Table.onStart; after that they are created by SSTableWriter.renameAndOpen. Do not re-call open() on existing SSTable files; use the references kept by ColumnFamilyStore post-start instead.
Nested Class Summary | |
---|---|
static class |
SSTableReader.Operator
TODO: Move someplace reusable |
Field Summary | |
---|---|
long |
maxDataAge
maxDataAge is a timestamp in local server time (e.g. |
Fields inherited from class org.apache.cassandra.io.sstable.SSTable |
---|
COMPONENT_DATA, COMPONENT_DIGEST, COMPONENT_FILTER, COMPONENT_INDEX, COMPONENT_STATS, COMPONENT_SUMMARY, components, compression, descriptor, first, last, maxTimestampComparator, metadata, partitioner, sstableComparator, sstableOrdering, TEMPFILE_MARKER, TOMBSTONE_HISTOGRAM_BIN_SIZE |
Method Summary | |
---|---|
boolean |
acquireReference()
|
static boolean |
acquireReferences(java.lang.Iterable<SSTableReader> sstables)
|
static java.util.Collection<SSTableReader> |
batchOpen(java.util.Set<java.util.Map.Entry<Descriptor,java.util.Set<Component>>> entries,
CFMetaData metadata,
IPartitioner partitioner)
|
void |
cacheKey(DecoratedKey key,
RowIndexEntry info)
|
void |
createLinks(java.lang.String snapshotDirectoryPath)
|
DecoratedKey |
decodeKey(java.nio.ByteBuffer bytes)
|
static DecoratedKey |
decodeKey(IPartitioner p,
Descriptor d,
java.nio.ByteBuffer bytes)
Conditionally use the deprecated 'IPartitioner.convertFromDiskFormat' method. |
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)
|
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)
|
ICompactionScanner |
getDirectScanner(Range<Token> range,
com.google.common.util.concurrent.RateLimiter limiter)
Direct I/O SSTableScanner over a defined range of tokens. |
SSTableScanner |
getDirectScanner(com.google.common.util.concurrent.RateLimiter limiter)
Direct I/O SSTableScanner |
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()
|
byte[][] |
getKeySamples()
|
java.lang.Iterable<DecoratedKey> |
getKeySamples(Range<Token> range)
|
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(QueryFilter filter)
|
boolean |
isMarkedSuspect()
|
static boolean |
loadSummary(SSTableReader reader,
SegmentedFile.Builder ibuilder,
SegmentedFile.Builder dbuilder)
|
static void |
logOpenException(Descriptor descriptor,
java.io.IOException e)
|
boolean |
markCompacted()
Mark the sstable as compacted. |
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)
|
RandomAccessReader |
openDataReader(boolean skipIOCache)
|
RandomAccessReader |
openDataReader(com.google.common.util.concurrent.RateLimiter limiter)
|
RandomAccessReader |
openIndexReader(boolean skipIOCache)
|
static SSTableReader |
openNoValidation(Descriptor descriptor,
java.util.Set<Component> components,
CFMetaData metadata)
|
static long |
readRowSize(java.io.DataInput in,
Descriptor d)
|
void |
releaseReference()
|
static void |
releaseReferences(java.lang.Iterable<SSTableReader> sstables)
|
static void |
saveSummary(SSTableReader reader,
SegmentedFile.Builder ibuilder,
SegmentedFile.Builder dbuilder)
|
void |
setTrackedBy(DataTracker tracker)
|
long |
uncompressedLength()
|
Methods inherited from class org.apache.cassandra.io.sstable.SSTable |
---|
addComponents, appendTOC, bytesOnDisk, delete, getColumnFamilyName, getFilename, getIndexFilename, getMinimalKey, getTableName, getTotalBytes, readTOC, toString, tryComponentFromFilename |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final long maxDataAge
Method Detail |
---|
public static long getApproximateKeyCount(java.lang.Iterable<SSTableReader> sstables)
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 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> batchOpen(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)
public static void saveSummary(SSTableReader reader, SegmentedFile.Builder ibuilder, SegmentedFile.Builder dbuilder)
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 byte[][] getKeySamples()
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 RowIndexEntry getCachedPosition(DecoratedKey key, boolean updateStats)
public RowIndexEntry getPosition(RowPosition key, SSTableReader.Operator op)
getPosition(org.apache.cassandra.db.RowPosition, org.apache.cassandra.io.sstable.SSTableReader.Operator, boolean)
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 cache
public long uncompressedLength()
public long onDiskLength()
public boolean acquireReference()
public void releaseReference()
public boolean markCompacted()
public void markSuspect()
public boolean isMarkedSuspect()
public SSTableScanner getScanner(QueryFilter filter)
filter
- filter to use when reading the columns
public SSTableScanner getDirectScanner(com.google.common.util.concurrent.RateLimiter limiter)
public ICompactionScanner getDirectScanner(Range<Token> range, com.google.common.util.concurrent.RateLimiter limiter)
range
- the range of keys to cover
public 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 host
public static long readRowSize(java.io.DataInput in, Descriptor d) throws java.io.IOException
java.io.IOException
public void createLinks(java.lang.String snapshotDirectoryPath)
public static DecoratedKey decodeKey(IPartitioner p, Descriptor d, java.nio.ByteBuffer bytes)
public DecoratedKey decodeKey(java.nio.ByteBuffer bytes)
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 RandomAccessReader openDataReader(com.google.common.util.concurrent.RateLimiter limiter)
public RandomAccessReader openDataReader(boolean skipIOCache)
public RandomAccessReader openIndexReader(boolean skipIOCache)
public long getCreationTimeFor(Component component)
component
- component to get timestamp.
public static boolean acquireReferences(java.lang.Iterable<SSTableReader> sstables)
sstables
-
public static void releaseReferences(java.lang.Iterable<SSTableReader> sstables)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |