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());
}
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());
}
Aggregations