XComp commented on code in PR #21467:
URL: https://github.com/apache/flink/pull/21467#discussion_r1054558267
##########
flink-runtime/src/main/java/org/apache/flink/runtime/heartbeat/HeartbeatServices.java:
##########
@@ -100,37 +62,31 @@ public <I, O> HeartbeatManager<I, O>
createHeartbeatManager(
* @param <O> Type of the outgoing payload
* @return A new HeartbeatManager instance which actively sends heartbeats
*/
- public <I, O> HeartbeatManager<I, O> createHeartbeatManagerSender(
+ <I, O> HeartbeatManager<I, O> createHeartbeatManagerSender(
ResourceID resourceId,
HeartbeatListener<I, O> heartbeatListener,
ScheduledExecutor mainThreadExecutor,
- Logger log) {
-
- return new HeartbeatManagerSenderImpl<>(
- heartbeatInterval,
- heartbeatTimeout,
- failedRpcRequestsUntilUnreachable,
- resourceId,
- heartbeatListener,
- mainThreadExecutor,
- log);
- }
+ Logger log);
/**
* Creates an HeartbeatServices instance from a {@link Configuration}.
*
* @param configuration Configuration to be used for the HeartbeatServices
creation
* @return An HeartbeatServices instance created from the given
configuration
*/
- public static HeartbeatServices fromConfiguration(Configuration
configuration) {
+ static HeartbeatServices fromConfiguration(Configuration configuration) {
long heartbeatInterval =
configuration.getLong(HeartbeatManagerOptions.HEARTBEAT_INTERVAL);
long heartbeatTimeout =
configuration.getLong(HeartbeatManagerOptions.HEARTBEAT_TIMEOUT);
int failedRpcRequestsUntilUnreachable =
configuration.get(HeartbeatManagerOptions.HEARTBEAT_RPC_FAILURE_THRESHOLD);
- return new HeartbeatServices(
+ return new HeartbeatServicesImpl(
heartbeatInterval, heartbeatTimeout,
failedRpcRequestsUntilUnreachable);
}
+
+ static HeartbeatServices noOp() {
Review Comment:
That's kind of related to [my previous
comment](https://github.com/apache/flink/pull/21467#discussion_r1054554625): We
could remove that if we decide to move the `NoOpheartbeatServices` into the
test code, I guess.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]