K
- Type of primary keysV
- Type of value changespublic interface KTable<K,V>
Modifier and Type | Method and Description |
---|---|
<K1,V1,T> KTable<K1,T> |
aggregate(Initializer<T> initializer,
Aggregator<K1,V1,T> add,
Aggregator<K1,V1,T> remove,
KeyValueMapper<K,V,KeyValue<K1,V1>> selector,
org.apache.kafka.common.serialization.Serializer<K1> keySerializer,
org.apache.kafka.common.serialization.Serializer<V1> valueSerializer,
org.apache.kafka.common.serialization.Serializer<T> aggValueSerializer,
org.apache.kafka.common.serialization.Deserializer<K1> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V1> valueDeserializer,
org.apache.kafka.common.serialization.Deserializer<T> aggValueDeserializer,
java.lang.String name)
Aggregate values of this table by the selected key.
|
<K1> KTable<K1,java.lang.Long> |
count(KeyValueMapper<K,V,K1> selector,
org.apache.kafka.common.serialization.Serializer<K1> keySerializer,
org.apache.kafka.common.serialization.Serializer<V> valueSerializer,
org.apache.kafka.common.serialization.Serializer<java.lang.Long> aggValueSerializer,
org.apache.kafka.common.serialization.Deserializer<K1> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V> valueDeserializer,
org.apache.kafka.common.serialization.Deserializer<java.lang.Long> aggValueDeserializer,
java.lang.String name)
Count number of records of this table by the selected key.
|
KTable<K,V> |
filter(Predicate<K,V> predicate)
Creates a new instance of KTable consists of all elements of this stream which satisfy a predicate
|
KTable<K,V> |
filterOut(Predicate<K,V> predicate)
Creates a new instance of KTable consists all elements of this stream which do not satisfy a predicate
|
<V1,R> KTable<K,R> |
join(KTable<K,V1> other,
ValueJoiner<V,V1,R> joiner)
Combines values of this KTable with another KTable using Inner Join.
|
<V1,R> KTable<K,R> |
leftJoin(KTable<K,V1> other,
ValueJoiner<V,V1,R> joiner)
Combines values of this KTable with another KTable using Left Join.
|
<V1> KTable<K,V1> |
mapValues(ValueMapper<V,V1> mapper)
Creates a new instance of KTable by transforming each value in this stream into a different value in the new stream.
|
<V1,R> KTable<K,R> |
outerJoin(KTable<K,V1> other,
ValueJoiner<V,V1,R> joiner)
Combines values of this KTable with another KTable using Outer Join.
|
<K1,V1> KTable<K1,V1> |
reduce(Reducer<V1> addReducer,
Reducer<V1> removeReducer,
KeyValueMapper<K,V,KeyValue<K1,V1>> selector,
org.apache.kafka.common.serialization.Serializer<K1> keySerializer,
org.apache.kafka.common.serialization.Serializer<V1> valueSerializer,
org.apache.kafka.common.serialization.Deserializer<K1> keyDeserializer,
org.apache.kafka.common.serialization.Deserializer<V1> valueDeserializer,
java.lang.String name)
Reduce values of this table by the selected key.
|
KTable<K,V> |
through(java.lang.String topic)
Sends key-value to a topic, also creates a new instance of KTable from the topic.
|
KTable<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 KTable 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.
|
KStream<K,V> |
toStream()
Creates a new instance of KStream from this KTable
|
KTable<K,V> filter(Predicate<K,V> predicate)
predicate
- the instance of PredicateKTable<K,V> filterOut(Predicate<K,V> predicate)
predicate
- the instance of Predicate<V1> KTable<K,V1> mapValues(ValueMapper<V,V1> mapper)
V1
- the value type of the new streammapper
- the instance of ValueMapperKTable<K,V> through(java.lang.String topic)
topic
- the topic nameKTable<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 usedKStream<K,V> toStream()
<V1,R> KTable<K,R> join(KTable<K,V1> other, ValueJoiner<V,V1,R> joiner)
V1
- the value type of the other streamR
- the value type of the new streamother
- the instance of KTable joined with this streamjoiner
- ValueJoiner<V1,R> KTable<K,R> outerJoin(KTable<K,V1> other, ValueJoiner<V,V1,R> joiner)
V1
- the value type of the other streamR
- the value type of the new streamother
- the instance of KTable joined with this streamjoiner
- ValueJoiner<V1,R> KTable<K,R> leftJoin(KTable<K,V1> other, ValueJoiner<V,V1,R> joiner)
V1
- the value type of the other streamR
- the value type of the new streamother
- the instance of KTable joined with this streamjoiner
- ValueJoiner<K1,V1> KTable<K1,V1> reduce(Reducer<V1> addReducer, Reducer<V1> removeReducer, KeyValueMapper<K,V,KeyValue<K1,V1>> selector, org.apache.kafka.common.serialization.Serializer<K1> keySerializer, org.apache.kafka.common.serialization.Serializer<V1> valueSerializer, org.apache.kafka.common.serialization.Deserializer<K1> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<V1> valueDeserializer, java.lang.String name)
K1
- the key type of the aggregated tableV1
- the value type of the aggregated tableaddReducer
- the class of ReducerremoveReducer
- the class of Reducerselector
- the KeyValue mapper that select the aggregate keyname
- the name of the resulted table<K1,V1,T> KTable<K1,T> aggregate(Initializer<T> initializer, Aggregator<K1,V1,T> add, Aggregator<K1,V1,T> remove, KeyValueMapper<K,V,KeyValue<K1,V1>> selector, org.apache.kafka.common.serialization.Serializer<K1> keySerializer, org.apache.kafka.common.serialization.Serializer<V1> valueSerializer, org.apache.kafka.common.serialization.Serializer<T> aggValueSerializer, org.apache.kafka.common.serialization.Deserializer<K1> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<V1> valueDeserializer, org.apache.kafka.common.serialization.Deserializer<T> aggValueDeserializer, java.lang.String name)
K1
- the key type of the aggregated tableV1
- the value type of the aggregated tableinitializer
- the class of Initializeradd
- the class of Aggregatorremove
- the class of Aggregatorselector
- the KeyValue mapper that select the aggregate keyname
- the name of the resulted table<K1> KTable<K1,java.lang.Long> count(KeyValueMapper<K,V,K1> selector, org.apache.kafka.common.serialization.Serializer<K1> keySerializer, org.apache.kafka.common.serialization.Serializer<V> valueSerializer, org.apache.kafka.common.serialization.Serializer<java.lang.Long> aggValueSerializer, org.apache.kafka.common.serialization.Deserializer<K1> keyDeserializer, org.apache.kafka.common.serialization.Deserializer<V> valueDeserializer, org.apache.kafka.common.serialization.Deserializer<java.lang.Long> aggValueDeserializer, java.lang.String name)
K1
- the key type of the aggregated tableselector
- the KeyValue mapper that select the aggregate keyname
- the name of the resulted table