private boolean isTokenRequired(TableDesc tableDesc) {
    String kafkaBrokers = tableDesc.getProperties().getProperty(HIVE_KAFKA_BOOTSTRAP_SERVERS.getName());
    SecurityProtocol protocol = KafkaUtils.securityProtocol(tableDesc.getProperties());
    return !StringUtils.isEmpty(kafkaBrokers) && SecurityProtocol.PLAINTEXT != protocol;
  }
Returns whether a Kafka token is required for performing operations on the specified table.
If "security.protocol" is set to "PLAINTEXT", we don't need to collect delegation token at all.

@return true if a Kafka token is required for performing operations on the specified table and false otherwise.
kafka-handler/src/java/org/apache/hadoop/hive/kafka/KafkaDagCredentialSupplier.java