Class DelegationTokenCleanupManager
java.lang.Object
org.apache.zookeeper.server.token.DelegationTokenCleanupManager
Removes expired delegation tokens from the store and, with key rotation
enabled, keeps the master key fresh. Modeled after
ContainerManager: meant to run on the
leader (or a standalone server), periodically scans the token znodes and
posts internal cancel/roll requests through the normal request pipeline, so
the changes replicate as ordinary transactions.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDelegationTokenCleanupManager(ZKDatabase zkDb, RequestProcessor requestProcessor, DelegationTokenSecretManager tokenManager) DelegationTokenCleanupManager(ZKDatabase zkDb, RequestProcessor requestProcessor, DelegationTokenSecretManager tokenManager, long checkIntervalMs) -
Method Summary
Modifier and TypeMethodDescriptionvoidChecks master key freshness once and posts a roll request when the newest valid key is missing or older than the roll interval.voidScans the token store once and posts cancel requests for expired tokens.protected voidpostCancelRequest(Request request) voidstart()Start or restart the periodic check.voidstop()Stop the periodic check.
-
Field Details
-
TOKEN_AUTH_CLEANUP_INTERVAL
- See Also:
-
DEFAULT_CLEANUP_INTERVAL_MS
public static final long DEFAULT_CLEANUP_INTERVAL_MS- See Also:
-
-
Constructor Details
-
DelegationTokenCleanupManager
public DelegationTokenCleanupManager(ZKDatabase zkDb, RequestProcessor requestProcessor, DelegationTokenSecretManager tokenManager) -
DelegationTokenCleanupManager
public DelegationTokenCleanupManager(ZKDatabase zkDb, RequestProcessor requestProcessor, DelegationTokenSecretManager tokenManager, long checkIntervalMs)
-
-
Method Details
-
start
public void start()Start or restart the periodic check. Safe to call multiple times. -
stop
public void stop()Stop the periodic check. Safe to call multiple times. -
checkTokens
public void checkTokens()Scans the token store once and posts cancel requests for expired tokens. Public so tests can trigger a pass directly. -
checkKeys
public void checkKeys()Checks master key freshness once and posts a roll request when the newest valid key is missing or older than the roll interval. Public so tests can trigger a pass directly. -
postCancelRequest
-