org.apache.cassandra.io
Class SSTableReader

java.lang.Object
  extended by org.apache.cassandra.io.SSTable
      extended by org.apache.cassandra.io.SSTableReader
All Implemented Interfaces:
java.lang.Comparable<SSTableReader>

public class SSTableReader
extends SSTable
implements java.lang.Comparable<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.


Field Summary
 
Fields inherited from class org.apache.cassandra.io.SSTable
bf, columnFamilyName, FILES_ON_DISK, INDEX_INTERVAL, indexPositions, partitioner, path, TEMPFILE_MARKER
 
Method Summary
 int compareTo(SSTableReader o)
           
static com.reardencommerce.kernel.collections.shared.evictable.ConcurrentLinkedHashMap<DecoratedKey,java.lang.Long> createKeyCache(int size)
           
 void forceBloomFilterFailures()
          obviously only for testing
static long getApproximateKeyCount()
           
static long getApproximateKeyCount(java.lang.Iterable<SSTableReader> sstables)
           
 AbstractType getColumnComparator()
           
 ICompactSerializer2<IColumn> getColumnSerializer()
           
static java.util.List<DecoratedKey> getIndexedDecoratedKeys()
          Get all indexed keys in any SSTable for our primary range.
static java.util.List<DecoratedKey> getIndexedDecoratedKeysFor(com.google.common.base.Predicate<SSTable> cfpred, com.google.common.base.Predicate<DecoratedKey> dkpred)
          Get all indexed keys defined by the two predicates.
 java.util.List<org.apache.cassandra.io.SSTable.KeyPosition> getIndexPositions()
           
 long getNearestPosition(DecoratedKey decoratedKey)
          like getPosition, but if key is not found will return the location of the first key _greater_ than the desired one, or -1 if no such key exists.
 IPartitioner getPartitioner()
           
 long getPosition(DecoratedKey decoratedKey)
          returns the position in the data file to find the given key, or -1 if the key is not present
 SSTableScanner getScanner(int bufferSize)
           
static int indexInterval()
           
 long length()
           
 ColumnFamily makeColumnFamily()
           
 void markCompacted()
           
static SSTableReader open(java.lang.String dataFileName)
           
static SSTableReader open(java.lang.String dataFileName, IPartitioner partitioner, double cacheFraction)
           
 
Methods inherited from class org.apache.cassandra.io.SSTable
bytesOnDisk, compactedFilename, compactedFilename, deleteIfCompacted, filterFilename, filterFilename, getAllFilenames, getColumnFamilyName, getFilename, getTableName, indexFilename, indexFilename, parseTableName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

indexInterval

public static int indexInterval()

getApproximateKeyCount

public static long getApproximateKeyCount()

getApproximateKeyCount

public static long getApproximateKeyCount(java.lang.Iterable<SSTableReader> sstables)

getIndexedDecoratedKeysFor

public static java.util.List<DecoratedKey> getIndexedDecoratedKeysFor(com.google.common.base.Predicate<SSTable> cfpred,
                                                                      com.google.common.base.Predicate<DecoratedKey> dkpred)
Get all indexed keys defined by the two predicates.

Parameters:
cfpred - A Predicate defining matching column families.
dkpred - A Predicate defining matching DecoratedKeys.

getIndexedDecoratedKeys

public static java.util.List<DecoratedKey> getIndexedDecoratedKeys()
Get all indexed keys in any SSTable for our primary range.


open

public static SSTableReader open(java.lang.String dataFileName)
                          throws java.io.IOException
Throws:
java.io.IOException

open

public static SSTableReader open(java.lang.String dataFileName,
                                 IPartitioner partitioner,
                                 double cacheFraction)
                          throws java.io.IOException
Throws:
java.io.IOException

createKeyCache

public static com.reardencommerce.kernel.collections.shared.evictable.ConcurrentLinkedHashMap<DecoratedKey,java.lang.Long> createKeyCache(int size)

getIndexPositions

public java.util.List<org.apache.cassandra.io.SSTable.KeyPosition> getIndexPositions()

getPosition

public long getPosition(DecoratedKey decoratedKey)
                 throws java.io.IOException
returns the position in the data file to find the given key, or -1 if the key is not present

Throws:
java.io.IOException

getNearestPosition

public long getNearestPosition(DecoratedKey decoratedKey)
                        throws java.io.IOException
like getPosition, but if key is not found will return the location of the first key _greater_ than the desired one, or -1 if no such key exists.

Throws:
java.io.IOException

length

public long length()

compareTo

public int compareTo(SSTableReader o)
Specified by:
compareTo in interface java.lang.Comparable<SSTableReader>

markCompacted

public void markCompacted()
                   throws java.io.IOException
Throws:
java.io.IOException

forceBloomFilterFailures

public void forceBloomFilterFailures()
obviously only for testing


getPartitioner

public IPartitioner getPartitioner()

getScanner

public SSTableScanner getScanner(int bufferSize)
                          throws java.io.IOException
Throws:
java.io.IOException

getColumnComparator

public AbstractType getColumnComparator()

makeColumnFamily

public ColumnFamily makeColumnFamily()

getColumnSerializer

public ICompactSerializer2<IColumn> getColumnSerializer()


Copyright © 2010 The Apache Software Foundation