-
Notifications
You must be signed in to change notification settings - Fork 9.2k
YARN-11253. Add Configuration to delegationToken RemoverScanInterval. #4751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
9a42bf9
f4f4cef
11c0724
d1a76ac
4113ca9
70abbaa
1cc1b35
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ | |
| import org.apache.hadoop.yarn.server.resourcemanager.security.RMDelegationTokenSecretManager; | ||
|
|
||
| import java.io.IOException; | ||
| import java.util.concurrent.TimeUnit; | ||
|
|
||
| public class RMSecretManagerService extends AbstractService { | ||
|
|
||
|
|
@@ -135,9 +136,13 @@ protected RMDelegationTokenSecretManager createRMDelegationTokenSecretManager( | |
| long tokenRenewInterval = | ||
| conf.getLong(YarnConfiguration.RM_DELEGATION_TOKEN_RENEW_INTERVAL_KEY, | ||
| YarnConfiguration.RM_DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT); | ||
| long removeScanInterval = | ||
| conf.getTimeDuration(YarnConfiguration.RM_DELEGATION_TOKEN_REMOVE_SCAN_INTERVAL_KEY, | ||
| YarnConfiguration.RM_DELEGATION_TOKEN_REMOVE_SCAN_INTERVAL_DEFAULT, | ||
| TimeUnit.MILLISECONDS); | ||
|
||
|
|
||
| return new RMDelegationTokenSecretManager(secretKeyInterval, | ||
| tokenMaxLifetime, tokenRenewInterval, 3600000, rmContext); | ||
| tokenMaxLifetime, tokenRenewInterval, removeScanInterval, rmContext); | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ | |
| import java.net.InetSocketAddress; | ||
| import java.security.PrivilegedAction; | ||
| import java.security.PrivilegedExceptionAction; | ||
| import java.util.concurrent.TimeUnit; | ||
|
|
||
| import org.apache.hadoop.test.LambdaTestUtils; | ||
| import org.apache.hadoop.thirdparty.protobuf.InvalidProtocolBufferException; | ||
|
|
@@ -124,9 +125,13 @@ public void testDelegationToken() throws Exception { | |
| long initialInterval = 10000l; | ||
| long maxLifetime= 20000l; | ||
| long renewInterval = 10000l; | ||
| long delegationTokenRemoverScanInterval = | ||
| conf.getTimeDuration(YarnConfiguration.RM_DELEGATION_TOKEN_REMOVE_SCAN_INTERVAL_KEY, | ||
| YarnConfiguration.RM_DELEGATION_TOKEN_REMOVE_SCAN_INTERVAL_DEFAULT, | ||
| TimeUnit.MILLISECONDS); | ||
|
||
|
|
||
| RMDelegationTokenSecretManager rmDtSecretManager = createRMDelegationTokenSecretManager( | ||
| initialInterval, maxLifetime, renewInterval); | ||
| initialInterval, maxLifetime, renewInterval, delegationTokenRemoverScanInterval); | ||
| rmDtSecretManager.startThreads(); | ||
| LOG.info("Creating DelegationTokenSecretManager with initialInterval: " | ||
| + initialInterval + ", maxLifetime: " + maxLifetime | ||
|
|
@@ -574,7 +579,8 @@ private static ResourceScheduler createMockScheduler(Configuration conf) { | |
|
|
||
| private static RMDelegationTokenSecretManager | ||
| createRMDelegationTokenSecretManager(long secretKeyInterval, | ||
| long tokenMaxLifetime, long tokenRenewInterval) { | ||
| long tokenMaxLifetime, long tokenRenewInterval, | ||
| long delegationTokenRemoverScanInterval) { | ||
| ResourceManager rm = mock(ResourceManager.class); | ||
| RMContext rmContext = mock(RMContext.class); | ||
| when(rmContext.getStateStore()).thenReturn(new NullRMStateStore()); | ||
|
|
@@ -583,7 +589,7 @@ private static ResourceScheduler createMockScheduler(Configuration conf) { | |
|
|
||
| RMDelegationTokenSecretManager rmDtSecretManager = | ||
| new RMDelegationTokenSecretManager(secretKeyInterval, tokenMaxLifetime, | ||
| tokenRenewInterval, 3600000, rmContext); | ||
| tokenRenewInterval, delegationTokenRemoverScanInterval, rmContext); | ||
| return rmDtSecretManager; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your suggestion, I will fix it.