Search in sources :

Example 1 with ExampleExpandingSystemDescriptor

use of org.apache.samza.system.descriptors.examples.expanding.ExampleExpandingSystemDescriptor in project samza by apache.

the class TestExpandingInputDescriptor method testISDObjectsWithOverrides.

@Test
public void testISDObjectsWithOverrides() {
    ExampleExpandingSystemDescriptor expandingSystem = new ExampleExpandingSystemDescriptor("expandingSystem");
    IntegerSerde streamSerde = new IntegerSerde();
    ExampleExpandingInputDescriptor<Long> expandingISD = expandingSystem.getInputDescriptor("input-stream", streamSerde);
    assertEquals(streamSerde, expandingISD.getSerde());
    assertEquals(expandingSystem.getTransformer().get(), expandingISD.getTransformer().get());
}
Also used : ExampleExpandingSystemDescriptor(org.apache.samza.system.descriptors.examples.expanding.ExampleExpandingSystemDescriptor) IntegerSerde(org.apache.samza.serializers.IntegerSerde) Test(org.junit.Test)

Example 2 with ExampleExpandingSystemDescriptor

use of org.apache.samza.system.descriptors.examples.expanding.ExampleExpandingSystemDescriptor in project samza by apache.

the class TestExpandingInputDescriptor method testAPIUsage.

public void testAPIUsage() {
    // does not assert anything, but acts as a compile-time check on expected descriptor type parameters
    // and validates that the method calls can be chained.
    ExampleExpandingSystemDescriptor expandingSystem = new ExampleExpandingSystemDescriptor("expandingSystem");
    ExampleExpandingInputDescriptor<Long> input1 = expandingSystem.getInputDescriptor("input1", new IntegerSerde());
    ExampleExpandingOutputDescriptor<Integer> output1 = expandingSystem.getOutputDescriptor("output1", new IntegerSerde());
    input1.shouldBootstrap().withOffsetDefault(SystemStreamMetadata.OffsetType.NEWEST).withPriority(1).shouldResetOffset().withStreamConfigs(Collections.emptyMap());
    output1.withStreamConfigs(Collections.emptyMap());
}
Also used : ExampleExpandingSystemDescriptor(org.apache.samza.system.descriptors.examples.expanding.ExampleExpandingSystemDescriptor) IntegerSerde(org.apache.samza.serializers.IntegerSerde)

Aggregations

IntegerSerde (org.apache.samza.serializers.IntegerSerde)2 ExampleExpandingSystemDescriptor (org.apache.samza.system.descriptors.examples.expanding.ExampleExpandingSystemDescriptor)2 Test (org.junit.Test)1