lei-xia commented on a change in pull request #863: Make
ZkCacheBaseDataAccessor and ZkHelixPropertyStore realm-aware
URL: https://github.com/apache/helix/pull/863#discussion_r389823422
##########
File path:
helix-core/src/main/java/org/apache/helix/manager/zk/ZkCacheBaseDataAccessor.java
##########
@@ -842,4 +894,116 @@ public void close() {
_zkClient.close();
}
}
+
+ public static class Builder {
+ private String _zkAddress;
+ private RealmAwareZkClient.RealmMode _realmMode;
+ private RealmAwareZkClient.RealmAwareZkConnectionConfig
_realmAwareZkConnectionConfig;
+ private RealmAwareZkClient.RealmAwareZkClientConfig
_realmAwareZkClientConfig;
+
+ /** ZkCacheBaseDataAccessor-specific parameters */
+ private String _chrootPath;
+ private List<String> _wtCachePaths;
+ private List<String> _zkCachePaths;
+ private ZkBaseDataAccessor.ZkClientType _zkClientType;
+
+ public Builder() {
+ }
+
+ public Builder setZkAddress(String zkAddress) {
+ _zkAddress = zkAddress;
+ return this;
+ }
+
+ public Builder setRealmMode(RealmAwareZkClient.RealmMode realmMode) {
+ _realmMode = realmMode;
+ return this;
+ }
+
+ public Builder setRealmAwareZkConnectionConfig(
+ RealmAwareZkClient.RealmAwareZkConnectionConfig
realmAwareZkConnectionConfig) {
+ _realmAwareZkConnectionConfig = realmAwareZkConnectionConfig;
+ return this;
+ }
+
+ public Builder setRealmAwareZkClientConfig(
+ RealmAwareZkClient.RealmAwareZkClientConfig realmAwareZkClientConfig) {
+ _realmAwareZkClientConfig = realmAwareZkClientConfig;
+ return this;
+ }
+
+ public Builder setChrootPath(String chrootPath) {
+ _chrootPath = chrootPath;
+ return this;
+ }
+
+ public Builder setWtCachePaths(List<String> wtCachePaths) {
+ _wtCachePaths = wtCachePaths;
+ return this;
+ }
+
+ public Builder setZkCachePaths(List<String> zkCachePaths) {
+ _zkCachePaths = zkCachePaths;
+ return this;
+ }
+
+ /**
+ * Sets the ZkClientType. If this is set, ZkCacheBaseDataAccessor will be
created on
+ * single-realm mode.
+ * @param zkClientType
+ * @return
+ */
Review comment:
This is not very clear. Do you mean whatever type I set here, it will change
the API to single-realm mode? Then if call builder.
setRealmMode(multi-realm).setZkClientType(type), what will happen?
----------------------------------------------------------------
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]