IN
- as input type.T
- as the resultant output type for each tuple in the process.public class ETLRunner<IN,T> extends Object implements org.springframework.context.ApplicationContextAware
Constructor and Description |
---|
ETLRunner() |
Modifier and Type | Method and Description |
---|---|
protected void |
handleCollectedExceptions(Collection<Throwable> errs)
ETLRunnerOptions.isFailFast() =false then the exceptions per tuple collect,
at the end of the process one can hook into them here. |
protected boolean |
handleTupleException(Exception e)
How to handle an Exception @ a tuple level (only if
ETLRunnerOptions.isFailFast() or critical exceptions. |
protected void |
init(AbstractReader<IN,T,Serializable> reader,
ETLMeta meta)
All Thread/Reading init based activities
|
protected void |
injectContext(AbstractReader<IN,T,Serializable> reader)
Inject context data into
ParamsAware and ReaderAware like transformer implementation. |
protected void |
onEntity(T entity)
Callback on creation/conversion of Entity from Tuple
|
protected void |
onMetaProcessor(Object output)
Callback on post processing of the entity; output of
ETLMeta.getEntityProcessor() |
protected void |
processGeneratedEntity(T entity,
AbstractReader<IN,T,Serializable> reader,
ETLMeta meta,
ETLRunnerOptions options)
Process the final Entity produced from the ETL Process.
This is a convenient way to simply provide Transformer based processing over input/reader produced output as AbstractReader are not required at times. |
protected void |
progressCallback(int percent,
T lastEntityProcessed) |
void |
run(AbstractReader<IN,T,Serializable> reader,
ETLMeta meta,
ETLRunnerOptions options) |
void |
setApplicationContext(org.springframework.context.ApplicationContext context) |
protected void |
setupJob(AbstractReader<IN,T,Serializable> job,
ETLMeta meta,
ETLRunnerOptions options) |
protected void |
threadInit(AbstractReader<IN,T,Serializable> reader,
ETLMeta meta)
Init before the thread runs.
|
protected void setupJob(AbstractReader<IN,T,Serializable> job, ETLMeta meta, ETLRunnerOptions options) throws Exception
Exception
protected void init(AbstractReader<IN,T,Serializable> reader, ETLMeta meta) throws Exception
Exception
protected void injectContext(AbstractReader<IN,T,Serializable> reader)
ParamsAware
and ReaderAware
like transformer implementation.t
- as Transformer
protected void threadInit(AbstractReader<IN,T,Serializable> reader, ETLMeta meta)
protected void processGeneratedEntity(T entity, AbstractReader<IN,T,Serializable> reader, ETLMeta meta, ETLRunnerOptions options)
AbstractReader
are not required at times.entity
- as T @nullable trueprotected boolean handleTupleException(Exception e)
ETLRunnerOptions.isFailFast()
or critical exceptions.e
- as Exception
protected void progressCallback(int percent, T lastEntityProcessed)
protected void onEntity(T entity)
entity
- as Entity type ETLRunnerOptions.isFailFast()
=false then there is an Exception.handleTupleException(Exception)
protected void handleCollectedExceptions(Collection<Throwable> errs)
ETLRunnerOptions.isFailFast()
=false then the exceptions per tuple collect,
at the end of the process one can hook into them here.errs
- as Collection
of Throwable
protected void onMetaProcessor(Object output)
ETLMeta.getEntityProcessor()
output
- as output Objectpublic void run(AbstractReader<IN,T,Serializable> reader, ETLMeta meta, ETLRunnerOptions options) throws Exception
Exception
public void setApplicationContext(org.springframework.context.ApplicationContext context) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
Copyright © 2018. All rights reserved.