You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2021/08/24 08:19:45 UTC
[iotdb] 05/05: better struct
This is an automated email from the ASF dual-hosted git repository.
rong pushed a commit to branch session-pool-optimization
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 744278d8421dd834534654d31e347dd9a3d9de44
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Tue Aug 24 16:19:07 2021 +0800
better struct
---
.../java/org/apache/iotdb/session/pool/SessionPool.java | 13 ++++++++-----
1 file changed, 8 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 1beb0c5..e94f134 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
@@ -71,22 +71,25 @@ public class SessionPool {
private final ConcurrentLinkedDeque<Session> queue = new ConcurrentLinkedDeque<>();
// for session whose resultSet is not released.
private final ConcurrentMap<Session, Session> occupied = new ConcurrentHashMap<>();
-
private int size = 0;
private int maxSize = 0;
+ private final long waitToGetSessionTimeoutInMs;
+ // parameters for Session constructor
private final String host;
private final int port;
private final String user;
private final String password;
private final int fetchSize;
- private final long waitToGetSessionTimeoutInMs;
+ private final ZoneId zoneId;
+ private final boolean enableCacheLeader;
+
+ // parameters for Session#open()
private final int connectionTimeoutInMs;
private final boolean enableCompression;
- private final boolean enableCacheLeader;
- private final ZoneId zoneId;
- private boolean closed; // whether the queue is closed.
+ // whether the queue is closed.
+ private boolean closed;
public SessionPool(String host, int port, String user, String password, int maxSize) {
this(