pkuwm commented on a change in pull request #844: Implement setRoutingData for
MetadataStoreDirectoryService
URL: https://github.com/apache/helix/pull/844#discussion_r386715625
##########
File path:
helix-rest/src/main/java/org/apache/helix/rest/metadatastore/ZkMetadataStoreDirectory.java
##########
@@ -155,6 +159,19 @@ private void init(String namespace, String zkAddress)
throws InvalidRoutingDataE
return routingData;
}
+ @Override
+ public boolean setNamespaceRoutingData(String namespace, Map<String,
List<String>> routingData) {
+ synchronized (this) {
+ if (!_routingDataWriterMap.containsKey(namespace)) {
Review comment:
This is like double lock checking. You may also want to check it before
synchronized which also improves performance.
Considering namespace is not changed, you don’t have to check it in within
synchronized block.
----------------------------------------------------------------
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]