Class OnDiskIndex
- java.lang.Object
-
- org.apache.cassandra.index.sasi.disk.OnDiskIndex
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Iterable<OnDiskIndex.DataTerm>
public class OnDiskIndex extends java.lang.Object implements java.lang.Iterable<OnDiskIndex.DataTerm>, java.io.Closeable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classOnDiskIndex.DataBlockprotected classOnDiskIndex.DataLevelclassOnDiskIndex.DataTermstatic classOnDiskIndex.IteratorOrderprotected classOnDiskIndex.Level<T extends OnDiskBlock>protected classOnDiskIndex.OnDiskSuperBlockprotected classOnDiskIndex.PointerBlockprotected classOnDiskIndex.PointerLevelprotected static classOnDiskIndex.PointerTerm
-
Field Summary
Fields Modifier and Type Field Description protected AbstractType<?>comparatorprotected OnDiskIndex.DataLeveldataLevelDescriptordescriptorprotected booleanhasMarkedPartialsprotected MappedBufferindexFileprotected java.lang.StringindexPathprotected longindexSizeprotected com.google.common.base.Function<java.lang.Long,DecoratedKey>keyFetcherprotected OnDiskIndex.PointerLevel[]levelsprotected java.nio.ByteBuffermaxKeyprotected java.nio.ByteBuffermaxTermprotected java.nio.ByteBufferminKeyprotected java.nio.ByteBufferminTermprotected OnDiskIndexBuilder.Modemodeprotected OnDiskIndexBuilder.TermSizetermSize
-
Constructor Summary
Constructors Constructor Description OnDiskIndex(File index, AbstractType<?> cmp, com.google.common.base.Function<java.lang.Long,DecoratedKey> keyReader)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()AbstractType<?>getComparator()java.lang.StringgetIndexPath()booleanhasMarkedPartials()java.util.Iterator<OnDiskIndex.DataTerm>iterator()java.util.Iterator<OnDiskIndex.DataTerm>iteratorAt(java.nio.ByteBuffer query, OnDiskIndex.IteratorOrder order, boolean inclusive)OnDiskIndex.DataTermmax()java.nio.ByteBuffermaxKey()java.nio.ByteBuffermaxTerm()OnDiskIndex.DataTermmin()java.nio.ByteBufferminKey()java.nio.ByteBufferminTerm()OnDiskIndexBuilder.Modemode()RangeIterator<java.lang.Long,Token>search(Expression exp)Search for rows which match all of the terms inside the given expression in the index file.
-
-
-
Field Detail
-
descriptor
public final Descriptor descriptor
-
mode
protected final OnDiskIndexBuilder.Mode mode
-
termSize
protected final OnDiskIndexBuilder.TermSize termSize
-
comparator
protected final AbstractType<?> comparator
-
indexFile
protected final MappedBuffer indexFile
-
indexSize
protected final long indexSize
-
hasMarkedPartials
protected final boolean hasMarkedPartials
-
keyFetcher
protected final com.google.common.base.Function<java.lang.Long,DecoratedKey> keyFetcher
-
indexPath
protected final java.lang.String indexPath
-
levels
protected final OnDiskIndex.PointerLevel[] levels
-
dataLevel
protected final OnDiskIndex.DataLevel dataLevel
-
minTerm
protected final java.nio.ByteBuffer minTerm
-
maxTerm
protected final java.nio.ByteBuffer maxTerm
-
minKey
protected final java.nio.ByteBuffer minKey
-
maxKey
protected final java.nio.ByteBuffer maxKey
-
-
Constructor Detail
-
OnDiskIndex
public OnDiskIndex(File index, AbstractType<?> cmp, com.google.common.base.Function<java.lang.Long,DecoratedKey> keyReader)
-
-
Method Detail
-
hasMarkedPartials
public boolean hasMarkedPartials()
-
mode
public OnDiskIndexBuilder.Mode mode()
-
minTerm
public java.nio.ByteBuffer minTerm()
-
maxTerm
public java.nio.ByteBuffer maxTerm()
-
minKey
public java.nio.ByteBuffer minKey()
-
maxKey
public java.nio.ByteBuffer maxKey()
-
min
public OnDiskIndex.DataTerm min()
-
max
public OnDiskIndex.DataTerm max()
-
search
public RangeIterator<java.lang.Long,Token> search(Expression exp)
Search for rows which match all of the terms inside the given expression in the index file.- Parameters:
exp- The expression to use for the query.- Returns:
- Iterator which contains rows for all of the terms from the given range.
-
iteratorAt
public java.util.Iterator<OnDiskIndex.DataTerm> iteratorAt(java.nio.ByteBuffer query, OnDiskIndex.IteratorOrder order, boolean inclusive)
-
iterator
public java.util.Iterator<OnDiskIndex.DataTerm> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<OnDiskIndex.DataTerm>
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
getComparator
public AbstractType<?> getComparator()
-
getIndexPath
public java.lang.String getIndexPath()
-
-