use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class PojoSinkTest method notExistingField.
@Test(expected = IllegalArgumentException.class)
public void notExistingField() {
final double expected = 1.5;
Row row = new Row();
row.addColumn(-1, "SHOULD-NOT-EXIST", expected);
this.cut.processRow(row);
}
use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class Pump method sink.
void sink(Sink sink, Map<String, Row> groupByDestinations) {
String destination = sink.getName();
if (destination == null) {
this.flowListener.accept(sink + " has a null destination, skipping");
return;
}
Row entriesForSink = groupByDestinations.get(destination);
if (entriesForSink != null) {
this.flowListener.accept("Processing entries " + entriesForSink + " with " + destination);
sink.processRow(entriesForSink);
this.flowListener.accept("Entries processed!");
} else {
this.flowListener.accept("No entries found for: " + destination);
}
}
use of com.airhacks.enhydrator.in.Row in project enhydrator by AdamBien.
the class Pump method transformRow.
void transformRow(Row currentRow) {
Row entryColumns = applyRowTransformations(this.beforeTransformations, currentRow);
this.flowListener.accept("Pre Row transformations processed");
applyExpressions(currentRow);
this.flowListener.accept("Row expressions processed");
columnTransformations(entryColumns);
this.flowListener.accept("Column transformations processed");
Row afterProcessed = applyRowTransformations(this.afterTransformations, entryColumns);
if (afterProcessed == null) {
return;
}
this.flowListener.accept("Post Row transformations processed: " + afterProcessed.getNumberOfColumns() + " entries");
this.sink(afterProcessed);
this.flowListener.accept("Result processed by sinks");
}
Aggregations