jackdaw.admin

Tools for administering or just interacting with a Kafka cluster.

Wraps the `AdminClient` API, replacing the Scala admin APIs.

Like the underlying `AdminClient` API, this namespace is subject to
change and should be considered of alpha stability.

alter-topic-config!

(alter-topic-config! client topics)
Given an `AdminClient` and a sequence of topic descriptors having
`:topic-config`, alters the live configuration of the specified
topics to correspond to the specified `:topic-config`.

Client

protocol

members

alter-topics*

(alter-topics* this topics)

create-topics*

(create-topics* this topics)

delete-topics*

(delete-topics* this topics)

describe-cluster*

(describe-cluster* this)

describe-configs*

(describe-configs* this configs)

describe-topics*

(describe-topics* this topics)

list-topics*

(list-topics* this)

client-impl

client?

(client? x)
Predicate.

Return `true` if and only if given an `AdminClient` instance.

create-topics!

(create-topics! client topics)
Given an `AdminClient` and a collection of topic descriptors,
create the specified topics with their configuration(s).

Does not block until the created topics are ready. It may take some
time for replicas and leaders to be chosen for newly created
topics.

See `#'topics-ready?`, `#'topic-exists?` and `#'retry-exists?` for
tools with which to wait for topics to be ready.

delete-topics!

(delete-topics! client topics)
Given an `AdminClient` and a sequence of topic descriptors, marks the
topics for deletion.

Does not block until the topics are deleted, just until the deletion
request(s) are acknowledged.

describe-cluster

(describe-cluster client)
Returns a `DescribeClusterResult` describing the cluster.

describe-topics

(describe-topics client)(describe-topics client topics)
Given an `AdminClient` and an optional collection of topic
descriptors, return a map from topic names to topic
descriptions.

If no topics are provided, describes all topics.

Note that the topic description does NOT include the topic's
configuration.See `#'describe-topic-config` for that capability.

describe-topics-configs

(describe-topics-configs client topics)
Given an `AdminClient` and a collection of topic descriptors, returns
the selected topics' live configuration as a map from topic names to
configured properties to metadata about each property including its
current value.

get-broker-config

(get-broker-config client broker-id)
Returns the broker config as a map.

Broker-id is an int, typically 0-2, get the list of valid broker ids
using describe-cluster

list-topics

(list-topics client)
Given an `AdminClient`, return a seq of topic records, being the
topics on the cluster.

partition-ids-of-topics

(partition-ids-of-topics client)(partition-ids-of-topics client topics)
Given an `AdminClient` and an optional sequence of topics, produces a
mapping from topic names to a sequence of the partition IDs for that
topic.

By default, enumerates the partition IDs for all topics.

retry-exists?

(retry-exists? client topic num-retries wait-ms)
Returns `true` if topic exists. Otherwise spins as configured.

topic-exists?

(topic-exists? client {:keys [topic-name], :as topic})
Verifies the existence of the topic.

Does not verify any config. details or values.

topics-ready?

(topics-ready? client topics)
Given an `AdminClient` and a sequence topic descriptors, return
`true` if and only if all listed topics have a leader and in-sync
replicas.

This can be used to determine if some set of newly created topics
are healthy yet, or detect whether leader re-election has finished
following the demise of a Kafka broker.