Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add verbose parameter to remove-disks endpoint valid parameter list #2106

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static com.linkedin.kafka.cruisecontrol.servlet.parameters.ParameterUtils.REASON_PARAM;
import static com.linkedin.kafka.cruisecontrol.servlet.parameters.ParameterUtils.STOP_ONGOING_EXECUTION_PARAM;
import static com.linkedin.kafka.cruisecontrol.servlet.parameters.ParameterUtils.JSON_PARAM;
import static com.linkedin.kafka.cruisecontrol.servlet.parameters.ParameterUtils.VERBOSE_PARAM;

public class RemoveDisksParameters extends GoalBasedOptimizationParameters {
protected static final SortedSet<String> CASE_INSENSITIVE_PARAMETER_NAMES;
Expand All @@ -26,12 +27,14 @@ public class RemoveDisksParameters extends GoalBasedOptimizationParameters {
validParameterNames.add(BROKER_ID_AND_LOGDIRS_PARAM);
validParameterNames.add(DRY_RUN_PARAM);
validParameterNames.add(REASON_PARAM);
validParameterNames.add(VERBOSE_PARAM);
validParameterNames.add(STOP_ONGOING_EXECUTION_PARAM);
validParameterNames.add(JSON_PARAM);
CASE_INSENSITIVE_PARAMETER_NAMES = Collections.unmodifiableSortedSet(validParameterNames);
}
private boolean _dryRun;
private String _reason;
private boolean _verbose;
private boolean _stopOngoingExecution;
private Map<Integer, Set<String>> _logdirByBrokerId;

Expand All @@ -44,6 +47,7 @@ protected void initParameters() throws UnsupportedEncodingException {
super.initParameters();
_logdirByBrokerId = ParameterUtils.brokerIdAndLogdirs(_requestContext);
_dryRun = ParameterUtils.getDryRun(_requestContext);
_verbose = ParameterUtils.isVerbose(_requestContext);
boolean requestReasonRequired = _config.getBoolean(ExecutorConfig.REQUEST_REASON_REQUIRED_CONFIG);
_reason = ParameterUtils.reason(_requestContext, requestReasonRequired && !_dryRun);
_stopOngoingExecution = ParameterUtils.stopOngoingExecution(_requestContext);
Expand All @@ -68,6 +72,9 @@ public SortedSet<String> caseInsensitiveParameterNames() {
public String reason() {
return _reason;
}
public boolean verbose() {
return super.isVerbose();
}
public boolean dryRun() {
return _dryRun;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ RemoveDisksEndpoint:
schema:
type: boolean
default: false
- name: verbose
in: query
description: Return detailed state information.
schema:
type: boolean
default: false
- name: reason
in: query
description: Reason for request.
Expand Down