HTHou commented on code in PR #13550:
URL: https://github.com/apache/iotdb/pull/13550#discussion_r1776292865


##########
iotdb-client/session/src/main/java/org/apache/iotdb/session/Session.java:
##########
@@ -1384,6 +1440,34 @@ private void handleRedirection(String deviceId, 
TEndPoint endpoint) {
     }
   }
 
+  private void handleRedirection(IDeviceID deviceId, TEndPoint endpoint) {
+    if (enableRedirection) {
+      // no need to redirection
+      if (endpoint.ip.equals("0.0.0.0")) {
+        return;
+      }
+      AtomicReference<IoTDBConnectionException> exceptionReference = new 
AtomicReference<>();
+      if (!tableModelDeviceIdToEndpoint.containsKey(deviceId)
+          || !tableModelDeviceIdToEndpoint.get(deviceId).equals(endpoint)) {
+        tableModelDeviceIdToEndpoint.put(deviceId, endpoint);
+      }
+      SessionConnection connection =
+          endPointToSessionConnection.computeIfAbsent(
+              endpoint,
+              k -> {
+                try {
+                  return constructSessionConnection(this, endpoint, zoneId);
+                } catch (IoTDBConnectionException ex) {
+                  exceptionReference.set(ex);
+                  return null;
+                }
+              });
+      if (connection == null) {
+        tableModelDeviceIdToEndpoint.remove(deviceId);
+      }
+    }

Review Comment:
   no idea either, just copied from old code. Let me remove it



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