Search in sources :

Example 36 with Stream

use of co.cask.cdap.api.data.stream.Stream in project cdap by caskdata.

the class BundleJarApp method configure.

@Override
public void configure() {
    setName("BundleJarApp");
    setDescription("Demonstrates usage of bundle jar applications");
    addStream(new Stream("simpleInputStream"));
    createDataset("simpleInputDataset", KeyValueTable.class);
    createDataset("simpleOutputDataset", KeyValueTable.class);
    addFlow(new SimpleFlow());
    addService(new BasicService("SimpleGetOutput", new SimpleGetOutput()));
    addService(new BasicService("SimpleGetInput", new SimpleGetInput()));
    addService(new BasicService("PrintService", new PrintHandler()));
    addMapReduce(new SimpleMapReduce());
}
Also used : BasicService(co.cask.cdap.api.service.BasicService) Stream(co.cask.cdap.api.data.stream.Stream)

Example 37 with Stream

use of co.cask.cdap.api.data.stream.Stream in project cdap by caskdata.

the class AppWithStreamSizeSchedule method configure.

@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"));
        scheduleWorkflow(Schedules.builder("SampleSchedule1").createDataSchedule(Schedules.Source.STREAM, "stream", 1), "SampleWorkflow", SCHEDULE_PROPS);
        scheduleWorkflow(Schedules.builder("SampleSchedule2").createDataSchedule(Schedules.Source.STREAM, "stream", 2), "SampleWorkflow", SCHEDULE_PROPS);
    } catch (UnsupportedTypeException e) {
        throw Throwables.propagate(e);
    }
}
Also used : UnsupportedTypeException(co.cask.cdap.api.data.schema.UnsupportedTypeException) Stream(co.cask.cdap.api.data.stream.Stream)

Example 38 with Stream

use of co.cask.cdap.api.data.stream.Stream in project cdap by caskdata.

the class AppWithWorkflow method configure.

@Override
public void configure() {
    try {
        setName(NAME);
        setDescription("Sample application");
        addStream(new Stream("stream"));
        ObjectStores.createObjectStore(getConfigurer(), "input", String.class);
        ObjectStores.createObjectStore(getConfigurer(), "output", String.class);
        addMapReduce(new WordCountMapReduce());
        addWorkflow(new SampleWorkflow());
    } catch (UnsupportedTypeException e) {
        throw Throwables.propagate(e);
    }
}
Also used : UnsupportedTypeException(co.cask.cdap.api.data.schema.UnsupportedTypeException) Stream(co.cask.cdap.api.data.stream.Stream)

Example 39 with Stream

use of co.cask.cdap.api.data.stream.Stream in project cdap by caskdata.

the class BloatedWordCountApp method configure.

@Override
public void configure() {
    setName("WordCountApp");
    setDescription("Application for counting words");
    addStream(new Stream("text"));
    createDataset("mydataset", KeyValueTable.class);
    addFlow(new WordCountFlow());
    addMapReduce(new VoidMapReduceJob());
    addService(new WordFrequencyService());
    addSpark(new SparklingNothing());
    addWorker(new LazyGuy());
    addWorkflow(new SingleStep());
}
Also used : Stream(co.cask.cdap.api.data.stream.Stream)

Example 40 with Stream

use of co.cask.cdap.api.data.stream.Stream in project cdap by caskdata.

the class WordCountApp method configure.

@Override
public void configure() {
    setName("WordCountApp");
    setDescription("Application for counting words");
    addStream(new Stream("text"));
    createDataset("mydataset", KeyValueTable.class);
    addFlow(new WordCountFlow());
    addService(new WordFrequencyService());
    addMapReduce(new VoidMapReduceJob());
}
Also used : Stream(co.cask.cdap.api.data.stream.Stream)

Aggregations

Stream (co.cask.cdap.api.data.stream.Stream)48 UnsupportedTypeException (co.cask.cdap.api.data.schema.UnsupportedTypeException)10 BasicService (co.cask.cdap.api.service.BasicService)6 InputStream (java.io.InputStream)2 Schema (co.cask.cdap.api.data.schema.Schema)1 KeyValueTable (co.cask.cdap.api.dataset.lib.KeyValueTable)1 Table (co.cask.cdap.api.dataset.table.Table)1 AvroKeyOutputFormat (org.apache.avro.mapreduce.AvroKeyOutputFormat)1 TextOutputFormat (org.apache.hadoop.mapreduce.lib.output.TextOutputFormat)1