Search in sources :

Example 31 with Stream

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

the class TestFlowStreamIntegrationApp method configure.

@Override
public void configure() {
    setName("TestFlowStreamIntegrationApp");
    setDescription("Application for testing batch stream dequeue");
    addStream(new Stream("s1"));
    addFlow(new StreamTestFlow());
}
Also used : Stream(co.cask.cdap.api.data.stream.Stream)

Example 32 with Stream

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

the class ServiceApp method configure.

@Override
public void configure() {
    setName("ServiceApp");
    setDescription("A program which exposes a simple service");
    addStream(new Stream("who"));
    createDataset("whom", KeyValueTable.class, DatasetProperties.builder().setDescription("Store names").build());
    addService(new Name());
}
Also used : Stream(co.cask.cdap.api.data.stream.Stream)

Example 33 with Stream

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

the class AllProgramsApp method configure.

@Override
public void configure() {
    setName(NAME);
    setDescription("Application which has everything");
    addStream(new Stream(STREAM_NAME, "test stream"));
    createDataset(DATASET_NAME, KeyValueTable.class, DatasetProperties.builder().setDescription("test dataset").build());
    createDataset(DATASET_NAME2, KeyValueTable.class);
    createDataset(DATASET_NAME3, KeyValueTable.class);
    createDataset(DATASET_NAME4, FileSet.class, FileSetProperties.builder().setEnableExploreOnCreate(true).setExploreFormat("text").setExploreFormatProperty("delimiter", "\n").setExploreSchema("record STRING").setDescription("fileSet").build());
    createDataset(DATASET_NAME5, PartitionedFileSet.class, PartitionedFileSetProperties.builder().setEnableExploreOnCreate(true).setExploreFormat("text").setExploreFormatProperty("delimiter", "\n").setExploreSchema("record STRING").setDescription("partitonedFileSet").add("partitioning.fields.", "field1").add("partitioning.field.field1", "STRING").build());
    createDataset(DATASET_NAME6, FileSet.class, FileSetProperties.builder().setEnableExploreOnCreate(false).setDescription("fileSet").build());
    createDataset(DATASET_NAME7, PartitionedFileSet.class, PartitionedFileSetProperties.builder().setEnableExploreOnCreate(false).setDescription("partitonedFileSet").add("partitioning.fields.", "field1").add("partitioning.field.field1", "STRING").build());
    addFlow(new NoOpFlow());
    addMapReduce(new NoOpMR());
    addMapReduce(new NoOpMR2());
    addWorkflow(new NoOpWorkflow());
    addWorker(new NoOpWorker());
    addSpark(new NoOpSpark());
    addService(new NoOpService());
    schedule(buildSchedule(SCHEDULE_NAME, ProgramType.WORKFLOW, NoOpWorkflow.NAME).setDescription(SCHEDULE_DESCRIPTION).triggerByTime("* * * * *"));
    try {
        createDataset(DS_WITH_SCHEMA_NAME, ObjectMappedTable.class, ObjectMappedTableProperties.builder().setType(DsSchema.class).setDescription("test object mapped table").build());
    } catch (UnsupportedTypeException e) {
    // ignore for test
    }
}
Also used : UnsupportedTypeException(co.cask.cdap.api.data.schema.UnsupportedTypeException) Stream(co.cask.cdap.api.data.stream.Stream) InputStream(java.io.InputStream)

Example 34 with Stream

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

the class CrossNsDatasetAccessApp method configure.

@Override
public void configure() {
    setName("WriterApp");
    setDescription("Writes from a stream to DS in another NS");
    addStream(new Stream(STREAM_NAME));
    addFlow(new WhoFlow());
}
Also used : Stream(co.cask.cdap.api.data.stream.Stream)

Example 35 with Stream

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

the class DummyApp method configure.

@Override
public void configure() {
    setName("DummyApp");
    setDescription("DummyApp");
    addStream(new Stream("who"));
    createDataset("whom", KeyValueTable.class);
    addService(new Greeting());
}
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