-
Notifications
You must be signed in to change notification settings - Fork 596
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new endpoint to support increasing topic's replication factor. (#…
…710)
- Loading branch information
kun du
authored
May 21, 2019
1 parent
932805f
commit d4638c5
Showing
10 changed files
with
378 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...rc/main/java/com/linkedin/kafka/cruisecontrol/async/UpdateTopicConfigurationRunnable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2019 LinkedIn Corp. Licensed under the BSD 2-Clause License (the "License"). See License in the project root for license information. | ||
*/ | ||
|
||
package com.linkedin.kafka.cruisecontrol.async; | ||
|
||
import com.linkedin.kafka.cruisecontrol.KafkaCruiseControl; | ||
import com.linkedin.kafka.cruisecontrol.config.KafkaCruiseControlConfig; | ||
import com.linkedin.kafka.cruisecontrol.servlet.parameters.TopicConfigurationParameters; | ||
import com.linkedin.kafka.cruisecontrol.servlet.response.TopicConfigurationResult; | ||
import java.util.regex.Pattern; | ||
|
||
/** | ||
* The async runnable for {@link KafkaCruiseControl#updateTopicConfiguration(Pattern, short, boolean, String)} | ||
*/ | ||
public class UpdateTopicConfigurationRunnable extends OperationRunnable { | ||
private final Pattern _topic; | ||
private final short _replicationFactor; | ||
private final boolean _skipRackAwarenessCheck; | ||
private final String _uuid; | ||
private final KafkaCruiseControlConfig _config; | ||
|
||
UpdateTopicConfigurationRunnable(KafkaCruiseControl kafkaCruiseControl, | ||
OperationFuture future, | ||
String uuid, | ||
TopicConfigurationParameters parameters, | ||
KafkaCruiseControlConfig config) { | ||
super(kafkaCruiseControl, future); | ||
_uuid = uuid; | ||
_topic = parameters.topic(); | ||
_replicationFactor = parameters.replicationFactor(); | ||
_skipRackAwarenessCheck = parameters.skipRackAwarenessCheck(); | ||
_config = config; | ||
} | ||
|
||
@Override | ||
protected TopicConfigurationResult getResult() { | ||
return new TopicConfigurationResult(_kafkaCruiseControl.updateTopicConfiguration(_topic, | ||
_replicationFactor, | ||
_skipRackAwarenessCheck, | ||
_uuid), | ||
_replicationFactor, | ||
_config); | ||
} | ||
} |
Oops, something went wrong.