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

 ##########
 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:
   Yeah, we do want the full map like instead of replacing the previous map. 
Because for customized state, the key are fixed, e.g. "previous state", 
"current state", etc. We do not allow user to delete entries, and if they do 
not have value, the entry will have null value. 
   
   For this API, it's updating the per partition customized state, not adding 
new type of customized states.
   So it's a definite map of
   {"start time": xxx
   "end time:xxx
   "previous state":xxx
   "current state":xxx
   }
   and customers update one entry or the full map. 

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