You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ta...@apache.org on 2023/07/28 07:21:00 UTC

[iotdb] branch enhance_confignode_client_msg_cp created (now 16916dc9591)

This is an automated email from the ASF dual-hosted git repository.

tanxinyu pushed a change to branch enhance_confignode_client_msg_cp
in repository https://gitbox.apache.org/repos/asf/iotdb.git


      at 16916dc9591 enhance msg

This branch includes the following new commits:

     new 16916dc9591 enhance msg

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: enhance msg

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tanxinyu pushed a commit to branch enhance_confignode_client_msg_cp
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 16916dc95918a32a2231a88d47f2bf69cfde7566
Author: OneSizeFitQuorum <ta...@apache.org>
AuthorDate: Fri Jul 28 15:19:34 2023 +0800

    enhance msg
    
    Signed-off-by: OneSizeFitQuorum <ta...@apache.org>
---
 .../org/apache/iotdb/db/protocol/client/ConfigNodeClient.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ConfigNodeClient.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ConfigNodeClient.java
index 76f2d94f3b9..2cf8ce76e1d 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ConfigNodeClient.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/client/ConfigNodeClient.java
@@ -146,7 +146,7 @@ import org.slf4j.LoggerFactory;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
-import java.util.function.Function;
+import java.util.function.Predicate;
 
 public class ConfigNodeClient implements IConfigNodeRPCService.Iface, ThriftClient, AutoCloseable {
 
@@ -155,7 +155,7 @@ public class ConfigNodeClient implements IConfigNodeRPCService.Iface, ThriftClie
   private static final int RETRY_NUM = 5;
 
   public static final String MSG_RECONNECTION_FAIL =
-      "Fail to connect to any config node. Please check status of ConfigNodes";
+      "Fail to connect to any config node. Please check status of ConfigNodes or logs of connected DataNode";
 
   private static final String MSG_RECONNECTION_DATANODE_FAIL =
       "Failed to connect to ConfigNode %s from DataNode %s when executing %s, Exception:";
@@ -324,12 +324,12 @@ public class ConfigNodeClient implements IConfigNodeRPCService.Iface, ThriftClie
    * @param <T> the type of rpc result
    * @throws TException if fails more than RETRY_NUM times, throw TException(MSG_RECONNECTION_FAIL)
    */
-  private <T> T executeRemoteCallWithRetry(Operation<T> call, Function<T, Boolean> check)
+  private <T> T executeRemoteCallWithRetry(Operation<T> call, Predicate<T> check)
       throws TException {
     for (int i = 0; i < RETRY_NUM; i++) {
       try {
         T result = call.execute();
-        if (check.apply(result)) {
+        if (check.test(result)) {
           return result;
         }
       } catch (TException e) {