jixuan1989 commented on a change in pull request #2222:
URL: https://github.com/apache/iotdb/pull/2222#discussion_r540676037



##########
File path: session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
##########
@@ -74,29 +74,36 @@
   private int fetchSize;
   private long timeout; //ms
   private static int FINAL_RETRY = RETRY - 1;
-  private boolean enableCompression = false;
+  private boolean enableCompression;
+  private boolean enableCacheLeader;
   private ZoneId zoneId;
 
   private boolean closed;//whether the queue is closed.
 
   public SessionPool(String ip, int port, String user, String password, int 
maxSize) {
-    this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, 
false, null);
+    this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, 
false, null, false);
   }
 
   public SessionPool(String ip, int port, String user, String password, int 
maxSize,
       boolean enableCompression) {
     this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, 
enableCompression,
-        null);
+        null, false);

Review comment:
       `false` -> `Config.DEFAULT_CACHE_LEADER_MODE`

##########
File path: session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
##########
@@ -74,29 +74,36 @@
   private int fetchSize;
   private long timeout; //ms
   private static int FINAL_RETRY = RETRY - 1;
-  private boolean enableCompression = false;
+  private boolean enableCompression;
+  private boolean enableCacheLeader;
   private ZoneId zoneId;
 
   private boolean closed;//whether the queue is closed.
 
   public SessionPool(String ip, int port, String user, String password, int 
maxSize) {
-    this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, 
false, null);
+    this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, 
false, null, false);
   }
 
   public SessionPool(String ip, int port, String user, String password, int 
maxSize,
       boolean enableCompression) {
     this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, 
enableCompression,
-        null);
+        null, false);
+  }
+
+  public SessionPool(String ip, int port, String user, String password, int 
maxSize,
+      boolean enableCompression, boolean enableCacheLeader) {
+    this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, 
enableCompression,
+        null, enableCacheLeader);
   }
 
   public SessionPool(String ip, int port, String user, String password, int 
maxSize,
       ZoneId zoneId) {
-    this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, 
false, zoneId);
+    this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, 
false, zoneId, false);

Review comment:
       `false` -> `Config.DEFAULT_CACHE_LEADER_MODE`

##########
File path: session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
##########
@@ -74,29 +74,36 @@
   private int fetchSize;
   private long timeout; //ms
   private static int FINAL_RETRY = RETRY - 1;
-  private boolean enableCompression = false;
+  private boolean enableCompression;
+  private boolean enableCacheLeader;
   private ZoneId zoneId;
 
   private boolean closed;//whether the queue is closed.
 
   public SessionPool(String ip, int port, String user, String password, int 
maxSize) {
-    this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, 
false, null);
+    this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, 
false, null, false);

Review comment:
       `false` -> `Config.DEFAULT_CACHE_LEADER_MODE`

##########
File path: 
session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java
##########
@@ -164,7 +164,7 @@ private void correctQuery(SessionPool pool) {
 
   @Test
   public void tryIfTheServerIsRestart() {
-    SessionPool pool = new SessionPool("127.0.0.1", 6667, "root", "root", 3, 
1, 6000, false, null);
+    SessionPool pool = new SessionPool("127.0.0.1", 6667, "root", "root", 3, 
1, 6000, false, null, false);

Review comment:
       Is there some UT for set the enableCache as `true`?




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to