Java Code Examples for org.apache.kafka.streams.TopologyDescription#Processor

The following examples show how to use org.apache.kafka.streams.TopologyDescription#Processor . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JoinNodeTest.java    From ksql-fork-with-deep-learning-function with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldHaveLeftJoin() {
  setupTopicClientExpectations(1, 1);
  buildJoin();
  final Topology topology = builder.build();
  final TopologyDescription.Processor leftJoin
      = (TopologyDescription.Processor) getNodeByName(topology, "KSTREAM-LEFTJOIN-0000000014");
  final List<String> predecessors = leftJoin.predecessors().stream().map(TopologyDescription.Node::name).collect(Collectors.toList());
  assertThat(leftJoin.stores(), equalTo(Utils.mkSet("KSTREAM-REDUCE-STATE-STORE-0000000003")));
  assertThat(predecessors, equalTo(Collections.singletonList("KSTREAM-SOURCE-0000000013")));
}
 
Example 2
Source File: PlanTestUtil.java    From ksql-fork-with-deep-learning-function with Apache License 2.0 5 votes vote down vote up
static void verifyProcessorNode(final TopologyDescription.Processor node,
                                 final List<String> expectedPredecessors,
                                 final List<String> expectedSuccessors) {
  final List<String> successors = node.successors().stream().map(TopologyDescription.Node::name).collect(Collectors.toList());
  final List<String> predecessors = node.predecessors().stream().map(TopologyDescription.Node::name).collect(Collectors.toList());
  assertThat(predecessors, equalTo(expectedPredecessors));
  assertThat(successors, equalTo(expectedSuccessors));
}
 
Example 3
Source File: KsqlBareOutputNodeTest.java    From ksql-fork-with-deep-learning-function with Apache License 2.0 4 votes vote down vote up
@Test
public void shouldBuildTransformNode() {
  final TopologyDescription.Processor node = (TopologyDescription.Processor) getNodeByName(TRANSFORM_NODE);
  verifyProcessorNode(node, Collections.singletonList(SOURCE_MAPVALUES_NODE), Collections.singletonList(FILTER_NODE));
}
 
Example 4
Source File: KsqlBareOutputNodeTest.java    From ksql-fork-with-deep-learning-function with Apache License 2.0 4 votes vote down vote up
@Test
public void shouldBuildFilterNode() {
  final TopologyDescription.Processor node = (TopologyDescription.Processor) getNodeByName(FILTER_NODE);
  verifyProcessorNode(node, Collections.singletonList(TRANSFORM_NODE), Collections.singletonList(FILTER_MAPVALUES_NODE));
}
 
Example 5
Source File: KsqlBareOutputNodeTest.java    From ksql-fork-with-deep-learning-function with Apache License 2.0 4 votes vote down vote up
@Test
public void shouldBuildMapValuesNode() {
  final TopologyDescription.Processor node = (TopologyDescription.Processor) getNodeByName(FILTER_MAPVALUES_NODE);
  verifyProcessorNode(node, Collections.singletonList(FILTER_NODE), Collections.singletonList(FOREACH_NODE));
}
 
Example 6
Source File: KsqlBareOutputNodeTest.java    From ksql-fork-with-deep-learning-function with Apache License 2.0 4 votes vote down vote up
@Test
public void shouldBuildForEachNode() {
  final TopologyDescription.Processor node = (TopologyDescription.Processor) getNodeByName(FOREACH_NODE);
  verifyProcessorNode(node, Collections.singletonList(FILTER_MAPVALUES_NODE), Collections.emptyList());
}
 
Example 7
Source File: StructuredDataSourceNodeTest.java    From ksql-fork-with-deep-learning-function with Apache License 2.0 4 votes vote down vote up
@Test
public void shouldBuildTransformNode() {
  final TopologyDescription.Processor node = (TopologyDescription.Processor) getNodeByName(builder.build(), PlanTestUtil.TRANSFORM_NODE);
  verifyProcessorNode(node, Collections.singletonList(PlanTestUtil.MAPVALUES_NODE), Collections.emptyList());
}