Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14065#discussion_r71046243
  
    --- Diff: yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala ---
    @@ -390,8 +393,22 @@ private[spark] class Client(
         // Upload Spark and the application JAR to the remote file system if 
necessary,
         // and add them as local resources to the application master.
         val fs = destDir.getFileSystem(hadoopConf)
    -    val nns = YarnSparkHadoopUtil.get.getNameNodesToAccess(sparkConf) + 
destDir
    -    YarnSparkHadoopUtil.get.obtainTokensForNamenodes(nns, hadoopConf, 
credentials)
    +
    +    // Merge credentials obtained from registered providers
    +    var nearestTimeOfNextRenewal = Long.MaxValue
    +    credentialManager.obtainCredentials(hadoopConf, credentials).foreach { 
t =>
    --- End diff --
    
    You don't really need to calculate `nearestTimeOfNextRenewal` if 
`loginFromKeytab` is false, right?
    
    Also, this all could be:
    
    ```
    val nearestTimeOfNextRenewal =  
credentialManager.obtainCredentials(hadoopConf, credentials).flatten.min
    ```
    
    Just be careful to:
    - validate that all returned times are after the current time
    - watch out for when the result of `.flatten` is empty



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to