当前位置: 首页>>代码示例>>Java>>正文


Java LocalMode.cloneDAG方法代码示例

本文整理汇总了Java中com.datatorrent.api.LocalMode.cloneDAG方法的典型用法代码示例。如果您正苦于以下问题:Java LocalMode.cloneDAG方法的具体用法?Java LocalMode.cloneDAG怎么用?Java LocalMode.cloneDAG使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.datatorrent.api.LocalMode的用法示例。


在下文中一共展示了LocalMode.cloneDAG方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testApplication

import com.datatorrent.api.LocalMode; //导入方法依赖的package包/类
@Test
public void testApplication() throws Exception
{
  LocalMode lma = LocalMode.newInstance();
  Configuration conf = new Configuration(false);
  conf.set("dt.operator.Unique.prop.tableName", "Test_Lookup_Cache");
  conf.set("dt.operator.Unique.prop.store.dbUrl", "jdbc:hsqldb:mem:test;sql.syntax_mys=true");
  conf.set("dt.operator.Unique.prop.store.dbDriver", "org.hsqldb.jdbcDriver");

  lma.prepareDAG(new Application(), conf);
  lma.cloneDAG();
  LocalMode.Controller lc = lma.getController();
  lc.setHeartbeatMonitoringEnabled(false);
  lc.runAsync();

  long now = System.currentTimeMillis();
  while (System.currentTimeMillis() - now < 15000) {
    Thread.sleep(1000);
  }
  lc.shutdown();
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:22,代码来源:StatefulUniqueCountTest.java

示例2: testApplication

import com.datatorrent.api.LocalMode; //导入方法依赖的package包/类
@Test
public void testApplication() throws Exception
{
  LocalMode lma = LocalMode.newInstance();
  Configuration conf = new Configuration(false);
  conf.set("dt.operator.StatefulUniqueCounter.prop.tableName", "Test_Lookup_Cache");
  conf.set("dt.operator.StatefulUniqueCounter.prop.store.dbUrl", "jdbc:hsqldb:mem:test;sql.syntax_mys=true");
  conf.set("dt.operator.StatefulUniqueCounter.prop.store.dbDriver", "org.hsqldb.jdbcDriver");

  lma.prepareDAG(new StatefulApplication(), conf);
  lma.cloneDAG();
  LocalMode.Controller lc = lma.getController();
  lc.setHeartbeatMonitoringEnabled(false);
  lc.runAsync();

  long now = System.currentTimeMillis();
  while (System.currentTimeMillis() - now < 15000) {
    Thread.sleep(1000);
  }

  lc.shutdown();
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:23,代码来源:StatefulApplicationTest.java

示例3: testApplication

import com.datatorrent.api.LocalMode; //导入方法依赖的package包/类
@Test
public void testApplication() throws IOException, Exception
{
  LocalMode lma = LocalMode.newInstance();
  new ApplicationFixed().populateDAG(lma.getDAG(), new Configuration(false));

  DAG dag = lma.cloneDAG();
  FixedTuplesInputOperator wordGenerator = (FixedTuplesInputOperator)dag
      .getOperatorMeta("WordGenerator").getOperator();
  Assert.assertEquals("Queue Capacity", ApplicationFixed.QUEUE_CAPACITY, (int)dag.getMeta(wordGenerator)
      .getMeta(wordGenerator.output).getValue(PortContext.QUEUE_CAPACITY));

  LocalMode.Controller lc = lma.getController();
  lc.run(60000);
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:16,代码来源:ApplicationFixedTest.java

示例4: testPopulateDAG

import com.datatorrent.api.LocalMode; //导入方法依赖的package包/类
@Test
public void testPopulateDAG() throws Exception
{
  Configuration configuration = new Configuration(false);

  LocalMode lm = LocalMode.newInstance();
  DAG prepareDAG = lm.prepareDAG(new TwitterDumpApplication(), configuration);
  DAG clonedDAG = lm.cloneDAG();

  assertEquals("Serialization", prepareDAG, clonedDAG);
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:12,代码来源:TwitterDumpApplicationTest.java

示例5: testSomeMethod

import com.datatorrent.api.LocalMode; //导入方法依赖的package包/类
@Test
@Ignore
public void testSomeMethod() throws Exception
{
  Configuration conf = new Configuration(false);
  LocalMode lma = LocalMode.newInstance();

  Application1 application = new Application1();

  application.populateDAG(lma.getDAG(), conf);
  lma.cloneDAG();
  lma.getController().run(60000);
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:14,代码来源:Application1Test.java

示例6: testSplitterInApp

import com.datatorrent.api.LocalMode; //导入方法依赖的package包/类
@Test
public void testSplitterInApp() throws Exception
{
  LocalMode lma = LocalMode.newInstance();
  SplitterApp app = new SplitterApp();
  Configuration appConf = new Configuration();
  appConf.set("dt.operator.Splitter.prop.blocksThreshold", "4");
  lma.prepareDAG(app, appConf);
  lma.cloneDAG(); // check serialization
  LocalMode.Controller lc = lma.getController();
  lc.runAsync();
  app.receiver.latch.await();
  Assert.assertEquals("no. of metadata", 12, app.receiver.count);
  lc.shutdown();
}
 
开发者ID:apache,项目名称:apex-malhar,代码行数:16,代码来源:FileSplitterBaseTest.java

示例7: testApplication

import com.datatorrent.api.LocalMode; //导入方法依赖的package包/类
@Test
public void testApplication() throws Exception
{
  LocalMode lma = LocalMode.newInstance();
  Configuration conf = new Configuration(false);

  lma.prepareDAG(new DeduperApplication(), conf);
  lma.cloneDAG(); // check serialization
  LocalMode.Controller lc = lma.getController();
  lc.setHeartbeatMonitoringEnabled(false);
  lc.run(10000);
}
 
开发者ID:tweise,项目名称:apex-samples,代码行数:13,代码来源:DeduperApplicationTest.java


注:本文中的com.datatorrent.api.LocalMode.cloneDAG方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。