K
- Type of keysV
- Type of valuespublic interface KStream<K,V>
Modifier and Type | Method and Description |
---|---|
<T> KTable<K,T> |
aggregateByKey(Initializer<T> initializer,
Aggregator<K,V,T> aggregator,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<T> aggValueSerializer,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<T> aggValueDeserializer,
java.lang.String name)
Aggregate values of this stream by key without a window basis, and hence
return an ever updating table
|
<T,W extends Window> |
aggregateByKey(Initializer<T> initializer,
Aggregator<K,V,T> aggregator,
Windows<W> windows,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<T> aggValueSerializer,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<T> aggValueDeserializer)
Aggregate values of this stream by key on a window basis.
|
KStream<K,V>[] |
branch(Predicate<K,V>... predicates)
Creates an array of streams from this stream.
|
KTable<K,java.lang.Long> |
countByKey(org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<java.lang.Long> aggValueSerializer,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<java.lang.Long> aggValueDeserializer,
java.lang.String name)
Count number of messages of this stream by key without a window basis, and hence
return a ever updating counting table
|
<W extends Window> |
countByKey(Windows<W> windows,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<java.lang.Long> aggValueSerializer,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<java.lang.Long> aggValueDeserializer)
Count number of messages of this stream by key on a window basis.
|
KStream<K,V> |
filter(Predicate<K,V> predicate)
Creates a new instance of KStream consists of all elements of this stream which satisfy a predicate
|
KStream<K,V> |
filterOut(Predicate<K,V> predicate)
Creates a new instance of KStream consists all elements of this stream which do not satisfy a predicate
|
<K1,V1> KStream<K1,V1> |
flatMap(KeyValueMapper<K,V,java.lang.Iterable<KeyValue<K1,V1>>> mapper)
Creates a new instance of KStream by transforming each element in this stream into zero or more elements in the new stream.
|
<V1> KStream<K,V1> |
flatMapValues(ValueMapper<V,java.lang.Iterable<V1>> processor)
Creates a new stream by transforming each value in this stream into zero or more values in the new stream.
|
<V1,R> KStream<K,R> |
join(KStream<K,V1> otherStream,
ValueJoiner<V,V1,R> joiner,
JoinWindows windows,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<V> thisValueSerializer,
org.apache.kafka.common.serialization.Serializer<V1> otherValueSerializer,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V> thisValueDeserializer,
org.apache.kafka.common.serialization.Deserializer<V1> otherValueDeserializer)
Combines values of this stream with another KStream using Windowed Inner Join.
|
<V1,R> KStream<K,R> |
leftJoin(KStream<K,V1> otherStream,
ValueJoiner<V,V1,R> joiner,
JoinWindows windows,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<V1> otherValueSerializer,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V1> otherValueDeserializer)
Combines values of this stream with another KStream using Windowed Left Join.
|
<V1,V2> KStream<K,V2> |
leftJoin(KTable<K,V1> ktable,
ValueJoiner<V,V1,V2> joiner)
Combines values of this stream with KTable using Left Join.
|
<K1,V1> KStream<K1,V1> |
map(KeyValueMapper<K,V,KeyValue<K1,V1>> mapper)
Creates a new instance of KStream by applying transforming each element in this stream into a different element in the new stream.
|
<V1> KStream<K,V1> |
mapValues(ValueMapper<V,V1> mapper)
Creates a new instance of KStream by transforming each value in this stream into a different value in the new stream.
|
<V1,R> KStream<K,R> |
outerJoin(KStream<K,V1> otherStream,
ValueJoiner<V,V1,R> joiner,
JoinWindows windows,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<V> thisValueSerializer,
org.apache.kafka.common.serialization.Serializer<V1> otherValueSerializer,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V> thisValueDeserializer,
org.apache.kafka.common.serialization.Deserializer<V1> otherValueDeserializer)
Combines values of this stream with another KStream using Windowed Outer Join.
|
void |
process(ProcessorSupplier<K,V> processorSupplier,
java.lang.String... stateStoreNames)
Processes all elements in this stream by applying a processor.
|
KTable<K,V> |
reduceByKey(Reducer<V> reducer,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<V> aggValueSerializer,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V> aggValueDeserializer,
java.lang.String name)
Aggregate values of this stream by key on a window basis.
|
<W extends Window> |
reduceByKey(Reducer<V> reducer,
Windows<W> windows,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<V> aggValueSerializer,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V> aggValueDeserializer)
Aggregate values of this stream by key on a window basis.
|
KStream<K,V> |
through(java.lang.String topic)
Sends key-value to a topic, also creates a new instance of KStream from the topic.
|
KStream<K,V> |
through(java.lang.String topic,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<V> valSerializer,
org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V> valDeserializer)
Sends key-value to a topic, also creates a new instance of KStream from the topic.
|
void |
to(java.lang.String topic)
Sends key-value to a topic using default serializers specified in the config.
|
void |
to(java.lang.String topic,
org.apache.kafka.common.serialization.Serializer<K> keySerializer,
org.apache.kafka.common.serialization.Serializer<V> valSerializer)
Sends key-value to a topic.
|
<K1,V1> KStream<K1,V1> |
transform(TransformerSupplier<K,V,KeyValue<K1,V1>> transformerSupplier,
java.lang.String... stateStoreNames)
Applies a stateful transformation to all elements in this stream.
|
<R> KStream<K,R> |
transformValues(ValueTransformerSupplier<V,R> valueTransformerSupplier,
java.lang.String... stateStoreNames)
Applies a stateful transformation to all values in this stream.
|
KStream<K,V> filter(Predicate<K,V> predicate)
predicate
- the instance of PredicateKStream<K,V> filterOut(Predicate<K,V> predicate)
predicate
- the instance of Predicate<K1,V1> KStream<K1,V1> map(KeyValueMapper<K,V,KeyValue<K1,V1>> mapper)
K1
- the key type of the new streamV1
- the value type of the new streammapper
- the instance of KeyValueMapper<V1> KStream<K,V1> mapValues(ValueMapper<V,V1> mapper)
V1
- the value type of the new streammapper
- the instance of ValueMapper<K1,V1> KStream<K1,V1> flatMap(KeyValueMapper<K,V,java.lang.Iterable<KeyValue<K1,V1>>> mapper)
K1
- the key type of the new streamV1
- the value type of the new streammapper
- the instance of KeyValueMapper<V1> KStream<K,V1> flatMapValues(ValueMapper<V,java.lang.Iterable<V1>> processor)
V1
- the value type of the new streamprocessor
- the instance of ProcessorKStream<K,V>[] branch(Predicate<K,V>... predicates)
predicates
- the ordered list of Predicate instancesKStream<K,V> through(java.lang.String topic)
topic
- the topic nameKStream<K,V> through(java.lang.String topic, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<V> valSerializer, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<V> valDeserializer)
topic
- the topic namekeySerializer
- key serializer used to send key-value pairs,
if not specified the default key serializer defined in the configuration will be usedvalSerializer
- value serializer used to send key-value pairs,
if not specified the default value serializer defined in the configuration will be usedkeyDeserializer
- key deserializer used to create the new KStream,
if not specified the default key deserializer defined in the configuration will be usedvalDeserializer
- value deserializer used to create the new KStream,
if not specified the default value deserializer defined in the configuration will be usedvoid to(java.lang.String topic)
topic
- the topic namevoid to(java.lang.String topic, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<V> valSerializer)
topic
- the topic namekeySerializer
- key serializer used to send key-value pairs,
if not specified the default serializer defined in the configs will be usedvalSerializer
- value serializer used to send key-value pairs,
if not specified the default serializer defined in the configs will be used<K1,V1> KStream<K1,V1> transform(TransformerSupplier<K,V,KeyValue<K1,V1>> transformerSupplier, java.lang.String... stateStoreNames)
transformerSupplier
- the class of valueTransformerSupplierstateStoreNames
- the names of the state store used by the processor<R> KStream<K,R> transformValues(ValueTransformerSupplier<V,R> valueTransformerSupplier, java.lang.String... stateStoreNames)
valueTransformerSupplier
- the class of valueTransformerSupplierstateStoreNames
- the names of the state store used by the processorvoid process(ProcessorSupplier<K,V> processorSupplier, java.lang.String... stateStoreNames)
processorSupplier
- the supplier of the Processor to usestateStoreNames
- the names of the state store used by the processor<V1,R> KStream<K,R> join(KStream<K,V1> otherStream, ValueJoiner<V,V1,R> joiner, JoinWindows windows, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<V> thisValueSerializer, org.apache.kafka.common.serialization.Serializer<V1> otherValueSerializer, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<V> thisValueDeserializer, org.apache.kafka.common.serialization.Deserializer<V1> otherValueDeserializer)
V1
- the value type of the other streamR
- the value type of the new streamotherStream
- the instance of KStream joined with this streamjoiner
- ValueJoinerwindows
- the specification of the join windowkeySerializer
- key serializer,
if not specified the default serializer defined in the configs will be usedthisValueSerializer
- value serializer for this stream,
if not specified the default serializer defined in the configs will be usedotherValueSerializer
- value serializer for other stream,
if not specified the default serializer defined in the configs will be usedkeyDeserializer
- key deserializer,
if not specified the default serializer defined in the configs will be usedthisValueDeserializer
- value deserializer for this stream,
if not specified the default serializer defined in the configs will be usedotherValueDeserializer
- value deserializer for other stream,
if not specified the default serializer defined in the configs will be used<V1,R> KStream<K,R> outerJoin(KStream<K,V1> otherStream, ValueJoiner<V,V1,R> joiner, JoinWindows windows, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<V> thisValueSerializer, org.apache.kafka.common.serialization.Serializer<V1> otherValueSerializer, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<V> thisValueDeserializer, org.apache.kafka.common.serialization.Deserializer<V1> otherValueDeserializer)
V1
- the value type of the other streamR
- the value type of the new streamotherStream
- the instance of KStream joined with this streamjoiner
- ValueJoinerwindows
- the specification of the join windowkeySerializer
- key serializer,
if not specified the default serializer defined in the configs will be usedthisValueSerializer
- value serializer for this stream,
if not specified the default serializer defined in the configs will be usedotherValueSerializer
- value serializer for other stream,
if not specified the default serializer defined in the configs will be usedkeyDeserializer
- key deserializer,
if not specified the default serializer defined in the configs will be usedthisValueDeserializer
- value deserializer for this stream,
if not specified the default serializer defined in the configs will be usedotherValueDeserializer
- value deserializer for other stream,
if not specified the default serializer defined in the configs will be used<V1,R> KStream<K,R> leftJoin(KStream<K,V1> otherStream, ValueJoiner<V,V1,R> joiner, JoinWindows windows, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<V1> otherValueSerializer, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<V1> otherValueDeserializer)
V1
- the value type of the other streamR
- the value type of the new streamotherStream
- the instance of KStream joined with this streamjoiner
- ValueJoinerwindows
- the specification of the join windowkeySerializer
- key serializer,
if not specified the default serializer defined in the configs will be usedotherValueSerializer
- value serializer for other stream,
if not specified the default serializer defined in the configs will be usedkeyDeserializer
- key deserializer,
if not specified the default serializer defined in the configs will be usedotherValueDeserializer
- value deserializer for other stream,
if not specified the default serializer defined in the configs will be used<V1,V2> KStream<K,V2> leftJoin(KTable<K,V1> ktable, ValueJoiner<V,V1,V2> joiner)
V1
- the value type of the tableV2
- the value type of the new streamktable
- the instance of KTable joined with this streamjoiner
- ValueJoiner<W extends Window> KTable<Windowed<K>,V> reduceByKey(Reducer<V> reducer, Windows<W> windows, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<V> aggValueSerializer, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<V> aggValueDeserializer)
reducer
- the class of Reducerwindows
- the specification of the aggregation windowKTable<K,V> reduceByKey(Reducer<V> reducer, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<V> aggValueSerializer, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<V> aggValueDeserializer, java.lang.String name)
reducer
- the class of Reducer<T,W extends Window> KTable<Windowed<K>,T> aggregateByKey(Initializer<T> initializer, Aggregator<K,V,T> aggregator, Windows<W> windows, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<T> aggValueSerializer, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<T> aggValueDeserializer)
T
- the value type of the aggregated tableinitializer
- the class of Initializeraggregator
- the class of Aggregatorwindows
- the specification of the aggregation window<T> KTable<K,T> aggregateByKey(Initializer<T> initializer, Aggregator<K,V,T> aggregator, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<T> aggValueSerializer, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<T> aggValueDeserializer, java.lang.String name)
T
- the value type of the aggregated tableinitializer
- the class of Initializeraggregator
- the class of Aggregator<W extends Window> KTable<Windowed<K>,java.lang.Long> countByKey(Windows<W> windows, org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<java.lang.Long> aggValueSerializer, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<java.lang.Long> aggValueDeserializer)
windows
- the specification of the aggregation windowKTable<K,java.lang.Long> countByKey(org.apache.kafka.common.serialization.Serializer<K> keySerializer, org.apache.kafka.common.serialization.Serializer<java.lang.Long> aggValueSerializer, org.apache.kafka.common.serialization.Deserializer<K> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<java.lang.Long> aggValueDeserializer, java.lang.String name)