CRZbulabula commented on code in PR #7531:
URL: https://github.com/apache/iotdb/pull/7531#discussion_r993513960
##########
confignode/src/main/java/org/apache/iotdb/confignode/service/ConfigNode.java:
##########
@@ -208,12 +216,25 @@ private void registerConfigNode() throws
StartupException, IOException {
}
for (int retry = 0; retry < 3; retry++) {
- TSStatus status =
- (TSStatus)
- SyncConfigNodeClientPool.getInstance()
- .sendSyncRequestToConfigNodeWithRetry(
- targetConfigNode, req,
ConfigNodeRequestType.REGISTER_CONFIG_NODE);
+ TSStatus status;
+ TConfigNodeRegisterResp resp = null;
+ Object obj =
+ SyncConfigNodeClientPool.getInstance()
+ .sendSyncRequestToConfigNodeWithRetry(
+ targetConfigNode, req,
ConfigNodeRequestType.REGISTER_CONFIG_NODE);
+
+ if (obj instanceof TConfigNodeRegisterResp) {
+ resp = (TConfigNodeRegisterResp) obj;
+ status = resp.getStatus();
+ } else {
+ status = (TSStatus) obj;
+ }
Review Comment:
The `if` statement and the `obj` variable can be removed?
--
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]