Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,10 @@ private[spark] class CredentialUpdater(

/** Start the credential updater task */
def start(): Unit = {
val startTime = sparkConf.get(CREDENTIALS_RENEWAL_TIME)
val remainingTime = startTime - System.currentTimeMillis()
if (remainingTime <= 0) {
credentialUpdater.schedule(credentialUpdaterRunnable, 1, TimeUnit.MINUTES)
} else {
logInfo(s"Scheduling credentials refresh from HDFS in $remainingTime millis.")
credentialUpdater.schedule(credentialUpdaterRunnable, remainingTime, TimeUnit.MILLISECONDS)
}
val startTime = sparkConf.get(CREDENTIALS_UPDATE_TIME)
val remainingTime = Math.max(1, startTime - System.currentTimeMillis())
Copy link
Contributor

@jerryshao jerryshao Feb 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic looks different compared to the original code, also 1 is minute not millisecond.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let me change it back

logInfo(s"Scheduling credentials refresh from HDFS in $remainingTime millis.")
credentialUpdater.schedule(credentialUpdaterRunnable, remainingTime, TimeUnit.MILLISECONDS)
}

private def updateCredentialsIfRequired(): Unit = {
Expand Down