narendly commented on a change in pull request #863: Make
ZkCacheBaseDataAccessor and ZkHelixPropertyStore realm-aware
URL: https://github.com/apache/helix/pull/863#discussion_r389849160
##########
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:
That will throw an exception as ZkClientType only applies to the old
Dedicated and Shared zkclients.
Do you see the following block of code in the validate() logic? How could I
make this clearer?
```
// If ZkClientType is set, RealmMode must either be single-realm or
not set.
if (isZkClientTypeSet && _realmMode ==
RealmAwareZkClient.RealmMode.MULTI_REALM) {
throw new HelixException(
"ZkCacheBaseDataAccessor: you cannot set ZkClientType on
multi-realm mode!");
```
----------------------------------------------------------------
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]