package DependencyRandomNumber;

import java.util.Random;

import com.continuuity.api.flow.flowlet.SourceFlowlet;
import com.continuuity.api.flow.flowlet.OutputCollector;
import com.continuuity.api.flow.flowlet.StreamsConfigurator;
import com.continuuity.api.flow.flowlet.Tuple;
import com.continuuity.api.flow.flowlet.TupleSchema;
import com.continuuity.api.flow.flowlet.builders.TupleBuilder;
import com.continuuity.api.flow.flowlet.builders.TupleSchemaBuilder;

public class RandomNumberSource extends SourceFlowlet {
  
  private Random random;

  @Override
  public void configure(StreamsConfigurator configurator) {
    TupleSchema out = new TupleSchemaBuilder().
        add("randomNumber", Long.class).
        create();
    configurator.getDefaultTupleOutputStream().setSchema(out);
  }

  @Override
  public void initialize() {
    super.initialize();
    this.random = new Random();
  }
  
  @Override
  public void generate(OutputCollector outputCollector) {
    long randomNumber = Math.abs(this.random.nextLong());
    Tuple randomNumberTuple = new TupleBuilder()
        .set("randomNumber", randomNumber)
        .create();
    outputCollector.add(randomNumberTuple);
  }
}

@@ -52,16 +52,74 @@
 andom;%0A%0A
+import com.continuuity.api.flow.flowlet.FlowletSpecifier;%0A
 import c
@@ -226,69 +226,8 @@
 or;%0A
-import com.continuuity.api.flow.flowlet.StreamsConfigurator;%0A
 impo
@@ -580,39 +580,33 @@
 ure(
-StreamsConfigurator configurato
+FlowletSpecifier specifie
 r) %7B
@@ -721,19 +721,16 @@
     
-configurato
+specifie
 r.ge
@@ -741,25 +741,21 @@
 ault
-Tup
+Flow
 le
+t
 Output
-Stream
 ().s

Fix call to old flowlet API in example