Search in sources :

Example 1 with ExampleTransformingSystemDescriptor

use of org.apache.samza.system.descriptors.examples.transforming.ExampleTransformingSystemDescriptor in project samza by apache.

the class TestTransformingInputDescriptor method testISDObjectsWithOverrides.

@Test
public void testISDObjectsWithOverrides() {
    ExampleTransformingSystemDescriptor imeTransformingSystem = new ExampleTransformingSystemDescriptor("imeTransformingSystem");
    IntegerSerde streamSerde = new IntegerSerde();
    ExampleTransformingInputDescriptor<Long> overridingISD = imeTransformingSystem.getInputDescriptor("input-stream", streamSerde);
    assertEquals(streamSerde, overridingISD.getSerde());
    assertEquals(imeTransformingSystem.getTransformer().get(), overridingISD.getTransformer().get());
}
Also used : ExampleTransformingSystemDescriptor(org.apache.samza.system.descriptors.examples.transforming.ExampleTransformingSystemDescriptor) IntegerSerde(org.apache.samza.serializers.IntegerSerde) Test(org.junit.Test)

Example 2 with ExampleTransformingSystemDescriptor

use of org.apache.samza.system.descriptors.examples.transforming.ExampleTransformingSystemDescriptor in project samza by apache.

the class TestTransformingInputDescriptor method testAPIUsage.

@Test
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.
    ExampleTransformingSystemDescriptor imeTransformingSystem = new ExampleTransformingSystemDescriptor("imeTransformingSystem").withSystemConfigs(Collections.emptyMap());
    ExampleTransformingInputDescriptor<Long> input1 = imeTransformingSystem.getInputDescriptor("input1", new IntegerSerde());
    ExampleTransformingOutputDescriptor<Integer> output1 = imeTransformingSystem.getOutputDescriptor("output1", new IntegerSerde());
    input1.shouldBootstrap().withOffsetDefault(SystemStreamMetadata.OffsetType.NEWEST).withPriority(1).shouldResetOffset().withStreamConfigs(Collections.emptyMap());
    output1.withStreamConfigs(Collections.emptyMap());
}
Also used : ExampleTransformingSystemDescriptor(org.apache.samza.system.descriptors.examples.transforming.ExampleTransformingSystemDescriptor) IntegerSerde(org.apache.samza.serializers.IntegerSerde) Test(org.junit.Test)

Aggregations

IntegerSerde (org.apache.samza.serializers.IntegerSerde)2 ExampleTransformingSystemDescriptor (org.apache.samza.system.descriptors.examples.transforming.ExampleTransformingSystemDescriptor)2 Test (org.junit.Test)2