...
Code Block | ||||
---|---|---|---|---|
| ||||
package org.apache.kafka.streams.processor.assignment; /** * A simple container class for the assignor to return the desired placement of active and standby tasks on KafkaStreams clients */ public class KafkaStreamsAssignment { /* * Construct an instance of KafkaStreamsAssignment with this processId and the given set of * assigned tasks. If you want this KafkaStreams client to request a followup rebalance, you * can set the followupRebalanceDeadline via the {@link #withFollowupRebalance(Instant)} API. * * @param processId the processId for the KafkaStreams client that should receive this assignment * @param assignment the set of tasks to be assigned to this KafkaStreams client * * @return a new KafkaStreamsAssignment object with the given processId and assignment */ public static KafkaStreamsAssignment of(final ProcessId processId, final Set<AssignedTask> assignment); /** * This API can be used to request that a followup rebalance be triggered by the KafkaStreams client * receiving this assignment. The followup rebalance will be initiated after the provided deadline * has passed, although it will always wait until it has finished the current rebalance before * triggering a new one. This request will last until the new rebalance, and will be erased if a * new rebalance begins before the scheduled followup rebalance deadline has elapsed. The next * assignment must request the followup rebalance again if it still wants to schedule one for * the given instant, otherwise no additional rebalance will be triggered after that. * * @param rebalanceDeadline the instant after which this KafkaStreams client will trigger a followup rebalance * * @return a new KafkaStreamsAssignment object with the same processId and assignment but with the given rebalanceDeadline */ public KafkaStreamsAssignment withFollowupRebalance(final Instant rebalanceDeadline); public ProcessID processId(); public Set<AssignedTask> assignmenttasks(); /** * @return the actual deadline in objective time, after which the followup rebalance will be attempted. * Equivalent to {@code 'now + followupRebalanceDelay'} */ public Instant followupRebalanceDeadline(); public static class AssignedTask { public AssignedTask(final TaskId id, final Type taskType); enum Type { ACTIVE, STANDBY } public Type type(); public TaskId id(); } } |
...