public class ResourceManagerServiceImpl extends Object implements ResourceManagerService, LeaderContender
ResourceManagerService
.Modifier and Type | Method and Description |
---|---|
CompletableFuture<Void> |
closeAsync()
Trigger the closing of the resource and return the corresponding close future.
|
static ResourceManagerServiceImpl |
create(ResourceManagerFactory<?> resourceManagerFactory,
Configuration configuration,
ResourceID resourceId,
RpcService rpcService,
HighAvailabilityServices highAvailabilityServices,
HeartbeatServices heartbeatServices,
DelegationTokenManager delegationTokenManager,
FatalErrorHandler fatalErrorHandler,
ClusterInformation clusterInformation,
String webInterfaceUrl,
MetricRegistry metricRegistry,
String hostname,
Executor ioExecutor) |
CompletableFuture<Void> |
deregisterApplication(ApplicationStatus applicationStatus,
String diagnostics)
Deregister the Flink application from the resource management system by signalling the
ResourceManager . |
ResourceManager<?> |
getLeaderResourceManager() |
CompletableFuture<Void> |
getTerminationFuture()
Return termination future of the service.
|
void |
grantLeadership(UUID newLeaderSessionID)
Callback method which is called by the
LeaderElectionService upon selecting this
instance as the new leader. |
void |
handleError(Exception exception)
Callback method which is called by
LeaderElectionService in case of an error in the
service thread. |
void |
revokeLeadership()
Callback method which is called by the
LeaderElectionService upon revoking the
leadership of a former leader. |
void |
start()
Start the service.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close
public void start() throws Exception
ResourceManagerService
start
in interface ResourceManagerService
Exception
- if the service cannot be startedpublic CompletableFuture<Void> getTerminationFuture()
ResourceManagerService
getTerminationFuture
in interface ResourceManagerService
public CompletableFuture<Void> deregisterApplication(ApplicationStatus applicationStatus, @Nullable String diagnostics)
ResourceManagerService
ResourceManager
.deregisterApplication
in interface ResourceManagerService
applicationStatus
- to terminate the application withdiagnostics
- additional information about the shut down, can be null
public CompletableFuture<Void> closeAsync()
AutoCloseableAsync
closeAsync
in interface AutoCloseableAsync
public void grantLeadership(UUID newLeaderSessionID)
LeaderContender
LeaderElectionService
upon selecting this
instance as the new leader. The method is called with the new leader session ID.grantLeadership
in interface LeaderContender
newLeaderSessionID
- New leader session IDpublic void revokeLeadership()
LeaderContender
LeaderElectionService
upon revoking the
leadership of a former leader. This might happen in case that multiple contenders have been
granted leadership.revokeLeadership
in interface LeaderContender
public void handleError(Exception exception)
LeaderContender
LeaderElectionService
in case of an error in the
service thread.handleError
in interface LeaderContender
exception
- Caught exception@VisibleForTesting @Nullable public ResourceManager<?> getLeaderResourceManager()
public static ResourceManagerServiceImpl create(ResourceManagerFactory<?> resourceManagerFactory, Configuration configuration, ResourceID resourceId, RpcService rpcService, HighAvailabilityServices highAvailabilityServices, HeartbeatServices heartbeatServices, DelegationTokenManager delegationTokenManager, FatalErrorHandler fatalErrorHandler, ClusterInformation clusterInformation, @Nullable String webInterfaceUrl, MetricRegistry metricRegistry, String hostname, Executor ioExecutor) throws Exception
Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.