Package org.apache.druid.data.input
Class HandlingInputRowIterator
java.lang.Object
org.apache.druid.data.input.HandlingInputRowIterator
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterator<InputRow>,CloseableIterator<InputRow>
Decorated
CloseableIterator<InputRow> that can process rows with HandlingInputRowIterator.InputRowHandlers.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionHandlingInputRowIterator(CloseableIterator<InputRow> inputRowIterator, List<HandlingInputRowIterator.InputRowHandler> inputRowHandlers) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.java.util.common.parsers.CloseableIterator
flatMap, mapMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
HandlingInputRowIterator
public HandlingInputRowIterator(CloseableIterator<InputRow> inputRowIterator, List<HandlingInputRowIterator.InputRowHandler> inputRowHandlers) - Parameters:
inputRowIterator- Source ofInputRowsinputRowHandlers- Before yielding the nextInputRow, eachHandlingInputRowIterator.InputRowHandleris sequentially applied to theInputRowuntil one of them returns true or all of the handlers are applied.
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
- Specified by:
nextin interfaceIterator<InputRow>- Returns:
- Next
InputRowor null if row was successfully handled by anHandlingInputRowIterator.InputRowHandler.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-