public class SortedTextFile
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SortedTextFile.CachedStringIterator |
static class |
SortedTextFile.DefaultComparator |
static class |
SortedTextFile.NumericComparator |
| Modifier and Type | Field and Description |
|---|---|
protected int |
binsearchBlockSize |
static java.util.Comparator<java.lang.String> |
defaultComparator |
protected SeekableLineReaderFactory |
factory |
static java.util.Comparator<java.lang.String> |
numericComparator |
| Modifier | Constructor and Description |
|---|---|
protected |
SortedTextFile() |
|
SortedTextFile(SeekableLineReaderFactory factory) |
|
SortedTextFile(java.lang.String filename) |
|
SortedTextFile(java.lang.String filename,
boolean useNio) |
| Modifier and Type | Method and Description |
|---|---|
long |
binaryFindOffset(SeekableLineReader slr,
java.lang.String key,
java.util.Comparator<java.lang.String> comparator) |
int |
getBinsearchBlockSize() |
java.lang.String |
getLastLine(SeekableLineReader slr) |
java.lang.String[] |
getNthSplit(java.lang.String start,
java.lang.String end,
int split,
int numSplits) |
java.lang.String[] |
getRange(java.lang.String start,
java.lang.String end) |
CloseableIterator<java.lang.String> |
getRecordIterator(long offset) |
CloseableIterator<java.lang.String> |
getRecordIterator(java.lang.String prefix) |
CloseableIterator<java.lang.String> |
getRecordIterator(java.lang.String prefix,
boolean lessThan) |
CloseableIterator<java.lang.String> |
getRecordIteratorLT(java.lang.String prefix) |
SeekableLineReader |
getSLR() |
CloseableIterator<java.lang.String> |
getSplitIterator(java.lang.String start,
java.lang.String end,
int numSplits) |
long[] |
getStartEndOffsets(SeekableLineReader slr,
java.lang.String start,
java.lang.String end) |
void |
reloadFactory() |
void |
setBinsearchBlockSize(int binsearchBlockSize) |
protected void |
setFactory(SeekableLineReaderFactory factory) |
public static final java.util.Comparator<java.lang.String> numericComparator
public static final java.util.Comparator<java.lang.String> defaultComparator
protected SeekableLineReaderFactory factory
protected int binsearchBlockSize
public SortedTextFile(SeekableLineReaderFactory factory)
public SortedTextFile(java.lang.String filename)
throws java.io.IOException
java.io.IOExceptionpublic SortedTextFile(java.lang.String filename,
boolean useNio)
throws java.io.IOException
java.io.IOExceptionprotected SortedTextFile()
protected void setFactory(SeekableLineReaderFactory factory)
public void reloadFactory()
public int getBinsearchBlockSize()
public void setBinsearchBlockSize(int binsearchBlockSize)
public CloseableIterator<java.lang.String> getRecordIteratorLT(java.lang.String prefix) throws java.io.IOException
java.io.IOExceptionpublic CloseableIterator<java.lang.String> getRecordIterator(java.lang.String prefix) throws java.io.IOException
java.io.IOExceptionpublic SeekableLineReader getSLR() throws java.io.IOException
java.io.IOExceptionpublic CloseableIterator<java.lang.String> getRecordIterator(long offset) throws java.io.IOException
java.io.IOExceptionpublic CloseableIterator<java.lang.String> getRecordIterator(java.lang.String prefix, boolean lessThan) throws java.io.IOException
java.io.IOExceptionpublic long binaryFindOffset(SeekableLineReader slr, java.lang.String key, java.util.Comparator<java.lang.String> comparator) throws java.io.IOException
java.io.IOExceptionpublic long[] getStartEndOffsets(SeekableLineReader slr, java.lang.String start, java.lang.String end) throws java.io.IOException
java.io.IOExceptionpublic CloseableIterator<java.lang.String> getSplitIterator(java.lang.String start, java.lang.String end, int numSplits) throws java.io.IOException
java.io.IOExceptionpublic java.lang.String[] getRange(java.lang.String start,
java.lang.String end)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String[] getNthSplit(java.lang.String start,
java.lang.String end,
int split,
int numSplits)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getLastLine(SeekableLineReader slr) throws java.io.IOException
java.io.IOExceptionCopyright © 2019 The International Internet Preservation Consortium. All Rights Reserved.