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 class
OnDiskIndex.DataBlock
protected class
OnDiskIndex.DataLevel
class
OnDiskIndex.DataTerm
static class
OnDiskIndex.IteratorOrder
protected class
OnDiskIndex.Level<T extends OnDiskBlock>
protected class
OnDiskIndex.OnDiskSuperBlock
protected class
OnDiskIndex.PointerBlock
protected class
OnDiskIndex.PointerLevel
protected static class
OnDiskIndex.PointerTerm
-
Field Summary
Fields Modifier and Type Field Description protected AbstractType<?>
comparator
protected OnDiskIndex.DataLevel
dataLevel
Descriptor
descriptor
protected boolean
hasMarkedPartials
protected MappedBuffer
indexFile
protected java.lang.String
indexPath
protected long
indexSize
protected com.google.common.base.Function<java.lang.Long,DecoratedKey>
keyFetcher
protected OnDiskIndex.PointerLevel[]
levels
protected java.nio.ByteBuffer
maxKey
protected java.nio.ByteBuffer
maxTerm
protected java.nio.ByteBuffer
minKey
protected java.nio.ByteBuffer
minTerm
protected OnDiskIndexBuilder.Mode
mode
protected OnDiskIndexBuilder.TermSize
termSize
-
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 void
close()
AbstractType<?>
getComparator()
java.lang.String
getIndexPath()
boolean
hasMarkedPartials()
java.util.Iterator<OnDiskIndex.DataTerm>
iterator()
java.util.Iterator<OnDiskIndex.DataTerm>
iteratorAt(java.nio.ByteBuffer query, OnDiskIndex.IteratorOrder order, boolean inclusive)
OnDiskIndex.DataTerm
max()
java.nio.ByteBuffer
maxKey()
java.nio.ByteBuffer
maxTerm()
OnDiskIndex.DataTerm
min()
java.nio.ByteBuffer
minKey()
java.nio.ByteBuffer
minTerm()
OnDiskIndexBuilder.Mode
mode()
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:
iterator
in interfacejava.lang.Iterable<OnDiskIndex.DataTerm>
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
getComparator
public AbstractType<?> getComparator()
-
getIndexPath
public java.lang.String getIndexPath()
-
-