use of cz.o2.proxima.direct.transform.DirectElementWiseTransform in project proxima-platform by O2-Czech-Republic.
the class ReplicationController method runTransform.
private void runTransform(String name, TransformationDescriptor transform, DirectAttributeFamilyDescriptor family) {
final StorageFilter filter = transform.getFilter();
final String consumer = transform.getConsumerNameFactory().apply();
final CommitLogReader reader = family.getCommitLogReader().orElseThrow(() -> new IllegalStateException("Unable to get reader for family " + family.getDesc().getName() + "."));
final TransformationObserver observer;
if (transform.getTransformation().isContextual()) {
DirectElementWiseTransform transformation = transform.getTransformation().as(DirectElementWiseTransform.class);
observer = contextualObserver(dataOperator, name, transformation, transform.getOutputTransactionMode() == OutputTransactionMode.ENABLED, filter);
} else {
ElementWiseTransformation transformation = transform.getTransformation().asElementWiseTransform();
observer = nonContextualObserver(dataOperator, name, transformation, transform.getOutputTransactionMode() == OutputTransactionMode.ENABLED, filter);
}
startTransformationObserverUsing(consumer, reader, observer);
log.info("Started transformer {} reading from {} using {}", consumer, reader.getUri(), transform.getTransformation().getClass());
}
Aggregations