zhangmeng916 commented on a change in pull request #859: Update customize state 
using updater
URL: https://github.com/apache/helix/pull/859#discussion_r390025024
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/customizedstate/CustomizedStateProvider.java
 ##########
 @@ -61,29 +61,16 @@ public synchronized void updateCustomizedState(String 
customizedStateName, Strin
    * Update a specific customized state based on the resource name and 
partition name. The
    * customized state is input as a map
    */
-  public synchronized void updateCustomizedState(String customizedStateName, 
String resourceName,
+  public void updateCustomizedState(String customizedStateName, String 
resourceName,
       String partitionName, Map<String, String> customizedStateMap) {
     PropertyKey.Builder keyBuilder = _helixDataAccessor.keyBuilder();
     PropertyKey propertyKey =
         keyBuilder.customizedState(_instanceName, customizedStateName, 
resourceName);
     ZNRecord record = new ZNRecord(resourceName);
-    Map<String, Map<String, String>> mapFields = new HashMap<>();
-    CustomizedState existingState = getCustomizedState(customizedStateName, 
resourceName);
-    if (existingState != null
-        && 
existingState.getRecord().getMapFields().containsKey(partitionName)) {
-      Map<String, String> existingMap = new HashMap<>();
 
 Review comment:
   So this is user to update a customized state for a certain partition. I 
don't think we have the knowledge to clean up stale states, meaning if the user 
only update "CURRENT_STATE" of customized state, we update it, and keep the 
other fields unchanged. If they would like to do a full update, they will use 
the other API and provide the full map, and the original map will be 
overwritten.

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to