From 28cc912a5c18a4f06ef6b66a252f4d3905a6adc8 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Wed, 27 Jan 2021 16:39:29 +0000 Subject: [PATCH] HADOOP-17493. Revert name of DELEGATION_TOKENS_ISSUED constant/statistic (#2649) Follow-on to HADOOP-16830/HADOOP-17271. Contributed by Steve Loughran. --- .../org/apache/hadoop/fs/statistics/StoreStatisticNames.java | 3 --- .../src/main/java/org/apache/hadoop/fs/s3a/Statistic.java | 4 ++-- .../hadoop/fs/s3a/auth/delegation/S3ADelegationTokens.java | 4 ++-- .../auth/delegation/ITestSessionDelegationInFileystem.java | 4 ++-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/statistics/StoreStatisticNames.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/statistics/StoreStatisticNames.java index 0dd6540dc02..b6d2a916f44 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/statistics/StoreStatisticNames.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/statistics/StoreStatisticNames.java @@ -325,9 +325,6 @@ public final class StoreStatisticNames { public static final String STORE_IO_THROTTLE_RATE = "store_io_throttle_rate"; - public static final String DELEGATION_TOKEN_ISSUED - = "delegation_token_issued"; - public static final String MULTIPART_UPLOAD_INSTANTIATED = "multipart_instantiated"; diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/Statistic.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/Statistic.java index 0bd2a622f4f..f5d6053df50 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/Statistic.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/Statistic.java @@ -494,8 +494,8 @@ public enum Statistic { /* * Delegation Token Operations. */ - DELEGATION_TOKEN_ISSUED( - StoreStatisticNames.DELEGATION_TOKEN_ISSUED, + DELEGATION_TOKENS_ISSUED( + StoreStatisticNames.DELEGATION_TOKENS_ISSUED, "Count of delegation tokens issued", TYPE_DURATION), diff --git a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/S3ADelegationTokens.java b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/S3ADelegationTokens.java index d8fc8b83964..05917fe9c63 100644 --- a/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/S3ADelegationTokens.java +++ b/hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/auth/delegation/S3ADelegationTokens.java @@ -45,7 +45,7 @@ import org.apache.hadoop.security.token.Token; import org.apache.hadoop.service.ServiceOperations; import org.apache.hadoop.util.DurationInfo; -import static org.apache.hadoop.fs.s3a.Statistic.DELEGATION_TOKEN_ISSUED; +import static org.apache.hadoop.fs.s3a.Statistic.DELEGATION_TOKENS_ISSUED; import static org.apache.hadoop.fs.statistics.impl.IOStatisticsBinding.trackDuration; import static org.apache.hadoop.thirdparty.com.google.common.base.Preconditions.checkArgument; import static org.apache.hadoop.thirdparty.com.google.common.base.Preconditions.checkState; @@ -431,7 +431,7 @@ public class S3ADelegationTokens extends AbstractDTService { try(DurationInfo ignored = new DurationInfo(LOG, DURATION_LOG_AT_INFO, "Creating New Delegation Token", tokenBinding.getKind())) { Token token = trackDuration(stats, - DELEGATION_TOKEN_ISSUED.getSymbol(), () -> + DELEGATION_TOKENS_ISSUED.getSymbol(), () -> tokenBinding.createDelegationToken(rolePolicy, encryptionSecrets, renewer)); if (token != null) { diff --git a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/auth/delegation/ITestSessionDelegationInFileystem.java b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/auth/delegation/ITestSessionDelegationInFileystem.java index 7be5b754f20..f5562bdf32e 100644 --- a/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/auth/delegation/ITestSessionDelegationInFileystem.java +++ b/hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/auth/delegation/ITestSessionDelegationInFileystem.java @@ -214,7 +214,7 @@ public class ITestSessionDelegationInFileystem extends AbstractDelegationIT { S3ATestUtils.MetricDiff invocationDiff = new S3ATestUtils.MetricDiff(fs, Statistic.INVOCATION_GET_DELEGATION_TOKEN); S3ATestUtils.MetricDiff issueDiff = new S3ATestUtils.MetricDiff(fs, - Statistic.DELEGATION_TOKEN_ISSUED); + Statistic.DELEGATION_TOKENS_ISSUED); Token token = requireNonNull(fs.getDelegationToken(""), "no token from filesystem " + fs); @@ -371,7 +371,7 @@ public class ITestSessionDelegationInFileystem extends AbstractDelegationIT { S3ATestUtils.MetricDiff issueDiff = new S3ATestUtils.MetricDiff( delegatedFS, - Statistic.DELEGATION_TOKEN_ISSUED); + Statistic.DELEGATION_TOKENS_ISSUED); // verify that the FS returns the existing token when asked // so that chained deployments will work