Class NoOpHeartbeatManager<I,O>
- java.lang.Object
-
- org.apache.flink.runtime.heartbeat.NoOpHeartbeatManager<I,O>
-
- Type Parameters:
I- ignoredO- ignored
- All Implemented Interfaces:
HeartbeatManager<I,O>,HeartbeatTarget<I>
public class NoOpHeartbeatManager<I,O> extends Object implements HeartbeatManager<I,O>
HeartbeatManagerimplementation which does nothing.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <A,B>
NoOpHeartbeatManager<A,B>getInstance()longgetLastHeartbeatFrom(ResourceID resourceId)Returns the last received heartbeat from the given target.voidmonitorTarget(ResourceID resourceID, HeartbeatTarget<O> heartbeatTarget)Start monitoring aHeartbeatTarget.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.voidstop()Stops the heartbeat manager.voidunmonitorTarget(ResourceID resourceID)Stops monitoring the heartbeat target with the associated resource ID.
-
-
-
Method Detail
-
monitorTarget
public void monitorTarget(ResourceID resourceID, HeartbeatTarget<O> heartbeatTarget)
Description copied from interface:HeartbeatManagerStart monitoring aHeartbeatTarget. Heartbeat timeouts for this target are reported to theHeartbeatListenerassociated with this heartbeat manager.- Specified by:
monitorTargetin interfaceHeartbeatManager<I,O>- Parameters:
resourceID- Resource ID identifying the heartbeat targetheartbeatTarget- Interface to send heartbeat requests and responses to the heartbeat target
-
unmonitorTarget
public void unmonitorTarget(ResourceID resourceID)
Description copied from interface:HeartbeatManagerStops monitoring the heartbeat target with the associated resource ID.- Specified by:
unmonitorTargetin interfaceHeartbeatManager<I,O>- Parameters:
resourceID- Resource ID of the heartbeat target which shall no longer be monitored
-
stop
public void stop()
Description copied from interface:HeartbeatManagerStops the heartbeat manager.- Specified by:
stopin interfaceHeartbeatManager<I,O>
-
getLastHeartbeatFrom
public long getLastHeartbeatFrom(ResourceID resourceId)
Description copied from interface:HeartbeatManagerReturns the last received heartbeat from the given target.- Specified by:
getLastHeartbeatFromin interfaceHeartbeatManager<I,O>- Parameters:
resourceId- for which to return the last heartbeat- Returns:
- Last heartbeat received from the given target or -1 if the target is not being monitored.
-
receiveHeartbeat
public CompletableFuture<Void> receiveHeartbeat(ResourceID heartbeatOrigin, I heartbeatPayload)
Description copied from interface:HeartbeatTargetSends a heartbeat response to the target. Each heartbeat response can carry a payload which contains additional information for the heartbeat target.- Specified by:
receiveHeartbeatin interfaceHeartbeatTarget<I>- Parameters:
heartbeatOrigin- Resource ID identifying the machine for which a heartbeat shall be reported.heartbeatPayload- Payload of the heartbeat. Null indicates an empty payload.- Returns:
- Future that is completed exceptionally if the heartbeat response could not be sent to the target
-
requestHeartbeat
public CompletableFuture<Void> requestHeartbeat(ResourceID requestOrigin, I heartbeatPayload)
Description copied from interface:HeartbeatTargetRequests a heartbeat from the target. Each heartbeat request can carry a payload which contains additional information for the heartbeat target.- Specified by:
requestHeartbeatin interfaceHeartbeatTarget<I>- Parameters:
requestOrigin- Resource ID identifying the machine issuing the heartbeat request.heartbeatPayload- Payload of the heartbeat request. Null indicates an empty payload.- Returns:
- Future that is completed exceptionally if the heartbeat request could not be sent to the target
-
getInstance
public static <A,B> NoOpHeartbeatManager<A,B> getInstance()
-
-