From f3c629c27e12479a2f37fedf0d7c766678e3d311 Mon Sep 17 00:00:00 2001 From: Jungtaek Lim Date: Fri, 20 Nov 2020 19:38:42 +0900 Subject: [PATCH] HADOOP-17388. AbstractS3ATokenIdentifier to issue date in UTC. (#2477) Followup to HADOOP-17379. Contributed by Jungtaek Lim. --- .../fs/s3a/auth/delegation/AbstractS3ATokenIdentifier.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/AbstractS3ATokenIdentifier.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/AbstractS3ATokenIdentifier.java index f859f4772f..eb48a28a79 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/AbstractS3ATokenIdentifier.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/AbstractS3ATokenIdentifier.java @@ -24,7 +24,6 @@ import java.io.DataOutput; import java.io.IOException; import java.net.URI; -import java.time.Clock; import java.util.Objects; import java.util.UUID; @@ -32,6 +31,7 @@ import org.apache.hadoop.net.NetUtils; import org.apache.hadoop.security.token.Token; import org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier; +import org.apache.hadoop.util.Time; import static java.util.Objects.requireNonNull; @@ -170,9 +170,7 @@ protected AbstractS3ATokenIdentifier(final Text kind) { } private void initializeIssueDate() { - Clock clock = Clock.systemDefaultZone(); - long now = clock.millis(); - setIssueDate(now); + setIssueDate(Time.now()); } public String getBucket() {