deniskuzZ commented on code in PR #6081:
URL: https://github.com/apache/hive/pull/6081#discussion_r2416170884


##########
ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java:
##########
@@ -314,7 +350,46 @@ private static List<DagCredentialSupplier> 
defaultCredentialSuppliers() {
         LOG.error("Failed to add credential supplier", e);
       }
     }
-    return dagSuppliers;
+    credentialSuppliers.addAll(dagSuppliers);
+  }
+
+  /**
+   * Returns the security protocol if one is defined in the properties and 
null otherwise.
+   * <p>The following properties are examined to determine the protocol:</p>
+   * <ol>
+   *   <li>security.protocol</li>
+   *   <li>kafka.consumer.security.protocol</li>
+   *   <li>kafka.producer.security.protocol</li>
+   * </ol>
+   * <p>and the first non null/not empty is returned.</p>
+   * <p>Defining multiple security protocols at the same time is invalid but 
this method is lenient and tries to pick
+   * the most reasonable option.</p>
+   * @param props the properties from which to obtain the protocol.
+   * @return the security protocol if one is defined in the properties and 
null otherwise.
+   */
+  static SecurityProtocol getSecurityProtocol(Properties props) {

Review Comment:
   i think this functionality should be extracted to util class like 
`KafkaUtils`



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to