本文整理汇总了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();
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}