public CloseableIterator<String> getSplitIterator(String start, String end, int numSplits) throws IOException { SeekableLineReader slr = factory.get(); long[] offsets = getStartEndOffsets(slr, start, end); return new StepSeekingIterator(slr, offsets[0], offsets[1], numSplits); }
public CloseableIterator<String> getRecordIterator(final long offset) throws IOException { SeekableLineReader slr = factory.get(); slr.seek(offset); return new SeekableLineReaderIterator(slr); }
public CachedStringIterator(SeekableLineReader slr, String first, String second) { this.slr = slr; this.first = first; this.second = second; if (slr != null) { it = new SeekableLineReaderIterator(slr); } }
public void close() throws IOException { if (slr != null) { slr.close(); } } }
public void setPathIndex(String path) throws IOException { this.path = path; this.pathIndex = new SortedTextFile(path, false); }
public boolean hasNext() { if(first != null) { return true; } if(second != null) { return true; } if (it == null) { return false; } return it.hasNext(); }
@Override public void close() throws IOException { AbstractSeekableLineReader.this.close(); //in.close(); } }
@Override public void seekWithMaxRead(long offset, boolean gzip, int maxLength) throws IOException { slr.seekWithMaxRead(offset, gzip, maxLength); }
public StepSeekingIterator(SeekableLineReader slr, long startOffset, long endOffset, int numSplits) throws IOException { this.slr = slr; this.currSplit = 0; this.startOffset = startOffset; this.numSplits = numSplits; this.endOffset = endOffset; slr.seek(startOffset); }
@Override public void skipLine() throws IOException { super.readLine(); } }
public CloseableIterator<String> getRecordIterator(final long offset) throws IOException { SeekableLineReader slr = factory.get(); slr.seek(offset); return new SeekableLineReaderIterator(slr); }
public CloseableIterator<String> getSplitIterator(String start, String end, int numSplits) throws IOException { SeekableLineReader slr = factory.get(); long[] offsets = getStartEndOffsets(slr, start, end); return new StepSeekingIterator(slr, offsets[0], offsets[1], numSplits); }
public void close() throws IOException { if (slr != null) { slr.close(); } } }
public void setPathIndex(String path) throws IOException { this.path = path; this.pathIndex = new SortedTextFile(path, false); }
@Override public void finalize() { if (!closed) { try { close(); } catch (IOException e) { } } } }
public CloseableIterator<String> getRecordIterator(final long offset) throws IOException { SeekableLineReader slr = factory.get(); slr.seek(offset); return new SeekableLineReaderIterator(slr); }
public CloseableIterator<String> getSplitIterator(String start, String end, int numSplits) throws IOException { SeekableLineReader slr = factory.get(); long[] offsets = getStartEndOffsets(slr, start, end); return new StepSeekingIterator(slr, offsets[0], offsets[1], numSplits); }