pkuwm commented on a change in pull request #1415:
URL: https://github.com/apache/helix/pull/1415#discussion_r495426711



##########
File path: 
helix-core/src/main/java/org/apache/helix/manager/zk/ZKHelixDataAccessor.java
##########
@@ -599,4 +610,12 @@ private int constructOptions(PropertyType type) {
       List<DataUpdater<ZNRecord>> updaters, int options) {
     return _baseDataAccessor.updateChildren(paths, updaters, options);
   }
+
+  private void validateBucketizedEnabled(String path, boolean isRead) {
+    if (!BUCKETIZE_ZNRECORD_ENABLED) {
+      throw new HelixMetaDataAccessException(
+          "Can't " + (isRead ? "read" : "write") + " bucktized ZNode " + path
+              + " because Bucktize feature is not enabled. Please check ZK 
system property 'zk.bucketize.znrecord.enabled' .");

Review comment:
       Not reading the config every time. We use the config key to replace the 
hard coded string. The benefit is, it'll be easier for us to find the reference 
that uses the key. And if we refactor the name, we won't miss this place.
   And actually the compiler usually will replace the constant variable 
"ZkSystemPropertyKeys.ZK_BUCKETIZE_ZNRECORD_ENABLED" with the string 
"zk.bucketize.znrecord.enabled". 




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