use of com.hortonworks.streamline.streams.layout.component.impl.splitjoin.JoinAction in project streamline by hortonworks.
the class SplitJoinTest method runSplitJoin.
private void runSplitJoin(SplitJoinRule splitRule, SplitJoinRule joinRule, Map<String, Object> config) {
final SplitAction splitAction = (SplitAction) splitRule.getAction();
SplitActionRuntime splitActionRuntime = new SplitActionRuntime(splitAction);
splitActionRuntime.setActionRuntimeContext(new ActionRuntimeContext(splitRule, splitAction));
splitActionRuntime.initialize(config);
StreamlineEvent streamlineEvent = createRootEvent();
final List<Result> results = splitActionRuntime.execute(streamlineEvent);
JoinAction joinAction = (JoinAction) joinRule.getAction();
JoinActionRuntime joinActionRuntime = new JoinActionRuntime(joinAction);
joinActionRuntime.setActionRuntimeContext(new ActionRuntimeContext(joinRule, joinAction));
joinActionRuntime.initialize(config);
List<Result> effectiveResult = null;
for (Result result : results) {
for (StreamlineEvent event : result.events) {
List<Result> processedResult = joinActionRuntime.execute(event);
if (processedResult != null) {
effectiveResult = processedResult;
}
}
}
Assert.assertNotNull(effectiveResult);
}
Aggregations