/**
 * Copyright (c) 2012-2012 Malhar, Inc.
 * All rights reserved.
 */
package com.malhartech.demos.performance;

import com.malhartech.dag.ApplicationFactory;
import com.malhartech.dag.Component;
import com.malhartech.dag.DAG;
import com.malhartech.dag.DAG.Operator;
import org.apache.hadoop.conf.Configuration;

/**
 * Example of application configuration in Java.<p>
 */
public class Application implements ApplicationFactory
{
  private static final boolean inline = true;

  @Override
  public DAG getApplication(Configuration conf)
  {
    DAG b = new DAG(conf);

    Operator wordGenerator = b.addOperator("wordGenerator", RandomWordInputModule.class);
//    Operator noOpProcessor = b.addOperator("noOpProcessor", DoNothingModule.class);
    Operator counter = b.addOperator("counter", WordCountModule.class);

//    b.addStream("Generator2Processor", wordGenerator.getOutput(Component.OUTPUT), noOpProcessor.getInput(Component.INPUT)).setInline(inline);
//    b.addStream("Processor2Counter", noOpProcessor.getOutput(Component.OUTPUT), counter.getInput(Component.INPUT)).setInline(inline);

    b.addStream("Generator2Counter", wordGenerator.getOutput(Component.OUTPUT), counter.getInput(Component.INPUT)).setInline(false);
    return b;
  }
}

@@ -262,16 +262,68 @@
 erator;%0A
+import com.malhartech.lib.testbench.DevNullCounter;%0A
 import o
@@ -359,16 +359,16 @@
 ration;%0A
-
 %0A/**%0A * 
@@ -615,17 +615,104 @@
 (conf);%0A
+    b.getConf().setInt(DAG.STRAM_CHECKPOINT_INTERVAL_MILLIS, 0); // disable auto backup
 %0A
-
     Oper
@@ -950,16 +950,88 @@
 .class);
+%0A   //Operator counter = b.addOperator(%22counter%22, DevNullCounter.class);
 %0A%0A//    
@@ -1305,16 +1305,162 @@
 line);%0A%0A
+    //b.addStream(%22Generator2Counter%22, wordGenerator.getOutput(Component.OUTPUT), counter.getInput(DevNullCounter.IPORT_DATA)).setInline(inline);%0A
     b.ad
@@ -1580,12 +1580,13 @@
 ine(
-fals
+inlin
 e);%0A

set inline true by default