pkuwm commented on a change in pull request #855: Make ZkBaseDataAccessor
realm-aware
URL: https://github.com/apache/helix/pull/855#discussion_r389826601
##########
File path:
helix-core/src/main/java/org/apache/helix/manager/zk/ZkBaseDataAccessor.java
##########
@@ -1248,4 +1280,127 @@ public void close() {
_zkClient.close();
}
}
+
+ public static class Builder {
+ private String zkAddress;
+ private RealmAwareZkClient.RealmMode realmMode;
+ private ZkBaseDataAccessor.ZkClientType zkClientType;
+ private RealmAwareZkClient.RealmAwareZkConnectionConfig
realmAwareZkConnectionConfig;
+ private RealmAwareZkClient.RealmAwareZkClientConfig
realmAwareZkClientConfig;
+
+ public Builder() {
+ }
+
+ public ZkBaseDataAccessor.Builder setZkAddress(String zkAddress) {
+ this.zkAddress = zkAddress;
+ return this;
+ }
+
+ public ZkBaseDataAccessor.Builder
setRealmMode(RealmAwareZkClient.RealmMode realmMode) {
+ this.realmMode = realmMode;
+ return this;
+ }
+
+ public ZkBaseDataAccessor.Builder setZkClientType(
+ ZkBaseDataAccessor.ZkClientType zkClientType) {
+ this.zkClientType = zkClientType;
+ return this;
+ }
+
+ public ZkBaseDataAccessor.Builder setRealmAwareZkConnectionConfig(
+ RealmAwareZkClient.RealmAwareZkConnectionConfig
realmAwareZkConnectionConfig) {
+ this.realmAwareZkConnectionConfig = realmAwareZkConnectionConfig;
+ return this;
+ }
+
+ public ZkBaseDataAccessor.Builder setRealmAwareZkClientConfig(
+ RealmAwareZkClient.RealmAwareZkClientConfig realmAwareZkClientConfig) {
+ this.realmAwareZkClientConfig = realmAwareZkClientConfig;
+ return this;
+ }
+
+ public ZkBaseDataAccessor<?> build() throws Exception {
+ validate();
+ return new ZkBaseDataAccessor<>(this);
+ }
+
+ /**
+ * Validate the given parameters before creating an instance of
ConfigAccessor.
Review comment:
Change comment.
----------------------------------------------------------------
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]