use of org.apache.samza.application.descriptors.TaskApplicationDescriptor in project samza by apache.
the class MyStatefulApplication method describe.
@Override
public void describe(TaskApplicationDescriptor appDescriptor) {
KafkaSystemDescriptor ksd = new KafkaSystemDescriptor(inputSystem);
KVSerde<String, String> serde = KVSerde.of(new StringSerde(), new StringSerde());
KafkaInputDescriptor<KV<String, String>> isd = ksd.getInputDescriptor(inputTopic, serde);
TaskApplicationDescriptor desc = appDescriptor.withInputStream(isd).withTaskFactory((StreamTaskFactory) () -> new MyTask(storeToChangelog.keySet()));
storeToChangelog.forEach((storeName, changelogTopic) -> {
RocksDbTableDescriptor<String, String> td = new RocksDbTableDescriptor<>(storeName, serde).withChangelogStream(changelogTopic).withChangelogReplicationFactor(1);
desc.withTable(td);
});
}
Aggregations