zabetak commented on code in PR #4430:
URL: https://github.com/apache/hive/pull/4430#discussion_r1238653284
##########
kafka-handler/src/java/org/apache/hadoop/hive/kafka/KafkaDagCredentialSupplier.java:
##########
@@ -91,17 +89,13 @@ public Text getTokenAlias() {
*/
private boolean isTokenRequired(TableDesc tableDesc) {
String kafkaBrokers = (String)
tableDesc.getProperties().get(HIVE_KAFKA_BOOTSTRAP_SERVERS.getName());
- String consumerSecurityProtocol = (String) tableDesc.getProperties().get(
- CONSUMER_CONFIGURATION_PREFIX + "." +
CommonClientConfigs.SECURITY_PROTOCOL_CONFIG);
- String producerSecurityProtocol = (String) tableDesc.getProperties().get(
- PRODUCER_CONFIGURATION_PREFIX + "." +
CommonClientConfigs.SECURITY_PROTOCOL_CONFIG);
- return kafkaBrokers != null && !kafkaBrokers.isEmpty()
- &&
!CommonClientConfigs.DEFAULT_SECURITY_PROTOCOL.equalsIgnoreCase(consumerSecurityProtocol)
- &&
!CommonClientConfigs.DEFAULT_SECURITY_PROTOCOL.equalsIgnoreCase(producerSecurityProtocol);
+ SecurityProtocol protocol =
KafkaUtils.securityProtocol(tableDesc.getProperties());
+ return kafkaBrokers != null && !kafkaBrokers.isEmpty() &&
SecurityProtocol.PLAINTEXT != protocol;
Review Comment:
Fixed in
https://github.com/apache/hive/pull/4430/commits/45dae3d856028593bab73a0b1810952309450758
In general I am not a very big fan of `StringUtils` because people tend to
add the commons dep in projects/modules just for using this method. In this
case it seems we already have the dep so it doesn't make much of a difference.
--
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]