isapego commented on a change in pull request #9863:
URL: https://github.com/apache/ignite/pull/9863#discussion_r818685051



##########
File path: 
modules/core/src/main/java/org/apache/ignite/configuration/ClientConfiguration.java
##########
@@ -678,4 +684,68 @@ public ClientConfiguration 
setAsyncContinuationExecutor(Executor asyncContinuati
 
         return this;
     }
+
+    /**
+     * Gets a value indicating whether heartbeats are enabled.
+     * <p />
+     * When thin client connection is idle (no operations are performed), 
heartbeat messages are sent periodically
+     * to keep the connection alive and detect potential half-open state.
+     * <p />
+     * See also {@link ClientConfiguration#heartbeatInterval}.
+     *
+     * @return Whether heartbeats are enabled.
+     */
+    public boolean getHeartbeatsEnabled() {

Review comment:
       ```suggestion
       public boolean isHeartbeatEnabled() {
   ```

##########
File path: 
modules/core/src/main/java/org/apache/ignite/configuration/ClientConfiguration.java
##########
@@ -678,4 +684,68 @@ public ClientConfiguration 
setAsyncContinuationExecutor(Executor asyncContinuati
 
         return this;
     }
+
+    /**
+     * Gets a value indicating whether heartbeats are enabled.
+     * <p />
+     * When thin client connection is idle (no operations are performed), 
heartbeat messages are sent periodically
+     * to keep the connection alive and detect potential half-open state.
+     * <p />
+     * See also {@link ClientConfiguration#heartbeatInterval}.
+     *
+     * @return Whether heartbeats are enabled.
+     */
+    public boolean getHeartbeatsEnabled() {
+        return heartbeatsEnabled;
+    }
+
+    /**
+     * Sets a value indicating whether heartbeats are enabled.
+     * <p />
+     * When thin client connection is idle (no operations are performed), 
heartbeat messages are sent periodically
+     * to keep the connection alive and detect potential half-open state.
+     * <p />
+     * See also {@link ClientConfiguration#heartbeatInterval}.
+     *
+     * @param heartbeatsEnabled Whether to enable heartbeats.
+     * @return {@code this} for chaining.
+     */
+    public ClientConfiguration setHeartbeatsEnabled(boolean heartbeatsEnabled) 
{

Review comment:
       ```suggestion
       public ClientConfiguration setHeartbeatEnabled(boolean heartbeatEnabled) 
{
   ```

##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/client/thin/TcpClientChannel.java
##########
@@ -705,9 +724,65 @@ private ClientException handleIOError(String chInfo, 
@Nullable IOException ex) {
         return new ClientConnectionException("Ignite cluster is unavailable [" 
+ chInfo + ']', ex);
     }
 
+    /**
+     * Initializes heartbeats.
+     *
+     * @param configuredInterval Configured heartbeat interval, in 
milliseconds.
+     * @return Heartbeat timer.
+     */
+    private Timer initHeartbeats(long configuredInterval) {
+        long heartbeatInterval = getHeartbeatInterval(configuredInterval);

Review comment:
       Should not we log a warning if `heartbeatInterval != configuredInterval`?




-- 
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]


Reply via email to