Aggarwal-Raghav commented on code in PR #532:
URL: https://github.com/apache/tez/pull/532#discussion_r3761244513
##########
tez-api/src/main/java/org/apache/tez/client/registry/zookeeper/ZkConfig.java:
##########
@@ -110,17 +125,67 @@ public int getConnectionTimeoutMs() {
return connectionTimeoutMs;
}
+ public String getZookeeperTrustStorePassword() {
+ return sslTruststorePassword;
+ }
+
+ public String getZookeeperTrustStoreLocation() {
+ return sslTruststoreLocation;
+ }
+
+ public String getZookeeperKeyStorePassword() {
+ return sslKeystorePassword;
+ }
+
+ public String getZookeeperKeyStoreLocation() {
+ return sslKeystoreLocation;
+ }
+
+ /**
+ * Returns whether the zookeeper connection will be secure or insecure.
+ * @return An optional boolean value that indicates whether zookeeper client
uses a secure
+ * zookeeper connection. A null value indicates that it is not specified,
and in this case
+ * the default settings of zookeeper are used, which can be controlled by
specific JVM
+ * properties.
+ * @see TezConfiguration#TEZ_AM_ZOOKEEPER_SSL_ENABLE
+ */
+ public Boolean isSslEnabled() {
+ if (this.sslEnabled == null || this.sslEnabled.isEmpty()) {
+ return null;
+ }
+ return Boolean.parseBoolean(sslEnabled);
+ }
+
public RetryPolicy getRetryPolicy() {
return new ExponentialBackoffRetry(getCuratorBackoffSleepMs(),
getCuratorMaxRetries());
}
public CuratorFramework createCuratorFramework() {
- return CuratorFrameworkFactory.newClient(
- getZkQuorum(),
- getSessionTimeoutMs(),
- getConnectionTimeoutMs(),
- getRetryPolicy()
- );
+ if (isSslEnabled() == null) {
+ return CuratorFrameworkFactory.newClient(
+ getZkQuorum(),
Review Comment:
Why not use the built-in `.zkClientConfig()` method provided by Curator 5.x?
It provides native support for managing these SSL properties.
`SSLZookeeperFactory.java` can we entirely removed and just configure it inline
inside `ZkConfig.java` like this:
```java
ZKClientConfig zkClientConfig = new ZKClientConfig();
zkClientConfig.setProperty(ZKClientConfig.SECURE_CLIENT, "true");
.....
.....
return CuratorFrameworkFactory.builder()
.connectString(getZkQuorum())
// ... other settings ...
.zkClientConfig(zkClientConfig) // Built-in Curator support
.build();
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]