Skip to content

Commit 9a42bf9

Browse files
author
slfan1989
committed
YARN-11253. Add Configuration to delegationToken RemoverScanInterval.
1 parent 86abeb4 commit 9a42bf9

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,10 @@ public static boolean isAclEnabled(Configuration conf) {
793793
RM_PREFIX + "delegation.token.max-lifetime";
794794
public static final long RM_DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT =
795795
7*24*60*60*1000; // 7 days
796+
public static final String RM_DELEGATION_TOKEN_REMOVE_SCAN_INTERVAL_KEY =
797+
RM_PREFIX + "delegation.token.remove-scan-interval";
798+
public static final long RM_DELEGATION_TOKEN_REMOVE_SCAN_INTERVAL_DEFAULT =
799+
60*60*1000; // 1 hour
796800

797801
public static final String RM_DELEGATION_TOKEN_MAX_CONF_SIZE =
798802
RM_PREFIX + "delegation-token.max-conf-size-bytes";

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,6 +1077,14 @@
10771077
<value>86400000</value>
10781078
</property>
10791079

1080+
<property>
1081+
<description>
1082+
RM delegation token remove-scan interval in ms
1083+
</description>
1084+
<name>yarn.resourcemanager.delegation.token.remove-scan-interval</name>
1085+
<value>3600000</value>
1086+
</property>
1087+
10801088
<property>
10811089
<description>
10821090
RM DelegationTokenRenewer thread timeout

hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/RMSecretManagerService.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ protected RMDelegationTokenSecretManager createRMDelegationTokenSecretManager(
135135
long tokenRenewInterval =
136136
conf.getLong(YarnConfiguration.RM_DELEGATION_TOKEN_RENEW_INTERVAL_KEY,
137137
YarnConfiguration.RM_DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT);
138-
138+
long removeScanInterval =
139+
conf.getLong(YarnConfiguration.RM_DELEGATION_TOKEN_REMOVE_SCAN_INTERVAL_KEY,
140+
YarnConfiguration.RM_DELEGATION_TOKEN_REMOVE_SCAN_INTERVAL_DEFAULT);
139141
return new RMDelegationTokenSecretManager(secretKeyInterval,
140-
tokenMaxLifetime, tokenRenewInterval, 3600000, rmContext);
142+
tokenMaxLifetime, tokenRenewInterval, removeScanInterval, rmContext);
141143
}
142144

143145
}

0 commit comments

Comments
 (0)