jiajunwang commented on a change in pull request #859: Update customize state
using updater
URL: https://github.com/apache/helix/pull/859#discussion_r390030055
##########
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:
I don't think you get my point, or maybe I did not get the point. Anyway,
let's go with an example,
1. The original map {"CSTypeA":"foo", "CSTypeB":"bar"}
2. User try to update with map {"CSTypeC":"foo", "CSTypeD":"bar"}
3. I assume the expect result for the custmize state is {"CSTypeC":"foo",
"CSTypeD":"bar"}.
4. But really by the default merge method we get: {"CSTypeA":"foo",
"CSTypeB":"bar", "CSTypeC":"foo", "CSTypeD":"bar"}
CSTypeA and CSTypeB is the stale state that I meant.
----------------------------------------------------------------
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]