Package de.regnis.q.sequence.line
Class QSequenceLineFileSystemCacheSegments
- java.lang.Object
-
- de.regnis.q.sequence.line.QSequenceLineFileSystemCacheSegments
-
class QSequenceLineFileSystemCacheSegments extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.RandomAccessFile
file
private java.io.File
filePath
private int
maximumEntriesPerSegment
private int
maximumSegmentsInMemory
private java.util.List
memorySegments
private java.util.List
segments
private QSequenceLineTempDirectoryFactory
tempDirectoryFactory
-
Constructor Summary
Constructors Constructor Description QSequenceLineFileSystemCacheSegments(QSequenceLineTempDirectoryFactory tempDirectoryFactory, int maximumBytesInMemory, int segmentBytesSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
private java.io.RandomAccessFile
getFile()
long
getFrom(int index)
int
getHash(int index)
int
getLength(int index)
private QSequenceLineFileSystemCacheSegment
getSegment(int segmentIndex)
private void
maybeUnloadSegments()
void
setFromLengthHash(int index, long from, int length, int hash)
-
-
-
Field Detail
-
tempDirectoryFactory
private final QSequenceLineTempDirectoryFactory tempDirectoryFactory
-
maximumEntriesPerSegment
private final int maximumEntriesPerSegment
-
maximumSegmentsInMemory
private final int maximumSegmentsInMemory
-
segments
private final java.util.List segments
-
memorySegments
private final java.util.List memorySegments
-
filePath
private java.io.File filePath
-
file
private java.io.RandomAccessFile file
-
-
Constructor Detail
-
QSequenceLineFileSystemCacheSegments
public QSequenceLineFileSystemCacheSegments(QSequenceLineTempDirectoryFactory tempDirectoryFactory, int maximumBytesInMemory, int segmentBytesSize)
-
-
Method Detail
-
getFrom
public long getFrom(int index) throws java.io.IOException
- Throws:
java.io.IOException
-
getLength
public int getLength(int index) throws java.io.IOException
- Throws:
java.io.IOException
-
getHash
public int getHash(int index) throws java.io.IOException
- Throws:
java.io.IOException
-
setFromLengthHash
public void setFromLengthHash(int index, long from, int length, int hash) throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Throws:
java.io.IOException
-
getSegment
private QSequenceLineFileSystemCacheSegment getSegment(int segmentIndex) throws java.io.IOException
- Throws:
java.io.IOException
-
maybeUnloadSegments
private void maybeUnloadSegments() throws java.io.IOException
- Throws:
java.io.IOException
-
getFile
private java.io.RandomAccessFile getFile() throws java.io.IOException
- Throws:
java.io.IOException
-
-