public class ChainIterativeReader<TUPLE_IN,RECORD_OUT,STATE> extends AbstractReader<TUPLE_IN,RECORD_OUT,STATE>
BaseIterativeProcessor
sProcess.Event, Process.EventPoint
exceptions, failFast, filter, hasNext, index, messages, params, paused, resource, transformer
listeners, processState
Constructor and Description |
---|
ChainIterativeReader()
Default Constructor to allow lazy initialization
If so, init() must be called by the calling API explicitly after calling BaseIterativeProcessor.setResource(Resource) |
ChainIterativeReader(org.springframework.core.io.Resource resource) |
ChainIterativeReader(org.springframework.core.io.Resource resource,
List<BaseIterativeProcessor> processes) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Un-initialize reader, so that it maybe re consumed
Except for the main Resource & configuration set by Spring context
all other instance variables used will be re-set/disposed/cleared. |
Long |
getCurrentRawIndex(TUPLE_IN row)
Get the raw index/position on the source;
BaseIterativeProcessor.getCurrentIndex() only tracks the relevant position. |
Collection<Throwable> |
getExceptions()
Used if failFast is off (false) to get the exceptions that occurred in the run/load
|
Collection<String> |
getMessages()
Messages generated during the process
|
Object[] |
getParams()
Additional Params for the ETL Process
|
List<BaseIterativeProcessor> |
getProcesses() |
STATE |
getState()
Get current state of process
|
boolean |
hasNext()
True if there is another record that can be read by the parser, false implies end of parse/read
|
void |
init()
Sets all
BaseIterativeProcessor processes with a BaseIterativeProcessor.getResource() if not definedAdditionally it checks if the process has been RealTimeLineReader.isInitialized() . |
boolean |
isInitialized()
Checks if all
processes are RealTimeLineReader.isInitialized() |
boolean |
isPaused() |
void |
kill()
Kill a process
|
protected TUPLE_IN |
nextRecord()
Locates the position of the next Record based on
BaseIterativeProcessor.nextRecord() of the active process. |
void |
pause()
Pause till resume
|
void |
resume() |
void |
resumeFromState(STATE state)
Resume process from the given State provided
|
void |
setExceptions(Collection<Throwable> exceptions)
Used if failFast is off (false) to get the exceptions that occurred in the run/load
|
void |
setFailFast(boolean failFast)
If true will exit on first exception else will collect exceptions
|
void |
setMessages(Collection<String> messages)
Messages generated during the process
|
void |
setParams(Object[] params)
Additional Params for the ETL Process
|
void |
setProcesses(List<BaseIterativeProcessor> processes) |
Long |
size()
Get number of tuples/records in resource
|
void |
stop()
Request graceful Shutdown
|
close, filter, getCurrentIndex, getCurrentTupleIdentifier, getFilter, getId, getMeta, getResource, getSourceLocation, getTransformer, handleMiscException, isFailFast, next, nextTupleResult, remove, setFilter, setId, setMeta, setResource, setTransformer, transform
addListener, getListeners, onChangeHandler, setListeners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public ChainIterativeReader()
init()
must be called by the calling API explicitly after calling BaseIterativeProcessor.setResource(Resource)
public ChainIterativeReader(org.springframework.core.io.Resource resource)
public ChainIterativeReader(org.springframework.core.io.Resource resource, List<BaseIterativeProcessor> processes)
@PostConstruct public void init() throws IOException, Exception
BaseIterativeProcessor
processes with a BaseIterativeProcessor.getResource()
if not definedRealTimeLineReader.isInitialized()
. If NOT then it will call BaseIterativeProcessor.init()
init
in interface RealTimeLineReader<RECORD_OUT>
init
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
Exception
IOException
public boolean isInitialized() throws Exception
processes
are RealTimeLineReader.isInitialized()
Exception
public void dispose() throws BreakChainException
RealTimeLineReader
Resource
& configuration set by Spring context
all other instance variables used will be re-set/disposed/cleared.BreakChainException
public Long size()
ResourceAwareRealTimeLineReader
public STATE getState() throws Exception
ControllableProcess
Exception
public void resumeFromState(STATE state) throws Exception
ControllableProcess
Exception
protected TUPLE_IN nextRecord()
BaseIterativeProcessor.nextRecord()
of the active process.
The active process is the first process that has its hasNext()
is true.nextRecord
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
public void setFailFast(boolean failFast)
setFailFast
in interface FailFastAware
setFailFast
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
public Collection<Throwable> getExceptions()
getExceptions
in interface FailFastAware
getExceptions
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
public void setExceptions(Collection<Throwable> exceptions)
setExceptions
in interface FailFastAware
setExceptions
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
public Collection<String> getMessages()
getMessages
in interface FailFastAware
getMessages
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
public void setMessages(Collection<String> messages)
setMessages
in interface FailFastAware
setMessages
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
public Object[] getParams()
getParams
in interface ParamsAware
getParams
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
public void setParams(Object[] params)
setParams
in interface ParamsAware
setParams
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
public boolean hasNext()
RealTimeLineReader
hasNext
in interface RealTimeLineReader<RECORD_OUT>
hasNext
in interface Iterator<RECORD_OUT>
hasNext
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
public void stop() throws Exception
ControllableProcess
stop
in interface ControllableProcess<STATE>
stop
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
Exception
public void pause() throws Exception
ControllableProcess
pause
in interface ControllableProcess<STATE>
pause
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
Exception
public boolean isPaused()
isPaused
in interface ControllableProcess<STATE>
isPaused
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
public void resume() throws Exception
resume
in interface ControllableProcess<STATE>
resume
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
Exception
public void kill() throws Exception
ControllableProcess
kill
in interface ControllableProcess<STATE>
kill
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
Exception
public Long getCurrentRawIndex(TUPLE_IN row)
BaseIterativeProcessor
BaseIterativeProcessor.getCurrentIndex()
only tracks the relevant position.
This method allows us to get the position on the source.
BaseIterativeProcessor.getCurrentIndex()
getCurrentRawIndex
in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>
public List<BaseIterativeProcessor> getProcesses()
public void setProcesses(List<BaseIterativeProcessor> processes)
Copyright © 2018. All rights reserved.