Class ResourceManagerServiceImpl
java.lang.Object
org.apache.flink.runtime.resourcemanager.ResourceManagerServiceImpl
- All Implemented Interfaces:
AutoCloseable,LeaderContender,ResourceManagerService,org.apache.flink.util.AutoCloseableAsync
public class ResourceManagerServiceImpl
extends Object
implements ResourceManagerService, LeaderContender
Default implementation of
ResourceManagerService.-
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceManagerServiceImplcreate(ResourceManagerFactory<?> resourceManagerFactory, org.apache.flink.configuration.Configuration configuration, ResourceID resourceId, org.apache.flink.runtime.rpc.RpcService rpcService, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, DelegationTokenManager delegationTokenManager, org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler, ClusterInformation clusterInformation, String webInterfaceUrl, MetricRegistry metricRegistry, String hostname, Executor ioExecutor) deregisterApplication(ApplicationStatus applicationStatus, String diagnostics) Deregister the Flink application from the resource management system by signalling theResourceManager.Return termination future of the service.voidgrantLeadership(UUID newLeaderSessionID) Callback method which is called by theLeaderElectionServiceupon selecting this instance as the new leader.voidhandleError(Exception exception) Callback method which is called byLeaderElectionServicein case of an error in the service thread.voidCallback method which is called by theLeaderElectionServiceupon revoking the leadership of a former leader.voidstart()Start the service.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.util.AutoCloseableAsync
close
-
Method Details
-
start
Description copied from interface:ResourceManagerServiceStart the service.- Specified by:
startin interfaceResourceManagerService- Throws:
Exception- if the service cannot be started
-
getTerminationFuture
Description copied from interface:ResourceManagerServiceReturn termination future of the service.- Specified by:
getTerminationFuturein interfaceResourceManagerService- Returns:
- termination future of the service.
-
deregisterApplication
public CompletableFuture<Void> deregisterApplication(ApplicationStatus applicationStatus, @Nullable String diagnostics) Description copied from interface:ResourceManagerServiceDeregister the Flink application from the resource management system by signalling theResourceManager.- Specified by:
deregisterApplicationin interfaceResourceManagerService- Parameters:
applicationStatus- to terminate the application withdiagnostics- additional information about the shut down, can benull- Returns:
- Future which is completed once the shut down
-
closeAsync
- Specified by:
closeAsyncin interfaceorg.apache.flink.util.AutoCloseableAsync
-
grantLeadership
Description copied from interface:LeaderContenderCallback method which is called by theLeaderElectionServiceupon selecting this instance as the new leader. The method is called with the new leader session ID.- Specified by:
grantLeadershipin interfaceLeaderContender- Parameters:
newLeaderSessionID- New leader session ID
-
revokeLeadership
public void revokeLeadership()Description copied from interface:LeaderContenderCallback method which is called by theLeaderElectionServiceupon revoking the leadership of a former leader. This might happen in case that multiple contenders have been granted leadership.- Specified by:
revokeLeadershipin interfaceLeaderContender
-
handleError
Description copied from interface:LeaderContenderCallback method which is called byLeaderElectionServicein case of an error in the service thread.- Specified by:
handleErrorin interfaceLeaderContender- Parameters:
exception- Caught exception
-
getLeaderResourceManager
-
create
public static ResourceManagerServiceImpl create(ResourceManagerFactory<?> resourceManagerFactory, org.apache.flink.configuration.Configuration configuration, ResourceID resourceId, org.apache.flink.runtime.rpc.RpcService rpcService, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, DelegationTokenManager delegationTokenManager, org.apache.flink.runtime.rpc.FatalErrorHandler fatalErrorHandler, ClusterInformation clusterInformation, @Nullable String webInterfaceUrl, MetricRegistry metricRegistry, String hostname, Executor ioExecutor) throws Exception - Throws:
Exception
-