Class SortedTextFile
java.lang.Object
org.archive.util.binsearch.SortedTextFile
- Direct Known Subclasses:
CDXFile
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intstatic final Comparator<String> protected SeekableLineReaderFactorystatic final Comparator<String> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSortedTextFile(String filename) SortedTextFile(String filename, boolean useNio) SortedTextFile(SeekableLineReaderFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionlongbinaryFindOffset(SeekableLineReader slr, String key, Comparator<String> comparator) intString[]getNthSplit(String start, String end, int split, int numSplits) String[]getRecordIterator(long offset) getRecordIterator(String prefix) getRecordIterator(String prefix, boolean lessThan) getRecordIteratorLT(String prefix) getSLR()getSplitIterator(String start, String end, int numSplits) long[]getStartEndOffsets(SeekableLineReader slr, String start, String end) voidvoidsetBinsearchBlockSize(int binsearchBlockSize) protected voidsetFactory(SeekableLineReaderFactory factory)
-
Field Details
-
numericComparator
-
defaultComparator
-
factory
-
binsearchBlockSize
protected int binsearchBlockSize
-
-
Constructor Details
-
SortedTextFile
-
SortedTextFile
- Throws:
IOException
-
SortedTextFile
- Throws:
IOException
-
SortedTextFile
protected SortedTextFile()
-
-
Method Details
-
setFactory
-
reloadFactory
public void reloadFactory() -
getBinsearchBlockSize
public int getBinsearchBlockSize() -
setBinsearchBlockSize
public void setBinsearchBlockSize(int binsearchBlockSize) -
getRecordIteratorLT
- Throws:
IOException
-
getRecordIterator
- Throws:
IOException
-
getSLR
- Throws:
IOException
-
getRecordIterator
- Throws:
IOException
-
getRecordIterator
public CloseableIterator<String> getRecordIterator(String prefix, boolean lessThan) throws IOException - Throws:
IOException
-
binaryFindOffset
public long binaryFindOffset(SeekableLineReader slr, String key, Comparator<String> comparator) throws IOException - Throws:
IOException
-
getStartEndOffsets
public long[] getStartEndOffsets(SeekableLineReader slr, String start, String end) throws IOException - Throws:
IOException
-
getSplitIterator
public CloseableIterator<String> getSplitIterator(String start, String end, int numSplits) throws IOException - Throws:
IOException
-
getRange
- Throws:
IOException
-
getNthSplit
- Throws:
IOException
-
getLastLine
- Throws:
IOException
-