dasahcc commented on a change in pull request #1129:
URL: https://github.com/apache/helix/pull/1129#discussion_r455419855



##########
File path: 
helix-rest/src/main/java/org/apache/helix/rest/server/resources/helix/PerInstanceAccessor.java
##########
@@ -542,4 +558,23 @@ public Response getHealthReportsOnInstance(
   private boolean validInstance(JsonNode node, String instanceName) {
     return 
instanceName.equals(node.get(Properties.id.name()).getValueAsText());
   }
+
+  private boolean validateDeltaInstanceConfigForUpdate(String clusterName, 
String instanceName,
+      ConfigAccessor configAccessor, InstanceConfig newInstanceConfig, boolean 
isDelete)
+      throws IllegalArgumentException {
+    InstanceConfig originalInstanceConfigCopy =
+        configAccessor.getInstanceConfig(clusterName, instanceName);
+    if (isDelete) {
+      for (Map.Entry<String, String> entry : 
newInstanceConfig.getRecord().getSimpleFields()
+          .entrySet()) {
+        
originalInstanceConfigCopy.getRecord().getSimpleFields().remove(entry.getKey());
+      }
+    } else {
+      
originalInstanceConfigCopy.getRecord().update(newInstanceConfig.getRecord());
+    }
+
+    return ConfigAccessor

Review comment:
       Is this sanity check only for topology? If yes, let's name it as topoogy 
check for the perInstanceAccessor, because the sanity check should also involve 
the "HELIX_PORT" something like that in the simple field.




----------------------------------------------------------------
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]

Reply via email to