You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2021/03/19 04:03:57 UTC

[GitHub] [iotdb] jt2594838 commented on a change in pull request #2867: IOTDB-1241 support redirect query for cluster

jt2594838 commented on a change in pull request #2867:
URL: https://github.com/apache/iotdb/pull/2867#discussion_r597392662



##########
File path: session/src/main/java/org/apache/iotdb/session/Session.java
##########
@@ -585,6 +641,14 @@ private void handleRedirection(String deviceId, EndPoint endpoint)
     }
   }
 
+  private void handleQueryRedirection(EndPoint endPoint) throws IoTDBConnectionException {
+    if (enableQueryRedirection) {
+      defaultSessionConnection.close();
+      defaultSessionConnection = constructSessionConnection(this, endPoint, zoneId);
+      defaultSessionConnection.setEnableRedirect(enableQueryRedirection);
+    }
+  }

Review comment:
       Maybe it would be better to cache a certain number of connections for different endpoints.
   If the client queries root.sg1, then root.sg2, then root.sg1, then root.sg2... a new connection will be created for each query if the two SGs are located in different data groups.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org