Class DefaultDelegationTokenManager
java.lang.Object
org.apache.flink.runtime.security.token.DefaultDelegationTokenManager
- All Implemented Interfaces:
DelegationTokenManager
@Internal
public class DefaultDelegationTokenManager
extends Object
implements DelegationTokenManager
Manager for delegation tokens in a Flink cluster.
When delegation token renewal is enabled, this manager will make sure long-running apps can run without interruption while accessing secured services. It periodically contacts all the configured secure services to obtain delegation tokens to be distributed to the rest of the application.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.runtime.security.token.DelegationTokenManager
DelegationTokenManager.Listener -
Constructor Summary
ConstructorsConstructorDescriptionDefaultDelegationTokenManager(org.apache.flink.configuration.Configuration configuration, org.apache.flink.core.plugin.PluginManager pluginManager, org.apache.flink.util.concurrent.ScheduledExecutor scheduledExecutor, ExecutorService ioExecutor) -
Method Summary
Modifier and TypeMethodDescriptionvoidObtains new tokens in a one-time fashion and automatically distributes them to all local JVM receivers.voidobtainDelegationTokens(DelegationTokenContainer container) Obtains new tokens in a one-time fashion and leaves it up to the caller to distribute them.voidstart(DelegationTokenManager.Listener listener) Creates a re-occurring task which obtains new tokens and automatically distributes them to task managers.voidstop()Stops re-occurring token obtain task.
-
Constructor Details
-
DefaultDelegationTokenManager
public DefaultDelegationTokenManager(org.apache.flink.configuration.Configuration configuration, @Nullable org.apache.flink.core.plugin.PluginManager pluginManager, @Nullable org.apache.flink.util.concurrent.ScheduledExecutor scheduledExecutor, @Nullable ExecutorService ioExecutor)
-
-
Method Details
-
obtainDelegationTokens
Obtains new tokens in a one-time fashion and leaves it up to the caller to distribute them.- Specified by:
obtainDelegationTokensin interfaceDelegationTokenManager- Throws:
Exception
-
obtainDelegationTokens
Description copied from interface:DelegationTokenManagerObtains new tokens in a one-time fashion and automatically distributes them to all local JVM receivers.- Specified by:
obtainDelegationTokensin interfaceDelegationTokenManager- Throws:
Exception
-
obtainDelegationTokensAndGetNextRenewal
protected Optional<Long> obtainDelegationTokensAndGetNextRenewal(DelegationTokenContainer container) -
start
Creates a re-occurring task which obtains new tokens and automatically distributes them to task managers.- Specified by:
startin interfaceDelegationTokenManager- Throws:
Exception
-
stop
public void stop()Stops re-occurring token obtain task.- Specified by:
stopin interfaceDelegationTokenManager
-