You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2020/04/08 13:22:24 UTC

[incubator-iotdb] branch master updated (b24cdde -> 4bc238f)

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

qiaojialin pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git.


    from b24cdde  fix compile error caused by rebase and add a new test to help maintain the TSFileConfigUtil.
     new af683dd  enable compression in session pool
     new 4bc238f  ignore S107

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../java/org/apache/iotdb/session/pool/SessionPool.java    | 14 +++++++++++---
 .../org/apache/iotdb/session/pool/SessionPoolTest.java     |  4 ++--
 2 files changed, 13 insertions(+), 5 deletions(-)


[incubator-iotdb] 01/02: enable compression in session pool

Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit af683dd0b6f63f076b247c42a7f629f23ccaa224
Author: qiaojialin <64...@qq.com>
AuthorDate: Wed Apr 8 16:39:55 2020 +0800

    enable compression in session pool
---
 .../java/org/apache/iotdb/session/pool/SessionPool.java     | 13 ++++++++++---
 .../java/org/apache/iotdb/session/pool/SessionPoolTest.java |  4 ++--
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java b/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
index 1f7b579..8c103ca 100644
--- a/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
+++ b/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
@@ -76,13 +76,19 @@ public class SessionPool {
 
   private long timeout; //ms
   private static int RETRY = 3;
+  private boolean enableCompression = false;
 
   public SessionPool(String ip, int port, String user, String password, int maxSize) {
-    this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000);
+    this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, 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);
   }
 
   public SessionPool(String ip, int port, String user, String password, int maxSize, int fetchSize,
-      long timeout) {
+      long timeout, boolean enableCompression) {
     this.maxSize = maxSize;
     this.ip = ip;
     this.port = port;
@@ -90,6 +96,7 @@ public class SessionPool {
     this.password = password;
     this.fetchSize = fetchSize;
     this.timeout = timeout;
+    this.enableCompression = enableCompression;
   }
 
   //if this method throws an exception, either the server is broken, or the ip/port/user/password is incorrect.
@@ -135,7 +142,7 @@ public class SessionPool {
         logger.error("Create a new Session {}, {}, {}, {}", ip, port, user, password);
       }
       session = new Session(ip, port, user, password, fetchSize);
-      session.open();
+      session.open(enableCompression);
       return session;
     }
   }
diff --git a/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java b/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java
index 59dda6b..9b649aa 100644
--- a/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java
+++ b/session/src/test/java/org/apache/iotdb/session/pool/SessionPoolTest.java
@@ -171,7 +171,7 @@ public class SessionPoolTest {
 
   @Test
   public void tryIfTheServerIsRestart() {
-    SessionPool pool = new SessionPool("127.0.0.1", 6667, "root", "root", 3, 1,6000);
+    SessionPool pool = new SessionPool("127.0.0.1", 6667, "root", "root", 3, 1, 6000, false);
     for (int i = 0; i < 10; i++) {
       try {
         pool.insert("root.sg1.d1", i, Collections.singletonList("s" + i), Collections.singletonList("" + i));
@@ -206,7 +206,7 @@ public class SessionPoolTest {
 
   @Test
   public void tryIfTheServerIsRestartButDataIsGotten() {
-    SessionPool pool = new SessionPool("127.0.0.1", 6667, "root", "root", 3, 1,60000);
+    SessionPool pool = new SessionPool("127.0.0.1", 6667, "root", "root", 3, 1, 60000, false);
     for (int i = 0; i < 10; i++) {
       try {
         pool.insert("root.sg1.d1", i, Collections.singletonList("s" + i), Collections.singletonList("" + i));


[incubator-iotdb] 02/02: ignore S107

Posted by qi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4bc238f43e933545480558311be1e6ff634c2b5a
Author: qiaojialin <64...@qq.com>
AuthorDate: Wed Apr 8 19:21:38 2020 +0800

    ignore S107
---
 session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java b/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
index 8c103ca..6aaf1be 100644
--- a/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
+++ b/session/src/main/java/org/apache/iotdb/session/pool/SessionPool.java
@@ -87,6 +87,7 @@ public class SessionPool {
     this(ip, port, user, password, maxSize, Config.DEFAULT_FETCH_SIZE, 60_000, enableCompression);
   }
 
+  @SuppressWarnings("squid:S107")
   public SessionPool(String ip, int port, String user, String password, int maxSize, int fetchSize,
       long timeout, boolean enableCompression) {
     this.maxSize = maxSize;