Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/16432#discussion_r95103643
--- Diff:
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/security/HadoopFSCredentialProvider.scala
---
@@ -56,14 +57,14 @@ private[security] class HDFSCredentialProvider extends
ServiceCredentialProvider
}
// Get the time of next renewal.
- tokenRenewalInterval.map { interval =>
- creds.getAllTokens.asScala
- .filter(_.getKind ==
DelegationTokenIdentifier.HDFS_DELEGATION_KIND)
+ tokenRenewalInterval.flatMap { interval =>
+ val nextRenewalDates = creds.getAllTokens.asScala
+
.filter(_.decodeIdentifier().isInstanceOf[AbstractDelegationTokenIdentifier])
.map { t =>
- val identifier = new DelegationTokenIdentifier()
- identifier.readFields(new DataInputStream(new
ByteArrayInputStream(t.getIdentifier)))
+ val identifier =
t.decodeIdentifier().asInstanceOf[AbstractDelegationTokenIdentifier]
identifier.getIssueDate + interval
- }.foldLeft(0L)(math.max)
+ }
+ if (nextRenewalDates.isEmpty) None else Some(nextRenewalDates.min)
--- End diff --
Why previously we use math.max and now changed to minimum value?
---
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]