use of com.orientechnologies.orient.etl.block.OBlock in project orientdb by orientechnologies.
the class OETLProcessor method configureBeginBlocks.
private void configureBeginBlocks(Collection<ODocument> iBeginBlocks, OCommandContext iContext) throws IllegalAccessException, InstantiationException {
// BEGIN BLOCKS
String name;
beginBlocks = new ArrayList<OBlock>();
if (iBeginBlocks != null) {
for (ODocument block : iBeginBlocks) {
name = block.fieldNames()[0];
final OBlock b = factory.getBlock(name);
beginBlocks.add(b);
configureComponent(b, (ODocument) block.field(name), iContext);
// Execution is necessary to resolve let blocks and provide resolved variables to other components
b.execute();
}
}
}
use of com.orientechnologies.orient.etl.block.OBlock in project orientdb by orientechnologies.
the class OETLProcessor method end.
protected void end() {
for (OTransformer t : transformers) t.end();
if (source != null)
source.end();
extractor.end();
loader.end();
for (OBlock t : endBlocks) {
t.begin();
t.execute();
t.end();
}
elapsed = System.currentTimeMillis() - startTime;
if (dumpTask != null) {
dumpTask.cancel();
}
out(LOG_LEVELS.INFO, "END ETL PROCESSOR");
dumpProgress();
}
use of com.orientechnologies.orient.etl.block.OBlock in project orientdb by orientechnologies.
the class OETLProcessor method configureEndBlocks.
private void configureEndBlocks(Collection<ODocument> iEndBlocks, OCommandContext iContext) throws IllegalAccessException, InstantiationException {
endBlocks = new ArrayList<OBlock>();
if (iEndBlocks != null) {
for (ODocument block : iEndBlocks) {
final String name = block.fieldNames()[0];
final OBlock b = factory.getBlock(name);
endBlocks.add(b);
configureComponent(b, block.<ODocument>field(name), iContext);
}
}
}
use of com.orientechnologies.orient.etl.block.OBlock in project orientdb by orientechnologies.
the class OETLProcessor method begin.
protected void begin() {
out(LOG_LEVELS.INFO, "BEGIN ETL PROCESSOR");
final Integer cfgMaxRetries = (Integer) context.getVariable("maxRetries");
if (cfgMaxRetries != null)
maxRetries = cfgMaxRetries;
final Integer dumpEveryMs = (Integer) context.getVariable("dumpEveryMs");
if (dumpEveryMs != null && dumpEveryMs > 0) {
dumpTask = new TimerTask() {
@Override
public void run() {
dumpProgress();
}
};
Orient.instance().scheduleTask(dumpTask, dumpEveryMs, dumpEveryMs);
startTime = System.currentTimeMillis();
}
for (OBlock t : beginBlocks) {
t.begin();
t.execute();
t.end();
}
if (source != null)
source.begin();
extractor.begin();
}
Aggregations