public class ChainIterativeReader<TUPLE_IN,RECORD_OUT,STATE> extends AbstractReader<TUPLE_IN,RECORD_OUT,STATE>
BaseIterativeProcessorsProcess.Event, Process.EventPointexceptions, failFast, filter, hasNext, index, messages, params, paused, resource, transformerlisteners, 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, transformaddListener, getListeners, onChangeHandler, setListenersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic 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>ExceptionIOExceptionpublic boolean isInitialized()
throws Exception
processes are RealTimeLineReader.isInitialized()Exceptionpublic void dispose()
throws BreakChainException
RealTimeLineReaderResource & configuration set by Spring context
all other instance variables used will be re-set/disposed/cleared.BreakChainExceptionpublic Long size()
ResourceAwareRealTimeLineReaderpublic STATE getState() throws Exception
ControllableProcessExceptionpublic void resumeFromState(STATE state) throws Exception
ControllableProcessExceptionprotected 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 FailFastAwaresetFailFast in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>public Collection<Throwable> getExceptions()
getExceptions in interface FailFastAwaregetExceptions in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>public void setExceptions(Collection<Throwable> exceptions)
setExceptions in interface FailFastAwaresetExceptions in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>public Collection<String> getMessages()
getMessages in interface FailFastAwaregetMessages in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>public void setMessages(Collection<String> messages)
setMessages in interface FailFastAwaresetMessages in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>public Object[] getParams()
getParams in interface ParamsAwaregetParams in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>public void setParams(Object[] params)
setParams in interface ParamsAwaresetParams in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>public boolean hasNext()
RealTimeLineReaderhasNext 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
ControllableProcessstop in interface ControllableProcess<STATE>stop in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>Exceptionpublic void pause()
throws Exception
ControllableProcesspause in interface ControllableProcess<STATE>pause in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>Exceptionpublic 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>Exceptionpublic void kill()
throws Exception
ControllableProcesskill in interface ControllableProcess<STATE>kill in class BaseIterativeProcessor<TUPLE_IN,RECORD_OUT,STATE>Exceptionpublic Long getCurrentRawIndex(TUPLE_IN row)
BaseIterativeProcessorBaseIterativeProcessor.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.