org.apache.edgent.topology.TStream.topology()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中org.apache.edgent.topology.TStream.topology()方法的一些代码示例,展示了TStream.topology()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TStream.topology()方法的具体详情如下:
包路径:org.apache.edgent.topology.TStream
类名称:TStream
方法名:topology

TStream.topology介绍

暂无

代码示例

代码示例来源:origin: org.apache.edgent/edgent-spi-topology

@Override
public Topology topology() {
  return feed.topology();
}

代码示例来源:origin: apache/incubator-edgent

@Override
public Topology topology() {
  return feed.topology();
}

代码示例来源:origin: org.apache.edgent/edgent-spi-topology

protected void verify(TStream<T> other) {
  if (topology() != other.topology())
    throw new IllegalArgumentException();
}

代码示例来源:origin: apache/incubator-edgent

protected void verify(TStream<T> other) {
  if (topology() != other.topology())
    throw new IllegalArgumentException();
}

代码示例来源:origin: apache/incubator-edgent

protected void assertStream(Topology t, TStream<?> s) {
  assertSame(t, s.topology());
}

代码示例来源:origin: apache/incubator-edgent

/**
 * Test without a pub-sub service so no
 * cross job connections will be made.
 * @throws Exception on failure
 */
@Test
public void testNoService() throws Exception {
  DirectProvider dp = new DirectProvider();
  TStream<String> publishedStream = createPublisher(dp, "t1", String.class, getStrs());
  Tester testPub = publishedStream.topology().getTester();
  Condition<Long> tcPub = testPub.tupleCount(publishedStream, 3);
  TStream<String> subscribedStream = createSubscriber(dp, "t1", String.class);
  Tester testSub = subscribedStream.topology().getTester();
  Condition<Long> tcSub = testSub.tupleCount(subscribedStream, 0); // Expect none
  Job js = dp.submit(subscribedStream.topology()).get();
  Job jp = dp.submit(publishedStream.topology()).get();
  Thread.sleep(1500);
  assertTrue(tcPub.valid());
  assertTrue(tcSub.valid());
  js.stateChange(Action.CLOSE);
  jp.stateChange(Action.CLOSE);
}

代码示例来源:origin: apache/incubator-edgent

static <T> void setPollFrequency(TStream<T> pollStream, long period, TimeUnit unit) {
  ControlService cs = pollStream.topology().getRuntimeServiceSupplier()
                .get().getService(ControlService.class);
  PeriodMXBean control = cs.getControl(TStream.TYPE,
               pollStream.getAlias(), PeriodMXBean.class);
  control.setPeriod(period, unit);
}

代码示例来源:origin: apache/incubator-edgent

Tester testPub1 = publishedStream1.topology().getTester();
Condition<List<Integer>> tcPub1 = testPub1.streamContents(publishedStream1, 1,2,3,82);
Tester testPub2 = publishedStream2.topology().getTester();
Condition<List<Integer>> tcPub2 = testPub2.streamContents(publishedStream2, 5,432,34,99);
Tester testPub3 = publishedStream3.topology().getTester();
Condition<List<Integer>> tcPub3 = testPub3.streamContents(publishedStream3, 35,456,888,263,578);
Tester testSub = subscribedStream.topology().getTester();
Condition<List<Integer>> tcSub = testSub.contentsUnordered(subscribedStream,
    1,2,3,82,5,432,34,99,35,456,888,263,578); // Expect all tuples
Job js = dp.submit(subscribedStream.topology()).get();
Job jp1 = dp.submit(publishedStream1.topology()).get();
Job jp2 = dp.submit(publishedStream2.topology()).get();
Job jp3 = dp.submit(publishedStream3.topology()).get();

代码示例来源:origin: apache/incubator-edgent

@Test(timeout=10000)
public void testProviderServiceSingleSubscriber() throws Exception {
  DirectProvider dp = new DirectProvider();
  dp.getServices().addService(PublishSubscribeService.class, new ProviderPubSub());
  TStream<String> publishedStream = createPublisher(dp, "t1", String.class, getStrs());
  Tester testPub = publishedStream.topology().getTester();
  Condition<List<String>> tcPub = testPub.streamContents(publishedStream, getStrs());
  TStream<String> subscribedStream = createSubscriber(dp, "t1", String.class);
  Tester testSub = subscribedStream.topology().getTester();
  Condition<List<String>> tcSub = testSub.streamContents(subscribedStream, getStrs()); // Expect all tuples
  Job js = dp.submit(subscribedStream.topology()).get();
  // Give the subscriber a chance to setup.
  while (js.getCurrentState() != State.RUNNING)
    Thread.sleep(50);
  
  Job jp = dp.submit(publishedStream.topology()).get();
  
  while (!tcSub.valid() || !tcPub.valid())
    Thread.sleep(50);
  assertTrue(tcPub.valid());
  assertTrue(tcSub.valid());
  js.stateChange(Action.CLOSE);
  jp.stateChange(Action.CLOSE);
}

代码示例来源:origin: apache/incubator-edgent

Tester testPub = publishedStream.topology().getTester();
Condition<List<String>> tcPub = testPub.streamContents(publishedStream, getStrs());
Tester testSub1 = subscribedStream1.topology().getTester();
Condition<List<String>> tcSub1 = testSub1.streamContents(subscribedStream1, getStrs());
Tester testSub2 = subscribedStream2.topology().getTester();
Condition<List<String>> tcSub2 = testSub2.streamContents(subscribedStream2, getStrs());
Tester testSub3 = subscribedStream3.topology().getTester();
Condition<List<String>> tcSub3 = testSub3.streamContents(subscribedStream3, getStrs());
Job js1 = dp.submit(subscribedStream1.topology()).get();
Job js2 = dp.submit(subscribedStream2.topology()).get();
Job js3 = dp.submit(subscribedStream3.topology()).get();
  Thread.sleep(50);
Job jp = dp.submit(publishedStream.topology()).get();

相关文章