gaborgsomogyi commented on a change in pull request #24305: [SPARK-27294][SS]
Add multi-cluster Kafka delegation token
URL: https://github.com/apache/spark/pull/24305#discussion_r279315842
##########
File path:
external/kafka-0-10-token-provider/src/main/scala/org/apache/spark/kafka010/KafkaTokenUtil.scala
##########
@@ -41,16 +43,22 @@ import org.apache.spark.internal.config._
private[spark] object KafkaTokenUtil extends Logging {
val TOKEN_KIND = new Text("KAFKA_DELEGATION_TOKEN")
- val TOKEN_SERVICE = new Text("kafka.server.delegation.token")
+ private val TOKEN_SERVICE_PREFIX = "kafka.server.delegation.token"
+
+ private[kafka010] def getTokenService(identifier: String): Text =
+ new Text(s"$TOKEN_SERVICE_PREFIX.$identifier")
+ private def getClusterIdentifier(service: Text): String =
+ service.toString().replace(s"$TOKEN_SERVICE_PREFIX.", "")
private[spark] class KafkaDelegationTokenIdentifier extends
AbstractDelegationTokenIdentifier {
override def getKind: Text = TOKEN_KIND
}
- private[kafka010] def obtainToken(sparkConf: SparkConf): (Token[_ <:
TokenIdentifier], Long) = {
+ private[kafka010] def obtainToken(sparkConf: SparkConf,
Review comment:
Fixed.
----------------------------------------------------------------
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]