kafka streams - power without weight (jeeconf)

64

Upload: -

Post on 21-Jan-2018

466 views

Category:

Presentations & Public Speaking


1 download

TRANSCRIPT

Page 1: Kafka streams - power without weight (jeeconf)
Page 2: Kafka streams - power without weight (jeeconf)
Page 3: Kafka streams - power without weight (jeeconf)
Page 4: Kafka streams - power without weight (jeeconf)
Page 5: Kafka streams - power without weight (jeeconf)
Page 6: Kafka streams - power without weight (jeeconf)
Page 7: Kafka streams - power without weight (jeeconf)
Page 8: Kafka streams - power without weight (jeeconf)
Page 9: Kafka streams - power without weight (jeeconf)
Page 10: Kafka streams - power without weight (jeeconf)
Page 11: Kafka streams - power without weight (jeeconf)
Page 12: Kafka streams - power without weight (jeeconf)
Page 13: Kafka streams - power without weight (jeeconf)
Page 14: Kafka streams - power without weight (jeeconf)
Page 15: Kafka streams - power without weight (jeeconf)
Page 16: Kafka streams - power without weight (jeeconf)
Page 17: Kafka streams - power without weight (jeeconf)
Page 18: Kafka streams - power without weight (jeeconf)
Page 19: Kafka streams - power without weight (jeeconf)
Page 20: Kafka streams - power without weight (jeeconf)
Page 21: Kafka streams - power without weight (jeeconf)
Page 22: Kafka streams - power without weight (jeeconf)
Page 23: Kafka streams - power without weight (jeeconf)
Page 24: Kafka streams - power without weight (jeeconf)
Page 25: Kafka streams - power without weight (jeeconf)
Page 26: Kafka streams - power without weight (jeeconf)

KStreamBuilder builder =new KStreamBuilder();

Page 27: Kafka streams - power without weight (jeeconf)

KStreamBuilder builder =new KStreamBuilder();

KStream<String, String> textLines = builder.stream(inputTopic);

Page 28: Kafka streams - power without weight (jeeconf)

KStreamBuilder builder =new KStreamBuilder();

KStream<String, String> textLines = builder.stream(inputTopic);

KTable<String, Long> wordCounts = textLines.flatMapValues(value -> toWords(value)).groupBy((key, word) -> word).count("Counts");

Page 29: Kafka streams - power without weight (jeeconf)

KStreamBuilder builder =new KStreamBuilder();

KStream<String, String> textLines = builder.stream(inputTopic);

KTable<String, Long> wordCounts = textLines.flatMapValues(value -> toWords(value)).groupBy((key, word) -> word).count("Counts");

wordCounts.toStream().to(outputTopic);

Page 30: Kafka streams - power without weight (jeeconf)
Page 31: Kafka streams - power without weight (jeeconf)
Page 32: Kafka streams - power without weight (jeeconf)
Page 33: Kafka streams - power without weight (jeeconf)
Page 34: Kafka streams - power without weight (jeeconf)
Page 35: Kafka streams - power without weight (jeeconf)

KStreamBuilder builder = new KStreamBuilder();

Page 36: Kafka streams - power without weight (jeeconf)

KStreamBuilder builder = new KStreamBuilder();

StateStoreSupplier store = Stores.create(”Store").persistent().build();

Page 37: Kafka streams - power without weight (jeeconf)

KStreamBuilder builder = new KStreamBuilder();

builder.addSource("SOURCE", inputTopic)

Page 38: Kafka streams - power without weight (jeeconf)

KStreamBuilder builder = new KStreamBuilder();

builder.addSource("SOURCE", inputTopic)

.addProcessor("WORDS_COUNT",new ProcessorSupplier(store.name()),

@Override public void process(byte[] key, String value) {Optional<Long> count =

Optional.ofNullable(stateStore.get(value));Long incrementedCount = count.orElse(0L) + 1;stateStore.put(value, incrementedCount);processorContext.forward(value, incrementedCount);processorContext.commit();

}

Page 39: Kafka streams - power without weight (jeeconf)

KStreamBuilder builder = new KStreamBuilder();

builder.addSource("SOURCE", inputTopic)

.addProcessor("WORDS_COUNT",new ProcessorSupplier(store.name()),

.addStateStore(wordCountsStore, "WORDS_COUNT")

Page 40: Kafka streams - power without weight (jeeconf)

KStreamBuilder builder = new KStreamBuilder();

builder.addSource("SOURCE", inputTopic)

.addProcessor("WORDS_COUNT",new ProcessorSupplier(store.name()),

.addStateStore(wordCountsStore, "WORDS_COUNT")

.addSink("OUTPUT", outputTopic, "WORDS_COUNT");

Page 41: Kafka streams - power without weight (jeeconf)

•elasticity and scalability

Page 42: Kafka streams - power without weight (jeeconf)
Page 43: Kafka streams - power without weight (jeeconf)
Page 44: Kafka streams - power without weight (jeeconf)
Page 45: Kafka streams - power without weight (jeeconf)

•Local/Remote state in stream processing

Page 46: Kafka streams - power without weight (jeeconf)
Page 47: Kafka streams - power without weight (jeeconf)
Page 48: Kafka streams - power without weight (jeeconf)
Page 49: Kafka streams - power without weight (jeeconf)
Page 50: Kafka streams - power without weight (jeeconf)
Page 51: Kafka streams - power without weight (jeeconf)
Page 52: Kafka streams - power without weight (jeeconf)
Page 53: Kafka streams - power without weight (jeeconf)
Page 54: Kafka streams - power without weight (jeeconf)
Page 55: Kafka streams - power without weight (jeeconf)
Page 56: Kafka streams - power without weight (jeeconf)
Page 57: Kafka streams - power without weight (jeeconf)
Page 58: Kafka streams - power without weight (jeeconf)
Page 59: Kafka streams - power without weight (jeeconf)
Page 60: Kafka streams - power without weight (jeeconf)
Page 61: Kafka streams - power without weight (jeeconf)
Page 62: Kafka streams - power without weight (jeeconf)
Page 63: Kafka streams - power without weight (jeeconf)
Page 64: Kafka streams - power without weight (jeeconf)