mgao0 commented on a change in pull request #849: Add REST APIs for get, set,
update RestConfig
URL: https://github.com/apache/helix/pull/849#discussion_r389907277
##########
File path: helix-core/src/main/java/org/apache/helix/ConfigAccessor.java
##########
@@ -605,6 +606,62 @@ public RESTConfig getRESTConfig(String clusterName) {
return new RESTConfig(record);
}
+ /**
+ * Set RestConfig of a given cluster
+ * @param clusterName the cluster id
+ * @param restConfig the RestConfig to be set to the cluster
+ */
+ public void setRESTConfig(String clusterName, RESTConfig restConfig) {
+ updateRESTConfig(clusterName, restConfig, true);
+ }
+
+ /**
+ * Update RestConfig of a given cluster
+ * @param clusterName the cluster id
+ * @param restConfig the new RestConfig to be set to the cluster
+ */
+ public void updateRESTConfig(String clusterName, RESTConfig restConfig) {
+ updateRESTConfig(clusterName, restConfig, false);
+ }
+
+ private void updateRESTConfig(String clusterName, RESTConfig restConfig,
boolean overwrite) {
Review comment:
I've adopted the pattern for ClusterConfig here. The overwrite is to be
called to distinguish set and update operations. The RESTConfig instance passed
in gives us the information to be used to set/update the rest config, and the
scope can be derived from information in RESTConfig in the implementation.
----------------------------------------------------------------
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]