MarkGaox commented on code in PR #2687:
URL: https://github.com/apache/helix/pull/2687#discussion_r1380628022
##########
helix-rest/src/main/java/org/apache/helix/rest/clusterMaintenanceService/MaintenanceManagementService.java:
##########
@@ -771,4 +797,86 @@ protected Map<String, Boolean>
getInstanceHealthStatus(String clusterId, String
return healthStatus;
}
+
+ public static class MaintenanceManagementServiceBuilder {
+ private ConfigAccessor _configAccessor;
+ private boolean _skipZKRead;
+ private String _namespace;
+ private ZKHelixDataAccessor _dataAccessor;
+ private CustomRestClient _customRestClient;
+ private boolean _continueOnFailure;
+ private Set<StoppableCheck.Category> _skipHealthCheckCategories =
Collections.emptySet();
+ private List<HealthCheck> _stoppableHealthCheckList =
Collections.emptyList();
+
+ public MaintenanceManagementServiceBuilder
setConfigAccessor(ConfigAccessor configAccessor) {
+ _configAccessor = configAccessor;
+ return this;
+ }
+
+ public MaintenanceManagementServiceBuilder setSkipZKRead(boolean
skipZKRead) {
+ _skipZKRead = skipZKRead;
+ return this;
+ }
+
+ public MaintenanceManagementServiceBuilder setNamespace(String namespace) {
+ _namespace = namespace;
+ return this;
+ }
+
+ public MaintenanceManagementServiceBuilder setDataAccessor(
+ ZKHelixDataAccessor dataAccessor) {
+ _dataAccessor = dataAccessor;
+ return this;
+ }
+
+ public MaintenanceManagementServiceBuilder setCustomRestClient(
+ CustomRestClient customRestClient) {
+ _customRestClient = customRestClient;
+ return this;
+ }
+
+ public MaintenanceManagementServiceBuilder setContinueOnFailure(boolean
continueOnFailure) {
+ _continueOnFailure = continueOnFailure;
+ return this;
+ }
+
+ public MaintenanceManagementServiceBuilder setSkipHealthCheckCategories(
+ Set<StoppableCheck.Category> skipHealthCheckCategories) {
+ _skipHealthCheckCategories = skipHealthCheckCategories;
+ return this;
+ }
+
+ public MaintenanceManagementServiceBuilder setStoppableHealthCheckList(
+ List<HealthCheck> stoppableHealthCheckList) {
+ _stoppableHealthCheckList = stoppableHealthCheckList;
Review Comment:
I think a better logic would be
* If the stoppableCheckList is given, Helix should perform the given checks.
* If the stoppableCheckList == null, Helix will perform all existing Helix
own checks. This approach preserves backward compatibility, ensuring that
existing users receive the full suite of checks they anticipate by default.
In this way, users don't need to pass [ALL] to indicate they want to all
stoppable checks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]