I - Type of the incoming heartbeat payloadO - Type of the outgoing heartbeat payload@ThreadSafe public class HeartbeatManagerImpl<I,O> extends Object implements HeartbeatManager<I,O>
HeartbeatListener about it. A heartbeat times out iff no heartbeat signal has been received
within a given timeout interval.| 限定符和类型 | 字段和说明 |
|---|---|
protected org.slf4j.Logger |
log |
protected boolean |
stopped
Running state of the heartbeat manager.
|
| 构造器和说明 |
|---|
HeartbeatManagerImpl(long heartbeatTimeoutIntervalMs,
int failedRpcRequestsUntilUnreachable,
ResourceID ownResourceID,
HeartbeatListener<I,O> heartbeatListener,
org.apache.flink.util.concurrent.ScheduledExecutor mainThreadExecutor,
org.slf4j.Logger log) |
HeartbeatManagerImpl(long heartbeatTimeoutIntervalMs,
int failedRpcRequestsUntilUnreachable,
ResourceID ownResourceID,
HeartbeatListener<I,O> heartbeatListener,
org.apache.flink.util.concurrent.ScheduledExecutor mainThreadExecutor,
org.slf4j.Logger log,
HeartbeatMonitor.Factory<O> heartbeatMonitorFactory) |
| 限定符和类型 | 方法和说明 |
|---|---|
long |
getLastHeartbeatFrom(ResourceID resourceId)
Returns the last received heartbeat from the given target.
|
protected java.util.function.BiConsumer<Void,Throwable> |
handleHeartbeatRpc(ResourceID heartbeatTarget) |
void |
monitorTarget(ResourceID resourceID,
HeartbeatTarget<O> heartbeatTarget)
Start monitoring a
HeartbeatTarget. |
CompletableFuture<Void> |
receiveHeartbeat(ResourceID heartbeatOrigin,
I heartbeatPayload)
Sends a heartbeat response to the target.
|
CompletableFuture<Void> |
requestHeartbeat(ResourceID requestOrigin,
I heartbeatPayload)
Requests a heartbeat from the target.
|
void |
stop()
Stops the heartbeat manager.
|
void |
unmonitorTarget(ResourceID resourceID)
Stops monitoring the heartbeat target with the associated resource ID.
|
protected final org.slf4j.Logger log
protected volatile boolean stopped
public HeartbeatManagerImpl(long heartbeatTimeoutIntervalMs,
int failedRpcRequestsUntilUnreachable,
ResourceID ownResourceID,
HeartbeatListener<I,O> heartbeatListener,
org.apache.flink.util.concurrent.ScheduledExecutor mainThreadExecutor,
org.slf4j.Logger log)
public HeartbeatManagerImpl(long heartbeatTimeoutIntervalMs,
int failedRpcRequestsUntilUnreachable,
ResourceID ownResourceID,
HeartbeatListener<I,O> heartbeatListener,
org.apache.flink.util.concurrent.ScheduledExecutor mainThreadExecutor,
org.slf4j.Logger log,
HeartbeatMonitor.Factory<O> heartbeatMonitorFactory)
public void monitorTarget(ResourceID resourceID, HeartbeatTarget<O> heartbeatTarget)
HeartbeatManagerHeartbeatTarget. Heartbeat timeouts for this target are reported
to the HeartbeatListener associated with this heartbeat manager.monitorTarget 在接口中 HeartbeatManager<I,O>resourceID - Resource ID identifying the heartbeat targetheartbeatTarget - Interface to send heartbeat requests and responses to the heartbeat
targetpublic void unmonitorTarget(ResourceID resourceID)
HeartbeatManagerunmonitorTarget 在接口中 HeartbeatManager<I,O>resourceID - Resource ID of the heartbeat target which shall no longer be monitoredpublic void stop()
HeartbeatManagerstop 在接口中 HeartbeatManager<I,O>public long getLastHeartbeatFrom(ResourceID resourceId)
HeartbeatManagergetLastHeartbeatFrom 在接口中 HeartbeatManager<I,O>resourceId - for which to return the last heartbeatpublic CompletableFuture<Void> receiveHeartbeat(ResourceID heartbeatOrigin, I heartbeatPayload)
HeartbeatTargetreceiveHeartbeat 在接口中 HeartbeatTarget<I>heartbeatOrigin - Resource ID identifying the machine for which a heartbeat shall be
reported.heartbeatPayload - Payload of the heartbeat. Null indicates an empty payload.public CompletableFuture<Void> requestHeartbeat(ResourceID requestOrigin, I heartbeatPayload)
HeartbeatTargetrequestHeartbeat 在接口中 HeartbeatTarget<I>requestOrigin - Resource ID identifying the machine issuing the heartbeat request.heartbeatPayload - Payload of the heartbeat request. Null indicates an empty payload.protected java.util.function.BiConsumer<Void,Throwable> handleHeartbeatRpc(ResourceID heartbeatTarget)
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.