use of com.hortonworks.streamline.streams.layout.Transform in project streamline by hortonworks.
the class TransformActionRuntime method getTransformRuntimes.
private List<TransformRuntime> getTransformRuntimes(List<Transform> transforms) {
if (transforms == null || transforms.isEmpty()) {
return Collections.<TransformRuntime>singletonList(new IdentityTransformRuntime());
}
List<TransformRuntime> transformRuntimes = new ArrayList<>();
for (Transform transform : transforms) {
TransformRuntime transformRuntime = TransformRuntimeService.get().get(transform);
transformRuntimes.add(transformRuntime);
}
return transformRuntimes;
}
use of com.hortonworks.streamline.streams.layout.Transform in project streamline by hortonworks.
the class NotifierActionRuntime method getNotificationTransforms.
/**
* Returns the necessary transforms to perform based on the action.
*/
private List<Transform> getNotificationTransforms(NotifierAction action, Long ruleId) {
List<Transform> transforms = new ArrayList<>();
if (action.getOutputFieldsAndDefaults() != null && !action.getOutputFieldsAndDefaults().isEmpty()) {
transforms.add(new MergeTransform(action.getOutputFieldsAndDefaults()));
transforms.add(new SubstituteTransform(action.getOutputFieldsAndDefaults().keySet()));
transforms.add(new ProjectionTransform("projection-" + ruleId, action.getOutputFieldsAndDefaults().keySet()));
}
Map<String, Object> headers = new HashMap<>();
headers.put(AddHeaderTransformRuntime.HEADER_FIELD_NOTIFIER_NAME, action.getNotifierName());
headers.put(AddHeaderTransformRuntime.HEADER_FIELD_RULE_ID, ruleId);
transforms.add(new AddHeaderTransform(headers));
return transforms;
}
use of com.hortonworks.streamline.streams.layout.Transform in project streamline by hortonworks.
the class StageActionRuntime method buildTransformActionRuntime.
protected void buildTransformActionRuntime() {
final List<Transform> transforms = stageAction.getTransforms();
if (stageAction.getOutputStreams().size() != 1) {
throw new RuntimeException("Stage can only have one output stream.");
}
transformActionRuntime = new TransformActionRuntime(new TransformAction(transforms, stageAction.getOutputStreams()));
}
Aggregations