use of com.hortonworks.streamline.streams.layout.component.impl.splitjoin.SplitAction in project streamline by hortonworks.
the class SplitJoinTest method testSplitJoinProcessorsWithActionsHavingStreams.
@Test
public void testSplitJoinProcessorsWithActionsHavingStreams() throws Exception {
String[] outputStreams = { "stream-1", "stream-2", "stream-3" };
final SplitAction splitAction = new SplitAction();
splitAction.setOutputStreams(Sets.newHashSet(outputStreams));
final JoinAction joinAction = new JoinAction();
joinAction.setOutputStreams(Collections.singleton("output-stream"));
runSplitJoin(splitAction, joinAction);
}
use of com.hortonworks.streamline.streams.layout.component.impl.splitjoin.SplitAction in project streamline by hortonworks.
the class SplitJoinTest method testCustomSplitJoinWithRules.
@Test
public void testCustomSplitJoinWithRules() {
String[] outputStreams = { "stream-1", "stream-2", "stream-3" };
final SplitAction splitAction = new SplitAction(MySplitter.class.getName());
SplitJoinRule splitRule = new SplitJoinRule("split", splitAction, Sets.newHashSet(outputStreams));
final JoinAction joinAction = new JoinAction(MyJoiner.class.getName());
SplitJoinRule joinRule = new SplitJoinRule("join", joinAction, Collections.singleton("output-stream"));
resetCounters();
runSplitJoin(splitRule, joinRule);
Assert.assertTrue(MySplitter.invocationCount == 1);
Assert.assertTrue(MyJoiner.invocationCount == 1);
}
use of com.hortonworks.streamline.streams.layout.component.impl.splitjoin.SplitAction in project streamline by hortonworks.
the class SplitJoinTest method testSplitJoinProcessorsWithRuleHavingStreams.
@Test
public void testSplitJoinProcessorsWithRuleHavingStreams() throws Exception {
String[] outputStreams = { "stream-1", "stream-2", "stream-3" };
SplitJoinRule splitRule = new SplitJoinRule("split", new SplitAction(), Sets.newHashSet(outputStreams));
SplitJoinRule joinRule = new SplitJoinRule("join", new JoinAction(), Collections.singleton("output-stream"));
runSplitJoin(splitRule, joinRule);
}
use of com.hortonworks.streamline.streams.layout.component.impl.splitjoin.SplitAction in project streamline by hortonworks.
the class SplitJoinTest method runCustomLoadedSplitJoin.
protected void runCustomLoadedSplitJoin(String splitterClassName, String joinerClassName, final InputStream splitJarInputStream, final InputStream joinJarInputStream) throws IOException {
String[] outputStreams = { "stream-1", "stream-2", "stream-3" };
final Long splitJarId = 1L;
final Long joinJarId = splitJarId + 1;
try {
new Expectations() {
{
mockCatalogRestClient.getFile(splitJarId);
result = splitJarInputStream;
mockCatalogRestClient.getFile(joinJarId);
result = joinJarInputStream;
}
};
final SplitAction splitAction = new SplitAction(splitJarId, splitterClassName);
splitAction.setOutputStreams(Sets.newHashSet(outputStreams));
final JoinAction joinAction = new JoinAction(joinJarId, joinerClassName);
joinAction.setOutputStreams(Collections.singleton("output-stream"));
Map<String, Object> config = new HashMap<>();
config.put(Constants.CATALOG_ROOT_URL, "dummy-url");
final Path tempDirectory = Files.createTempDirectory("sj-test");
tempDirectory.toFile().deleteOnExit();
config.put(Constants.LOCAL_FILES_PATH, tempDirectory);
runSplitJoin(splitAction, joinAction, config);
} finally {
splitJarInputStream.close();
joinJarInputStream.close();
}
}
use of com.hortonworks.streamline.streams.layout.component.impl.splitjoin.SplitAction in project streamline by hortonworks.
the class SplitJoinTopologyTest method createSplitBolt.
private RulesBolt createSplitBolt() {
SplitAction splitAction = new SplitAction();
splitAction.setOutputStreams(Collections.singleton(SPLIT_STREAM_ID.getId()));
SplitRulesProcessor splitRulesProcessor = new SplitRulesProcessor(SPLIT_STREAM_ID, splitAction);
return new RulesBolt(splitRulesProcessor.get(), getScriptType());
}
Aggregations