org.apache.cassandra.io
Class IndexHelper

java.lang.Object
  extended by org.apache.cassandra.io.IndexHelper

public class IndexHelper
extends java.lang.Object

Provides helper to serialize, deserialize and use column indexes. Author : Karthik Ranganathan ( kranganathan@facebook.com )


Nested Class Summary
static class IndexHelper.ColumnIndexFactory
           
static class IndexHelper.ColumnIndexInfo
          A helper class to generate indexes while the columns are sorted by name on disk.
static class IndexHelper.ColumnRange
          A column range containing the start and end offset of the appropriate column index chunk and the number of columns in that chunk.
static class IndexHelper.TimeRange
          Encapsulates a time range.
 
Constructor Summary
IndexHelper()
           
 
Method Summary
static void serialize(int indexSizeInBytes, java.util.List<IndexHelper.ColumnIndexInfo> columnIndexList, java.io.DataOutputStream dos)
          Serializes a column index to a data output stream
static int skipBloomFilter(java.io.DataInput in)
          Skip the bloom filter and return the bytes read.
static int skipBloomFilterAndIndex(java.io.DataInput in)
          Skip the bloom filter and the index and return the bytes read.
static int skipIndex(java.io.DataInput file)
          Skip the index and return the number of bytes read.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexHelper

public IndexHelper()
Method Detail

serialize

public static void serialize(int indexSizeInBytes,
                             java.util.List<IndexHelper.ColumnIndexInfo> columnIndexList,
                             java.io.DataOutputStream dos)
                      throws java.io.IOException
Serializes a column index to a data output stream

Parameters:
indexSizeInBytes - Size of index to be written
columnIndexList - List of column index entries as objects
dos - the output stream into which the column index is to be written
Throws:
java.io.IOException

skipBloomFilterAndIndex

public static int skipBloomFilterAndIndex(java.io.DataInput in)
                                   throws java.io.IOException
Skip the bloom filter and the index and return the bytes read.

Parameters:
in - the data input from which the bloom filter and index should be skipped
Returns:
number of bytes read.
Throws:
java.io.IOException

skipBloomFilter

public static int skipBloomFilter(java.io.DataInput in)
                           throws java.io.IOException
Skip the bloom filter and return the bytes read.

Parameters:
in - the data input from which the bloom filter should be skipped
Returns:
number of bytes read.
Throws:
java.io.IOException

skipIndex

public static int skipIndex(java.io.DataInput file)
                     throws java.io.IOException
Skip the index and return the number of bytes read.

Parameters:
file - the data input from which the index should be skipped
Returns:
number of bytes read from the data input
Throws:
java.io.IOException


Copyright © 2009 The Apache Software Foundation