jackdaw.streams.protocols

Kafka streams protocols.

IGlobalKTable

protocol

members

global-ktable*

(global-ktable* globalktable)
Returns the underlying GlobalKTable

IKGroupedBase

protocol

Methods shared between `IKGroupedTable` and `IKGroupedStream`.

members

aggregate

(aggregate kgrouped initializer-fn adder-fn subtractor-fn topic-config)(aggregate kgrouped initializer-fn aggregator-fn topic-config)
Aggregates values by key into a new KTable.

count

(count kgrouped)(count kgrouped topic-config)
Counts the number of records by key into a new KTable.

reduce

(reduce kgrouped adder-fn subtractor-fn topic-config)(reduce kgrouped reducer-fn topic-config)
Combines values of a stream by key into a new KTable.

IKGroupedStream

protocol

KGroupedStream is an abstraction of a grouped stream.

members

kgroupedstream*

(kgroupedstream* kgroupedstream)
Returns the underlying KGroupedStream object.

windowed-by-session

(windowed-by-session kgroupedstream window)

windowed-by-time

(windowed-by-time kgroupedstream window)

IKGroupedTable

protocol

KGroupedTable is an abstraction of a grouped changelog stream.

members

kgroupedtable*

(kgroupedtable* kgroupedtable)
Returns the underlying KGroupedTable object.

IKStream

protocol

A KStream is an abstraction of a stream of key-value pairs.

members

branch

(branch kstream predicate-fns)
Returns a list of KStreams, one for each of the `predicate-fns`
provided.

flat-map

(flat-map kstream key-value-mapper-fn)
Creates a KStream that will consist of the concatenation of messages
returned by calling `key-value-mapper-fn` on each key/value pair in the
input stream.

flat-map-values

(flat-map-values kstream value-mapper-fn)
Creates a KStream that will consist of the concatenation of the values
returned by calling `value-mapper-fn` on each value in the input stream.

for-each!

(for-each! kstream foreach-fn)
Performs an action on each element of KStream.

group-by-key

(group-by-key kstream)(group-by-key kstream topic-config)
Groups records with the same key into a KGroupedStream.

join-global

(join-global kstream global-ktable kv-mapper joiner)

join-windowed

(join-windowed kstream other-kstream value-joiner-fn windows)(join-windowed kstream other-kstream value-joiner-fn windows this-topic-config other-topic-config)
Combines the values of two streams that share the same key using a
windowed inner join.

kstream*

(kstream* kstream)
Returns the underlying KStream object.

left-join-global

(left-join-global kstream global-ktable kv-mapper joiner)

left-join-windowed

(left-join-windowed kstream other-kstream value-joiner-fn windows)(left-join-windowed kstream other-kstream value-joiner-fn windows this-topic-config other-topic-config)
Combines the values of two streams that share the same key using a
windowed left join.

map

(map kstream key-value-mapper-fn)
Creates a KStream that consists of the result of applying
`key-value-mapper-fn` to each key/value pair in the input stream.

merge

(merge kstream other)
Creates a KStream that has the records from both streams.

outer-join-windowed

(outer-join-windowed kstream other-kstream value-joiner-fn windows)(outer-join-windowed kstream other-kstream value-joiner-fn windows this-topic-config other-topic-config)
Combines the values of two streams that share the same key using a
windowed outer join.

print!

(print! kstream)
Prints the elements of the stream to *out*.

process!

(process! kstream processor-fn state-store-names)
Applies `processor-fn` to each item in the input stream.

select-key

(select-key kstream select-key-value-mapper-fn)
Create a new key from the current key and value.

`select-key-value-mapper-fn` should be a function that takes a key-value
pair, and returns the value of the new key. Here is example multiplies each
key by 10:

```(fn [[k v]] (* 10 k))```

through

(through kstream topic-config)
Materializes a stream to a topic, and returns a new KStream that will
consume messages from the topic.

to!

(to! kstream topic-config)
Materializes a stream to a topic.

transform

(transform kstream transformer-supplier-fn)(transform kstream transformer-supplier-fn state-store-names)
Creates a KStream that consists of the results of applying the transformer
to each key/value in the input stream.

transform-values

(transform-values kstream value-transformer-supplier-fn)(transform-values kstream value-transformer-supplier-fn state-store-names)
Creates a KStream that consists of the results of applying the transformer
to each value in the input stream.

IKStreamBase

protocol

Methods common to KStream and KTable.

members

filter

(filter kstream-or-ktable predicate-fn)
Creates a KStream that consists of all elements that satisfy a
predicate.

filter-not

(filter-not kstream-or-ktable predicate-fn)
Creates a KStream that consists of all elements that do not satisfy a
predicate.

group-by

(group-by ktable-or-ktable key-value-mapper-fn)(group-by ktable-or-ktable key-value-mapper-fn topic-config)
Groups the records of this KStream/KTable using the key-value-mapper-fn.

left-join

(left-join kstream-or-ktable ktable value-joiner-fn)(left-join kstream-or-ktable ktable value-joiner-fn this-topic-config other-topic-config)
Creates a KStream from the result of calling `value-joiner-fn` with
each element in the KStream and the value in the KTable with the same
key.

map-values

(map-values kstream-or-ktable value-mapper-fn)
Creates a KStream that is the result of calling `value-mapper-fn` on each
element of the input stream.

peek

(peek kstream-or-ktable peek-fn)
Performs `peek-fn` on each element of the input stream.

write-as-text!

(write-as-text! kstream-or-ktable file-path)(write-as-text! kstream-or-ktable file-path topic-config)
Writes the elements of a stream to a file at the given path.

IKTable

protocol

A Ktable is an abstraction of a changlog stream.

members

join

(join ktable other-ktable value-joiner-fn)
Combines the values of the two KTables that share the same key using an
inner join.

ktable*

(ktable* ktable)
Returns the underlying KTable object.

outer-join

(outer-join ktable other-ktable value-joiner-fn)
Combines the values of two KTables that share the same key using an outer
join.

to-kstream

(to-kstream ktable)(to-kstream ktable key-value-mapper-fn)
Converts a KTable to a KStream.

ISessionWindowedKStream

protocol

ISessionWindowedKStream is an abstraction of a session windowed stream.

members

session-windowed-kstream*

(session-windowed-kstream* ksession-windowed-kstream)
Returns the underlying SessionWindowedKStream object.

IStreamsBuilder

protocol

members

global-ktable

(global-ktable topology-builder topic-config)
Creates a GlobalKTable that will consist of data from the specified
topic.

kstream

(kstream topology-builder topic-config)(kstream topology-builder topic-config topic-pattern)
Creates a KStream that will consume messages from the specified topic.

kstreams

(kstreams topology-builder topic-configs)
Creates a KStream that will consume messages from the specified topics.

ktable

(ktable topology-builder topic-config)(ktable topology-builder topic-config store-name)
Creates a KTable that will consist of data from the specified topic.

source-topics

(source-topics topology-builder)
Gets the names of source topics for the topology.

streams-builder*

(streams-builder* streams-builder)
Returns the underlying KStreamBuilder.

ITimeWindowedKStream

protocol

ITimeWindowedKStream is an abstraction of a time windowed stream.

members

time-windowed-kstream*

(time-windowed-kstream* ktime-windowed-kstream)
Returns the underlying TimeWindowedKStream object.