예제 #1
0
  @Override
  public void configure() {
    try {
      setName("AppWithStreamSizeSchedule");
      setDescription("Sample application");
      ObjectStores.createObjectStore(getConfigurer(), "input", String.class);
      ObjectStores.createObjectStore(getConfigurer(), "output", String.class);
      addWorkflow(new SampleWorkflow());
      addStream(new Stream("stream"));

      Map<String, String> scheduleProperties = Maps.newHashMap();
      scheduleProperties.put("oneKey", "oneValue");
      scheduleProperties.put("anotherKey", "anotherValue");
      scheduleProperties.put("someKey", "someValue");

      scheduleWorkflow(
          Schedules.createDataSchedule("SampleSchedule1", "", Schedules.Source.STREAM, "stream", 1),
          "SampleWorkflow",
          scheduleProperties);
      scheduleWorkflow(
          Schedules.createDataSchedule("SampleSchedule2", "", Schedules.Source.STREAM, "stream", 2),
          "SampleWorkflow",
          scheduleProperties);
    } catch (UnsupportedTypeException e) {
      throw Throwables.propagate(e);
    }
  }
 @Override
 public void configure() {
   try {
     setName("AppWithMapReduceObjectStore");
     setDescription("Application with MapReduce job using objectstore as dataset");
     createDataset("count", KeyValueTable.class);
     ObjectStores.createObjectStore(getConfigurer(), "keys", String.class);
     addMapReduce(new ComputeCounts());
   } catch (Throwable t) {
     throw Throwables.propagate(t);
   }
 }