DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
We have the RemoteClusterUtils API to enable users to perform some operations of their MirrorMaker environment. One method, translateOffsets(), allows to manually translate consumer offsets. This is useful when MirrorCheckpointConnector is not configured to automatically sync offsets or when dealing with a disaster and unplanned failover. This method works by fully reading the checkpoints topic which is populated by MirrorCheckpointConnector, so this can be an expensive call and take a long time if the topic is large. This method takes a single consumer group id as input, so it makes it unusable unsuitable in cases when the offsets of several consumer groups have to be translated as each call re-reads the full topic.
Since the full topic is read anyway, we should have a method to translate offsets the committed offsets of multiple consumer groups at a time.
Public Interfaces
...
| Code Block | ||
|---|---|---|
| ||
/** * Translates remote consumer groups' offsets into corresponding local offsets. Topics are automatically * renamed according to the ReplicationPolicy. * @param consumerGroupIds The remotelist of consumer group Ids * @param remoteClusterAlias The alias of remote cluster * @param timeout The maximum time to block when consuming from the checkpoints topic */ public Map<String, Map<TopicPartition, OffsetAndMetadata>> remoteConsumerOffsets(Set<String> consumerGroupIds, String remoteClusterAlias, Duration timeout) { } |
...
The new methods will be tested using unit tests. This will require some refactoring in MirrorClient to make the remoteConsumerOffsets() method testable (we currently don't have tests for that method).
Rejected Alternatives
- Deprecate the existing RemoteClusterUtils.translateOffsets() and MirrorClient.remoteConsumerOffsets() methods: Internally these will use the same logic as the new methods, so we can keep them.