vanzin commented on a change in pull request #25760: [SPARK-29054][SS] 
Invalidate Kafka consumer when new delegation token available
URL: https://github.com/apache/spark/pull/25760#discussion_r328384874
 
 

 ##########
 File path: 
external/kafka-0-10-token-provider/src/main/scala/org/apache/spark/kafka010/KafkaTokenUtil.scala
 ##########
 @@ -288,4 +288,18 @@ private[spark] object KafkaTokenUtil extends Logging {
 
     params
   }
+
+  def isConnectorUsingCurrentToken(params: ju.Map[String, Object]): Boolean = {
+    if (params.containsKey(SaslConfigs.SASL_JAAS_CONFIG)) {
+      logDebug("Delegation token used by cached connector, checking if uses 
the latest token.")
+      val consumerJaasParams = 
params.get(SaslConfigs.SASL_JAAS_CONFIG).asInstanceOf[String]
+      val clusterConfig = 
KafkaTokenUtil.findMatchingTokenClusterConfig(SparkEnv.get.conf,
 
 Review comment:
   There's something that still bothers me about this call. The caller should 
already know the `KafkaTokenClusterConf` it's using, so this shouldn't need to 
be computed again. It also would make this method independent of 
`SparkEnv.get.conf`.
   
   It would be even better if the consumer could compare the token directly 
instead of doing it through `KafkaTokenUtil.getTokenJaasParam`, but I can live 
with that one.

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

Reply via email to