This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch rel/1.2
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/1.2 by this push:
new b5e17863fe2 [To rel/1.2] Enhance warning messages for ConfigNodeClient
(#10722)
b5e17863fe2 is described below
commit b5e17863fe2e536ab76c2157cd14821b6a8368a8
Author: Potato <[email protected]>
AuthorDate: Fri Jul 28 18:05:44 2023 +0800
[To rel/1.2] Enhance warning messages for ConfigNodeClient (#10722)
Signed-off-by: OneSizeFitQuorum <[email protected]>
---
.../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) {