Package org.apache.cassandra.io.sstable
Class AbstractSSTableIterator.AbstractReader
- java.lang.Object
-
- org.apache.cassandra.io.sstable.AbstractSSTableIterator.AbstractReader
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,java.util.Iterator<Unfiltered>
,AbstractSSTableIterator.Reader
- Direct Known Subclasses:
AbstractSSTableIterator.ForwardReader
- Enclosing class:
- AbstractSSTableIterator<RIE extends AbstractRowIndexEntry>
public abstract class AbstractSSTableIterator.AbstractReader extends java.lang.Object implements AbstractSSTableIterator.Reader
-
-
Field Summary
Fields Modifier and Type Field Description UnfilteredDeserializer
deserializer
FileDataInput
file
DeletionTime
openMarker
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractReader(FileDataInput file, boolean shouldCloseFile)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
hasNext()
protected abstract boolean
hasNextInternal()
Unfiltered
next()
protected abstract Unfiltered
nextInternal()
void
seekToPosition(long position)
Seek to the given position in the file.abstract void
setForSlice(Slice slice)
java.lang.String
toString()
protected void
updateOpenMarker(RangeTombstoneMarker marker)
-
-
-
Field Detail
-
file
public FileDataInput file
-
deserializer
public UnfilteredDeserializer deserializer
-
openMarker
public DeletionTime openMarker
-
-
Constructor Detail
-
AbstractReader
protected AbstractReader(FileDataInput file, boolean shouldCloseFile)
-
-
Method Detail
-
seekToPosition
public void seekToPosition(long position) throws java.io.IOException
Seek to the given position in the file. Initializes the file reader along with a deserializer if they are not initialized yet. Otherwise, the deserializer is reset by calling itsUnfilteredDeserializer.clearState()
method. Note that the only valid usage of this method is to seek to the beginning of the serialized record so that the deserializer can read the next unfiltered from that position. Setting an arbitrary position will lead to unexpected results and/or corrupted reads.- Specified by:
seekToPosition
in interfaceAbstractSSTableIterator.Reader
- Throws:
java.io.IOException
-
updateOpenMarker
protected void updateOpenMarker(RangeTombstoneMarker marker)
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<Unfiltered>
-
next
public Unfiltered next()
- Specified by:
next
in interfacejava.util.Iterator<Unfiltered>
-
setForSlice
public abstract void setForSlice(Slice slice) throws java.io.IOException
- Specified by:
setForSlice
in interfaceAbstractSSTableIterator.Reader
- Throws:
java.io.IOException
-
hasNextInternal
protected abstract boolean hasNextInternal() throws java.io.IOException
- Throws:
java.io.IOException
-
nextInternal
protected abstract Unfiltered nextInternal() throws java.io.IOException
- Throws:
java.io.IOException
-
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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-