kaisun2000 commented on a change in pull request #1215:
URL: https://github.com/apache/helix/pull/1215#discussion_r467211456
##########
File path: helix-core/src/main/java/org/apache/helix/model/ClusterConfig.java
##########
@@ -859,14 +866,24 @@ public boolean isGlobalRebalanceAsyncModeEnabled() {
/**
* Set the abnormal state resolver class map.
+ * @param resolverMap - the resolver map
+ * If null, the resolver map item will be removed from
the config.
*/
public void setAbnormalStateResolverMap(Map<String, String> resolverMap) {
- if (resolverMap.values().stream()
- .anyMatch(className -> className == null || className.isEmpty())) {
- throw new IllegalArgumentException(
- "Invalid Abnormal State Resolver Map definition. Class name cannot
be empty.");
+ if (resolverMap == null) {
+
_record.getMapFields().remove(ClusterConfigProperty.ABNORMAL_STATES_RESOLVER_MAP.name());
+ } else {
+ if (resolverMap.entrySet().stream().anyMatch(e -> {
+ String stateModelDefName = e.getKey();
+ String className = e.getValue();
+ return stateModelDefName == null || stateModelDefName.isEmpty() ||
className == null
+ || className.isEmpty();
+ })) {
+ throw new IllegalArgumentException(
+ "Invalid Abnormal State Resolver Map definition. StateModel
definition name and the resolver class name cannot be empty.");
Review comment:
nit.
StateModel definition name can't be null, resolver class name cannot be
empty can't be null or empty.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]