Package org.apache.druid.data.input.impl
Class FastLineIterator<T>
- java.lang.Object
-
- org.apache.druid.data.input.impl.FastLineIterator<T>
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterator<T>,CloseableIterator<T>
- Direct Known Subclasses:
FastLineIterator.Bytes,FastLineIterator.Strings
public abstract class FastLineIterator<T> extends Object implements CloseableIterator<T>
Like the Apache Commons LineIterator, but faster. UseFastLineIterator.StringsorFastLineIterator.Bytesas appropriate. Bytes is faster.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFastLineIterator.Bytesstatic classFastLineIterator.Strings
-
Constructor Summary
Constructors Modifier Constructor Description protectedFastLineIterator(InputStream source)Constructor; a local buffer will be createdprotectedFastLineIterator(InputStream source, byte[] buffer)Constructor; BYO buffer.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()booleanhasNext()protected abstract TmakeObject(byte[] bytes, int offset, int length)Tnext()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.java.util.common.parsers.CloseableIterator
flatMap, map
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
FastLineIterator
protected FastLineIterator(InputStream source)
Constructor; a local buffer will be created- Parameters:
source-
-
FastLineIterator
protected FastLineIterator(InputStream source, byte[] buffer)
Constructor; BYO buffer. Existing contents of the buffer will be destroyed.- Parameters:
source-buffer- a buffer used for between-read calls
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
makeObject
protected abstract T makeObject(byte[] bytes, int offset, int length)
-
-