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

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


The following commit(s) were added to refs/heads/master by this push:
     new f3bd8fba193 Modify message of unsupported DataNode->ConfigNode RPC 
#13945
f3bd8fba193 is described below

commit f3bd8fba1932df6a0271ae4a2ff292ed5f451bc5
Author: Li Yu Heng <[email protected]>
AuthorDate: Tue Oct 29 15:34:06 2024 +0800

    Modify message of unsupported DataNode->ConfigNode RPC #13945
---
 .../apache/iotdb/db/protocol/client/ConfigNodeClient.java | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 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 bf643cfbd5e..93f9bf1e77c 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
@@ -198,6 +198,9 @@ public class ConfigNodeClient implements 
IConfigNodeRPCService.Iface, ThriftClie
   private static final long RETRY_INTERVAL_MS = 1000L;
   private static final long WAIT_CN_LEADER_ELECTION_INTERVAL_MS = 2000L;
 
+  private static final String UNSUPPORTED_INVOCATION =
+      "This method is not supported for invocation by DataNode";
+
   private final ThriftClientProperty property;
 
   private IConfigNodeRPCService.Iface client;
@@ -469,17 +472,17 @@ public class ConfigNodeClient implements 
IConfigNodeRPCService.Iface, ThriftClie
 
   @Override
   public TAINodeRegisterResp registerAINode(TAINodeRegisterReq req) throws 
TException {
-    throw new UnsupportedOperationException("RegisterAINode method is not 
supported in datanode");
+    throw new UnsupportedOperationException(UNSUPPORTED_INVOCATION);
   }
 
   @Override
   public TAINodeRestartResp restartAINode(TAINodeRestartReq req) throws 
TException {
-    throw new UnsupportedOperationException("RestartAINode method is not 
supported in datanode");
+    throw new UnsupportedOperationException(UNSUPPORTED_INVOCATION);
   }
 
   @Override
   public TSStatus removeAINode(TAINodeRemoveReq req) throws TException {
-    throw new UnsupportedOperationException("RemoveAINode method is not 
supported in datanode");
+    throw new UnsupportedOperationException(UNSUPPORTED_INVOCATION);
   }
 
   @Override
@@ -490,8 +493,7 @@ public class ConfigNodeClient implements 
IConfigNodeRPCService.Iface, ThriftClie
 
   @Override
   public TAINodeConfigurationResp getAINodeConfiguration(int aiNodeId) throws 
TException {
-    throw new UnsupportedOperationException(
-        "GetAINodeConfiguration method is not supported in datanode");
+    throw new UnsupportedOperationException(UNSUPPORTED_INVOCATION);
   }
 
   @Override
@@ -773,7 +775,8 @@ public class ConfigNodeClient implements 
IConfigNodeRPCService.Iface, ThriftClie
 
   @Override
   public TSStatus loadConfiguration() throws TException {
-    throw new UnsupportedOperationException("Please call 
submitLoadConfigurationTask instead");
+    throw new UnsupportedOperationException(
+        UNSUPPORTED_INVOCATION + ", please call submitLoadConfigurationTask 
instead");
   }
 
   @Override

Reply via email to