...
Use case | command | AdminClient |
---|---|---|
Increase partition count | kafka-topics --alter --topic T --partitions P | alterPartitionCount() |
Change replication factor | kafka-reassign-partitions --execute --reassignment-json-file J |
|
Change partition assignment | kafka-reassign-partitions --execute --reassignment-json-file J | reassignPartitions() |
Change partition assignment with throttle | kafka-reassign-partitions --execute --reassignment-json-file J --throttle R |
|
Change throttled rate | kafka-reassign-partitions --execute --reassignment-json-file J --throttle R |
|
Check progress of a reassignment | kafka-reassign-partitions --progress --reassignment-json-file J | describeReplicaDir (see KIP-113) |
Check result and clear throttle | kafka-reassign-partitions --verify --reassignment-json-file J |
|
...
The implementation of --progress
will make use of the describeReplicaDirthe
method from KIP-113 to find the lag of the syncing replica.describeReplicaLogDirs
()
...
- This API is asynchronous in the sense that the client cannot assume that the request is complete (or the request was rejected) once they have obtained the result for the topic from the
ReassignPartitionsResult
. - The describeReplicaDirThe
method from KIP-113 can be used to determine progress.describeReplicaLogDirs
() A call to
reassignPartitions()
with thevalidateOnly
option can be used to determine whether a reassignment is currently running, and therefore whether the last reassignment has finished.- When the request is complete the throttle should be removed by a call or calls to
alterInterBrokerThrottle()
...