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

qiaojialin pushed a commit to branch rel/0.13
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/rel/0.13 by this push:
     new 273bf771e9 [To rel/0.13][IOTDB-5127]Separate ISession and ISessionPool 
as a module (#8507)
273bf771e9 is described below

commit 273bf771e9bd94186eba7f242287856b932264c4
Author: Zhijia Cao <[email protected]>
AuthorDate: Wed Dec 21 13:43:29 2022 +0800

    [To rel/0.13][IOTDB-5127]Separate ISession and ISessionPool as a module 
(#8507)
---
 isession/pom.xml                                   |  37 ++
 .../main/java/org/apache/iotdb/session/Config.java |   0
 .../java/org/apache/iotdb/session/ISession.java    | 445 +++++++++++++++++++++
 .../org/apache/iotdb/session/SessionDataSet.java   |   0
 .../apache/iotdb/session/pool/ISessionPool.java    | 428 ++++++++++++++++++++
 .../iotdb/session/pool/SessionDataSetWrapper.java  |  10 +-
 .../apache/iotdb/session/template/Template.java    |   0
 .../iotdb/session/template/TemplateNode.java       |   0
 .../apache/iotdb/session/util/SystemStatus.java    |   0
 .../org/apache/iotdb/session/util/Version.java     |   0
 pom.xml                                            |   1 +
 session/pom.xml                                    |   5 +
 .../java/org/apache/iotdb/session/Session.java     |  95 ++++-
 .../org/apache/iotdb/session/pool/SessionPool.java | 256 ++++++++----
 14 files changed, 1185 insertions(+), 92 deletions(-)

diff --git a/isession/pom.xml b/isession/pom.xml
new file mode 100644
index 0000000000..7ea9f48b21
--- /dev/null
+++ b/isession/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+        http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <parent>
+        <artifactId>iotdb-parent</artifactId>
+        <groupId>org.apache.iotdb</groupId>
+        <version>0.13.4-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>iotdb-isession</artifactId>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>service-rpc</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/session/src/main/java/org/apache/iotdb/session/Config.java 
b/isession/src/main/java/org/apache/iotdb/session/Config.java
similarity index 100%
rename from session/src/main/java/org/apache/iotdb/session/Config.java
rename to isession/src/main/java/org/apache/iotdb/session/Config.java
diff --git a/isession/src/main/java/org/apache/iotdb/session/ISession.java 
b/isession/src/main/java/org/apache/iotdb/session/ISession.java
new file mode 100644
index 0000000000..4638ce3918
--- /dev/null
+++ b/isession/src/main/java/org/apache/iotdb/session/ISession.java
@@ -0,0 +1,445 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.session;
+
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+import org.apache.iotdb.service.rpc.thrift.TSBackupConfigurationResp;
+import org.apache.iotdb.service.rpc.thrift.TSConnectionInfoResp;
+import org.apache.iotdb.session.template.Template;
+import org.apache.iotdb.session.util.SystemStatus;
+import org.apache.iotdb.session.util.Version;
+import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
+import org.apache.iotdb.tsfile.write.record.Tablet;
+
+import org.apache.thrift.TException;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.List;
+import java.util.Map;
+
+public interface ISession {
+
+  void setFetchSize(int fetchSize);
+
+  int getFetchSize();
+
+  Version getVersion();
+
+  void setVersion(Version version);
+
+  void open() throws IoTDBConnectionException;
+
+  void open(boolean enableRPCCompression) throws IoTDBConnectionException;
+
+  void open(boolean enableRPCCompression, int connectionTimeoutInMs)
+      throws IoTDBConnectionException;
+
+  void close() throws IoTDBConnectionException;
+
+  SystemStatus getSystemStatus() throws IoTDBConnectionException;
+
+  String getTimeZone();
+
+  void setTimeZone(String zoneId) throws StatementExecutionException, 
IoTDBConnectionException;
+
+  void setStorageGroup(String storageGroup)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deleteStorageGroup(String storageGroup)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deleteStorageGroups(List<String> storageGroups)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void createTimeseries(
+      String path, TSDataType dataType, TSEncoding encoding, CompressionType 
compressor)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void createTimeseries(
+      String path,
+      TSDataType dataType,
+      TSEncoding encoding,
+      CompressionType compressor,
+      Map<String, String> props,
+      Map<String, String> tags,
+      Map<String, String> attributes,
+      String measurementAlias)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void createAlignedTimeseries(
+      String deviceId,
+      List<String> measurements,
+      List<TSDataType> dataTypes,
+      List<TSEncoding> encodings,
+      List<CompressionType> compressors,
+      List<String> measurementAliasList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void createMultiTimeseries(
+      List<String> paths,
+      List<TSDataType> dataTypes,
+      List<TSEncoding> encodings,
+      List<CompressionType> compressors,
+      List<Map<String, String>> propsList,
+      List<Map<String, String>> tagsList,
+      List<Map<String, String>> attributesList,
+      List<String> measurementAliasList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  boolean checkTimeseriesExists(String path)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void setQueryTimeout(long timeoutInMs);
+
+  long getQueryTimeout();
+
+  SessionDataSet executeQueryStatement(String sql)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  SessionDataSet executeQueryStatement(String sql, long timeoutInMs)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  void executeNonQueryStatement(String sql)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  SessionDataSet executeRawDataQuery(List<String> paths, long startTime, long 
endTime)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  SessionDataSet executeLastDataQuery(List<String> paths, long LastTime)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  SessionDataSet executeLastDataQuery(List<String> paths)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  void insertRecord(
+      String deviceId,
+      long time,
+      List<String> measurements,
+      List<TSDataType> types,
+      Object... values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  String getTimestampPrecision() throws TException;
+
+  void insertRecord(
+      String deviceId,
+      long time,
+      List<String> measurements,
+      List<TSDataType> types,
+      List<Object> values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedRecord(
+      String deviceId,
+      long time,
+      List<String> measurements,
+      List<TSDataType> types,
+      List<Object> values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertRecord(String deviceId, long time, List<String> measurements, 
List<String> values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedRecord(
+      String deviceId, long time, List<String> measurements, List<String> 
values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertRecords(
+      List<String> deviceIds,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedRecords(
+      List<String> deviceIds,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertRecords(
+      List<String> deviceIds,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedRecords(
+      List<String> deviceIds,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList,
+      boolean haveSorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertStringRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList,
+      boolean haveSorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertStringRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList,
+      boolean haveSorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedStringRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList,
+      boolean haveSorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedStringRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertTablet(Tablet tablet) throws StatementExecutionException, 
IoTDBConnectionException;
+
+  void insertTablet(Tablet tablet, boolean sorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedTablet(Tablet tablet)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  void insertAlignedTablet(Tablet tablet, boolean sorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertTablets(Map<String, Tablet> tablets)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertTablets(Map<String, Tablet> tablets, boolean sorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedTablets(Map<String, Tablet> tablets)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedTablets(Map<String, Tablet> tablets, boolean sorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void testInsertTablet(Tablet tablet) throws IoTDBConnectionException, 
StatementExecutionException;
+
+  void testInsertTablet(Tablet tablet, boolean sorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void testInsertTablets(Map<String, Tablet> tablets)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void testInsertTablets(Map<String, Tablet> tablets, boolean sorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void testInsertRecords(
+      List<String> deviceIds,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void testInsertRecords(
+      List<String> deviceIds,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void testInsertRecord(String deviceId, long time, List<String> measurements, 
List<String> values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void testInsertRecord(
+      String deviceId,
+      long time,
+      List<String> measurements,
+      List<TSDataType> types,
+      List<Object> values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deleteTimeseries(String path) throws IoTDBConnectionException, 
StatementExecutionException;
+
+  void deleteTimeseries(List<String> paths)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deleteData(String path, long endTime)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deleteData(List<String> paths, long endTime)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deleteData(List<String> paths, long startTime, long endTime)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void setSchemaTemplate(String templateName, String prefixPath)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void createSchemaTemplate(Template template)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  void createSchemaTemplate(
+      String templateName,
+      List<String> measurements,
+      List<TSDataType> dataTypes,
+      List<TSEncoding> encodings,
+      List<CompressionType> compressors,
+      boolean isAligned)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  @Deprecated
+  void createSchemaTemplate(
+      String name,
+      List<String> schemaNames,
+      List<List<String>> measurements,
+      List<List<TSDataType>> dataTypes,
+      List<List<TSEncoding>> encodings,
+      List<CompressionType> compressors)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void addAlignedMeasurementsInTemplate(
+      String templateName,
+      List<String> measurementsPath,
+      List<TSDataType> dataTypes,
+      List<TSEncoding> encodings,
+      List<CompressionType> compressors)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  void addAlignedMeasurementInTemplate(
+      String templateName,
+      String measurementPath,
+      TSDataType dataType,
+      TSEncoding encoding,
+      CompressionType compressor)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  void addUnalignedMeasurementsInTemplate(
+      String templateName,
+      List<String> measurementsPath,
+      List<TSDataType> dataTypes,
+      List<TSEncoding> encodings,
+      List<CompressionType> compressors)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  void addUnalignedMeasurementInTemplate(
+      String templateName,
+      String measurementPath,
+      TSDataType dataType,
+      TSEncoding encoding,
+      CompressionType compressor)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  void deleteNodeInTemplate(String templateName, String path)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  int countMeasurementsInTemplate(String name)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  boolean isMeasurementInTemplate(String templateName, String path)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  boolean isPathExistInTemplate(String templateName, String path)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  List<String> showMeasurementsInTemplate(String templateName)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  List<String> showMeasurementsInTemplate(String templateName, String pattern)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  List<String> showAllTemplates() throws StatementExecutionException, 
IoTDBConnectionException;
+
+  List<String> showPathsTemplateSetOn(String templateName)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  List<String> showPathsTemplateUsingOn(String templateName)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  void unsetSchemaTemplate(String prefixPath, String templateName)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void createTimeseriesOfTemplateOnPath(String path)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deactivateTemplateOn(String templateName, String prefixPath)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void dropSchemaTemplate(String templateName)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void operationSyncTransmit(ByteBuffer buffer)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  boolean isEnableQueryRedirection();
+
+  void setEnableQueryRedirection(boolean enableQueryRedirection);
+
+  boolean isEnableCacheLeader();
+
+  void setEnableCacheLeader(boolean enableCacheLeader);
+
+  TSBackupConfigurationResp getBackupConfiguration()
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  TSConnectionInfoResp fetchAllConnections() throws IoTDBConnectionException;
+}
diff --git a/session/src/main/java/org/apache/iotdb/session/SessionDataSet.java 
b/isession/src/main/java/org/apache/iotdb/session/SessionDataSet.java
similarity index 100%
rename from session/src/main/java/org/apache/iotdb/session/SessionDataSet.java
rename to isession/src/main/java/org/apache/iotdb/session/SessionDataSet.java
diff --git 
a/isession/src/main/java/org/apache/iotdb/session/pool/ISessionPool.java 
b/isession/src/main/java/org/apache/iotdb/session/pool/ISessionPool.java
new file mode 100644
index 0000000000..912fdb621b
--- /dev/null
+++ b/isession/src/main/java/org/apache/iotdb/session/pool/ISessionPool.java
@@ -0,0 +1,428 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.iotdb.session.pool;
+
+import org.apache.iotdb.rpc.IoTDBConnectionException;
+import org.apache.iotdb.rpc.StatementExecutionException;
+import org.apache.iotdb.service.rpc.thrift.TSBackupConfigurationResp;
+import org.apache.iotdb.service.rpc.thrift.TSConnectionInfoResp;
+import org.apache.iotdb.session.template.Template;
+import org.apache.iotdb.session.util.SystemStatus;
+import org.apache.iotdb.tsfile.file.metadata.enums.CompressionType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
+import org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding;
+import org.apache.iotdb.tsfile.write.record.Tablet;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.time.ZoneId;
+import java.util.List;
+import java.util.Map;
+
+public interface ISessionPool {
+
+  int currentAvailableSize();
+
+  int currentOccupiedSize();
+
+  void close();
+
+  void closeResultSet(SessionDataSetWrapper wrapper);
+
+  void insertTablet(Tablet tablet) throws IoTDBConnectionException, 
StatementExecutionException;
+
+  void insertTablet(Tablet tablet, boolean sorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedTablet(Tablet tablet)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedTablet(Tablet tablet, boolean sorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertTablets(Map<String, Tablet> tablets)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedTablets(Map<String, Tablet> tablets)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertTablets(Map<String, Tablet> tablets, boolean sorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedTablets(Map<String, Tablet> tablets, boolean sorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertRecords(
+      List<String> deviceIds,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedRecords(
+      List<String> multiSeriesIds,
+      List<Long> times,
+      List<List<String>> multiMeasurementComponentsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  @Deprecated
+  void insertOneDeviceRecords(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertStringRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList,
+      boolean haveSorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  @Deprecated
+  void insertOneDeviceRecords(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList,
+      boolean haveSorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertStringRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList,
+      boolean haveSorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedStringRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList,
+      boolean haveSorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedStringRecordsOfOneDevice(
+      String deviceId,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList,
+      boolean haveSorted)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertRecords(
+      List<String> deviceIds,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedRecords(
+      List<String> multiSeriesIds,
+      List<Long> times,
+      List<List<String>> multiMeasurementComponentsList,
+      List<List<String>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertRecord(
+      String deviceId,
+      long time,
+      List<String> measurements,
+      List<TSDataType> types,
+      List<Object> values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedRecord(
+      String multiSeriesId,
+      long time,
+      List<String> multiMeasurementComponents,
+      List<TSDataType> types,
+      List<Object> values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertRecord(String deviceId, long time, List<String> measurements, 
List<String> values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void insertAlignedRecord(
+      String multiSeriesId, long time, List<String> 
multiMeasurementComponents, List<String> values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void testInsertTablet(Tablet tablet) throws IoTDBConnectionException, 
StatementExecutionException;
+
+  void testInsertTablets(Map<String, Tablet> tablets)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void testInsertRecords(
+      List<String> deviceIds,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<String>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void testInsertRecords(
+      List<String> deviceIds,
+      List<Long> times,
+      List<List<String>> measurementsList,
+      List<List<TSDataType>> typesList,
+      List<List<Object>> valuesList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void testInsertRecord(String deviceId, long time, List<String> measurements, 
List<String> values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void testInsertRecord(
+      String deviceId,
+      long time,
+      List<String> measurements,
+      List<TSDataType> types,
+      List<Object> values)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deleteTimeseries(String path) throws IoTDBConnectionException, 
StatementExecutionException;
+
+  void deleteTimeseries(List<String> paths)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deleteData(String path, long time)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deleteData(List<String> paths, long time)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deleteData(List<String> paths, long startTime, long endTime)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void setStorageGroup(String storageGroupId)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deleteStorageGroup(String storageGroup)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deleteStorageGroups(List<String> storageGroup)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void createTimeseries(
+      String path, TSDataType dataType, TSEncoding encoding, CompressionType 
compressor)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void createTimeseries(
+      String path,
+      TSDataType dataType,
+      TSEncoding encoding,
+      CompressionType compressor,
+      Map<String, String> props,
+      Map<String, String> tags,
+      Map<String, String> attributes,
+      String measurementAlias)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void createMultiTimeseries(
+      List<String> paths,
+      List<TSDataType> dataTypes,
+      List<TSEncoding> encodings,
+      List<CompressionType> compressors,
+      List<Map<String, String>> propsList,
+      List<Map<String, String>> tagsList,
+      List<Map<String, String>> attributesList,
+      List<String> measurementAliasList)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  boolean checkTimeseriesExists(String path)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void createSchemaTemplate(Template template)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  void createSchemaTemplate(
+      String templateName,
+      List<String> measurements,
+      List<TSDataType> dataTypes,
+      List<TSEncoding> encodings,
+      List<CompressionType> compressors,
+      boolean isAligned)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  @Deprecated
+  void createSchemaTemplate(
+      String name,
+      List<String> schemaNames,
+      List<List<String>> measurements,
+      List<List<TSDataType>> dataTypes,
+      List<List<TSEncoding>> encodings,
+      List<CompressionType> compressors)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void addAlignedMeasurementsInTemplate(
+      String templateName,
+      List<String> measurementsPath,
+      List<TSDataType> dataTypes,
+      List<TSEncoding> encodings,
+      List<CompressionType> compressors)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  void addAlignedMeasurementInTemplate(
+      String templateName,
+      String measurementPath,
+      TSDataType dataType,
+      TSEncoding encoding,
+      CompressionType compressor)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  void addUnalignedMeasurementsInTemplate(
+      String templateName,
+      List<String> measurementsPath,
+      List<TSDataType> dataTypes,
+      List<TSEncoding> encodings,
+      List<CompressionType> compressors)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  void addUnalignedMeasurementInTemplate(
+      String templateName,
+      String measurementPath,
+      TSDataType dataType,
+      TSEncoding encoding,
+      CompressionType compressor)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  void deleteNodeInTemplate(String templateName, String path)
+      throws IOException, IoTDBConnectionException, 
StatementExecutionException;
+
+  int countMeasurementsInTemplate(String name)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  boolean isMeasurementInTemplate(String templateName, String path)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  boolean isPathExistInTemplate(String templateName, String path)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  List<String> showMeasurementsInTemplate(String templateName)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  List<String> showMeasurementsInTemplate(String templateName, String pattern)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  List<String> showAllTemplates() throws StatementExecutionException, 
IoTDBConnectionException;
+
+  List<String> showPathsTemplateSetOn(String templateName)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  List<String> showPathsTemplateUsingOn(String templateName)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  void setSchemaTemplate(String templateName, String prefixPath)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  void unsetSchemaTemplate(String prefixPath, String templateName)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  void createTimeseriesOfTemplateOnPath(String path)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void deactivateTempalte(String templateName, String prefixPath)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void dropSchemaTemplate(String templateName)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  SessionDataSetWrapper executeQueryStatement(String sql)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  SessionDataSetWrapper executeQueryStatement(String sql, long timeoutInMs)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  void executeNonQueryStatement(String sql)
+      throws StatementExecutionException, IoTDBConnectionException;
+
+  SessionDataSetWrapper executeRawDataQuery(List<String> paths, long 
startTime, long endTime)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  boolean operationSyncTransmit(ByteBuffer buffer)
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  SystemStatus getSystemStatus() throws IoTDBConnectionException;
+
+  TSBackupConfigurationResp getBackupConfiguration()
+      throws IoTDBConnectionException, StatementExecutionException;
+
+  int getMaxSize();
+
+  String getHost();
+
+  int getPort();
+
+  String getUser();
+
+  String getPassword();
+
+  int getFetchSize();
+
+  ZoneId getZoneId();
+
+  long getWaitToGetSessionTimeoutInMs();
+
+  boolean isEnableCompression();
+
+  boolean isEnableCacheLeader();
+
+  int getConnectionTimeoutInMs();
+
+  TSConnectionInfoResp fetchAllConnections() throws IoTDBConnectionException;
+}
diff --git 
a/session/src/main/java/org/apache/iotdb/session/pool/SessionDataSetWrapper.java
 
b/isession/src/main/java/org/apache/iotdb/session/pool/SessionDataSetWrapper.java
similarity index 92%
rename from 
session/src/main/java/org/apache/iotdb/session/pool/SessionDataSetWrapper.java
rename to 
isession/src/main/java/org/apache/iotdb/session/pool/SessionDataSetWrapper.java
index e2e3b2c4d5..6674fc1cc6 100644
--- 
a/session/src/main/java/org/apache/iotdb/session/pool/SessionDataSetWrapper.java
+++ 
b/isession/src/main/java/org/apache/iotdb/session/pool/SessionDataSetWrapper.java
@@ -20,7 +20,7 @@ package org.apache.iotdb.session.pool;
 
 import org.apache.iotdb.rpc.IoTDBConnectionException;
 import org.apache.iotdb.rpc.StatementExecutionException;
-import org.apache.iotdb.session.Session;
+import org.apache.iotdb.session.ISession;
 import org.apache.iotdb.session.SessionDataSet;
 import org.apache.iotdb.session.SessionDataSet.DataIterator;
 import org.apache.iotdb.tsfile.read.common.RowRecord;
@@ -30,16 +30,16 @@ import java.util.List;
 public class SessionDataSetWrapper implements AutoCloseable {
 
   SessionDataSet sessionDataSet;
-  Session session;
-  SessionPool pool;
+  ISession session;
+  ISessionPool pool;
 
-  public SessionDataSetWrapper(SessionDataSet sessionDataSet, Session session, 
SessionPool pool) {
+  public SessionDataSetWrapper(SessionDataSet sessionDataSet, ISession 
session, ISessionPool pool) {
     this.sessionDataSet = sessionDataSet;
     this.session = session;
     this.pool = pool;
   }
 
-  protected Session getSession() {
+  protected ISession getSession() {
     return session;
   }
 
diff --git 
a/session/src/main/java/org/apache/iotdb/session/template/Template.java 
b/isession/src/main/java/org/apache/iotdb/session/template/Template.java
similarity index 100%
rename from 
session/src/main/java/org/apache/iotdb/session/template/Template.java
rename to isession/src/main/java/org/apache/iotdb/session/template/Template.java
diff --git 
a/session/src/main/java/org/apache/iotdb/session/template/TemplateNode.java 
b/isession/src/main/java/org/apache/iotdb/session/template/TemplateNode.java
similarity index 100%
rename from 
session/src/main/java/org/apache/iotdb/session/template/TemplateNode.java
rename to 
isession/src/main/java/org/apache/iotdb/session/template/TemplateNode.java
diff --git 
a/session/src/main/java/org/apache/iotdb/session/util/SystemStatus.java 
b/isession/src/main/java/org/apache/iotdb/session/util/SystemStatus.java
similarity index 100%
rename from 
session/src/main/java/org/apache/iotdb/session/util/SystemStatus.java
rename to isession/src/main/java/org/apache/iotdb/session/util/SystemStatus.java
diff --git a/session/src/main/java/org/apache/iotdb/session/util/Version.java 
b/isession/src/main/java/org/apache/iotdb/session/util/Version.java
similarity index 100%
rename from session/src/main/java/org/apache/iotdb/session/util/Version.java
rename to isession/src/main/java/org/apache/iotdb/session/util/Version.java
diff --git a/pom.xml b/pom.xml
index 82ba74b53e..4fad3011ab 100644
--- a/pom.xml
+++ b/pom.xml
@@ -111,6 +111,7 @@
         <module>integration</module>
         <module>rewriteFileTool</module>
         <module>external-api</module>
+        <module>isession</module>
         <!--        <module>library-udf</module>-->
     </modules>
     <!-- Properties Management -->
diff --git a/session/pom.xml b/session/pom.xml
index 9d8ace6413..4244fd2cb4 100644
--- a/session/pom.xml
+++ b/session/pom.xml
@@ -81,6 +81,11 @@
             <groupId>commons-io</groupId>
             <artifactId>commons-io</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.iotdb</groupId>
+            <artifactId>iotdb-isession</artifactId>
+            <version>${project.version}</version>
+        </dependency>
     </dependencies>
     <profiles>
         <profile>
diff --git a/session/src/main/java/org/apache/iotdb/session/Session.java 
b/session/src/main/java/org/apache/iotdb/session/Session.java
index f74ae07ff8..1cfb17503f 100644
--- a/session/src/main/java/org/apache/iotdb/session/Session.java
+++ b/session/src/main/java/org/apache/iotdb/session/Session.java
@@ -93,7 +93,7 @@ import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
 
 @SuppressWarnings({"java:S107", "java:S1135"}) // need enough parameters, 
ignore todos
-public class Session {
+public class Session implements ISession {
 
   private static final Logger logger = LoggerFactory.getLogger(Session.class);
   protected static final TSProtocolVersion protocolVersion =
@@ -357,18 +357,22 @@ public class Session {
     this.version = version;
   }
 
+  @Override
   public void setFetchSize(int fetchSize) {
     this.fetchSize = fetchSize;
   }
 
+  @Override
   public int getFetchSize() {
     return this.fetchSize;
   }
 
+  @Override
   public Version getVersion() {
     return version;
   }
 
+  @Override
   public void setVersion(Version version) {
     this.version = version;
   }
@@ -377,10 +381,12 @@ public class Session {
     open(false, Config.DEFAULT_CONNECTION_TIMEOUT_MS);
   }
 
+  @Override
   public synchronized void open(boolean enableRPCCompression) throws 
IoTDBConnectionException {
     open(enableRPCCompression, Config.DEFAULT_CONNECTION_TIMEOUT_MS);
   }
 
+  @Override
   public synchronized void open(boolean enableRPCCompression, int 
connectionTimeoutInMs)
       throws IoTDBConnectionException {
     if (!isClosed) {
@@ -400,6 +406,7 @@ public class Session {
     }
   }
 
+  @Override
   public synchronized void close() throws IoTDBConnectionException {
     if (isClosed) {
       return;
@@ -425,19 +432,23 @@ public class Session {
     return new SessionConnection(session, endpoint, zoneId);
   }
 
+  @Override
   public SystemStatus getSystemStatus() throws IoTDBConnectionException {
     return defaultSessionConnection.getSystemStatus();
   }
 
+  @Override
   public synchronized String getTimeZone() {
     return defaultSessionConnection.getTimeZone();
   }
 
+  @Override
   public synchronized void setTimeZone(String zoneId)
       throws StatementExecutionException, IoTDBConnectionException {
     defaultSessionConnection.setTimeZone(zoneId);
   }
 
+  @Override
   public void setStorageGroup(String storageGroup)
       throws IoTDBConnectionException, StatementExecutionException {
     try {
@@ -447,6 +458,7 @@ public class Session {
     }
   }
 
+  @Override
   public void deleteStorageGroup(String storageGroup)
       throws IoTDBConnectionException, StatementExecutionException {
     try {
@@ -456,6 +468,7 @@ public class Session {
     }
   }
 
+  @Override
   public void deleteStorageGroups(List<String> storageGroups)
       throws IoTDBConnectionException, StatementExecutionException {
     try {
@@ -465,6 +478,7 @@ public class Session {
     }
   }
 
+  @Override
   public void createTimeseries(
       String path, TSDataType dataType, TSEncoding encoding, CompressionType 
compressor)
       throws IoTDBConnectionException, StatementExecutionException {
@@ -473,6 +487,7 @@ public class Session {
     defaultSessionConnection.createTimeseries(request);
   }
 
+  @Override
   public void createTimeseries(
       String path,
       TSDataType dataType,
@@ -510,6 +525,7 @@ public class Session {
     return request;
   }
 
+  @Override
   public void createAlignedTimeseries(
       String deviceId,
       List<String> measurements,
@@ -542,6 +558,7 @@ public class Session {
     return request;
   }
 
+  @Override
   public void createMultiTimeseries(
       List<String> paths,
       List<TSDataType> dataTypes,
@@ -604,15 +621,18 @@ public class Session {
     return request;
   }
 
+  @Override
   public boolean checkTimeseriesExists(String path)
       throws IoTDBConnectionException, StatementExecutionException {
     return defaultSessionConnection.checkTimeseriesExists(path, 
queryTimeoutInMs);
   }
 
+  @Override
   public void setQueryTimeout(long timeoutInMs) {
     this.queryTimeoutInMs = timeoutInMs;
   }
 
+  @Override
   public long getQueryTimeout() {
     return queryTimeoutInMs;
   }
@@ -623,6 +643,7 @@ public class Session {
    * @param sql query statement
    * @return result set
    */
+  @Override
   public SessionDataSet executeQueryStatement(String sql)
       throws StatementExecutionException, IoTDBConnectionException {
     return executeStatementMayRedirect(sql, queryTimeoutInMs);
@@ -635,6 +656,7 @@ public class Session {
    * @param timeoutInMs the timeout of this query, in milliseconds
    * @return result set
    */
+  @Override
   public SessionDataSet executeQueryStatement(String sql, long timeoutInMs)
       throws StatementExecutionException, IoTDBConnectionException {
     return executeStatementMayRedirect(sql, timeoutInMs);
@@ -680,6 +702,7 @@ public class Session {
    *
    * @param sql non query statement
    */
+  @Override
   public void executeNonQueryStatement(String sql)
       throws IoTDBConnectionException, StatementExecutionException {
     defaultSessionConnection.executeNonQueryStatement(sql);
@@ -696,6 +719,7 @@ public class Session {
    * @throws StatementExecutionException statement is not right
    * @throws IoTDBConnectionException the network is not good
    */
+  @Override
   public SessionDataSet executeRawDataQuery(List<String> paths, long 
startTime, long endTime)
       throws StatementExecutionException, IoTDBConnectionException {
     try {
@@ -724,6 +748,7 @@ public class Session {
    * @param LastTime get the last data, whose timestamp is greater than or 
equal LastTime e.g.
    *     1621326244168
    */
+  @Override
   public SessionDataSet executeLastDataQuery(List<String> paths, long LastTime)
       throws StatementExecutionException, IoTDBConnectionException {
     try {
@@ -749,6 +774,7 @@ public class Session {
    *
    * @param paths timeSeries. eg.root.ln.d1.s1,root.ln.d1.s2
    */
+  @Override
   public SessionDataSet executeLastDataQuery(List<String> paths)
       throws StatementExecutionException, IoTDBConnectionException {
     long time = 0L;
@@ -762,6 +788,7 @@ public class Session {
    * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecord(
       String deviceId,
       long time,
@@ -815,6 +842,7 @@ public class Session {
     }
   }
 
+  @Override
   public String getTimestampPrecision() throws TException {
     return 
defaultSessionConnection.getClient().getProperties().getTimestampPrecision();
   }
@@ -922,6 +950,7 @@ public class Session {
    * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecord(
       String deviceId,
       long time,
@@ -952,6 +981,7 @@ public class Session {
    * @see Session#insertAlignedRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedRecord(
       String deviceId,
       long time,
@@ -1019,6 +1049,7 @@ public class Session {
    * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecord(
       String deviceId, long time, List<String> measurements, List<String> 
values)
       throws IoTDBConnectionException, StatementExecutionException {
@@ -1043,6 +1074,7 @@ public class Session {
    * @see Session#insertAlignedRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedRecord(
       String deviceId, long time, List<String> measurements, List<String> 
values)
       throws IoTDBConnectionException, StatementExecutionException {
@@ -1102,6 +1134,7 @@ public class Session {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecords(
       List<String> deviceIds,
       List<Long> times,
@@ -1354,6 +1387,7 @@ public class Session {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedRecords(
       List<String> deviceIds,
       List<Long> times,
@@ -1531,6 +1565,7 @@ public class Session {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecords(
       List<String> deviceIds,
       List<Long> times,
@@ -1581,6 +1616,7 @@ public class Session {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedRecords(
       List<String> deviceIds,
       List<Long> times,
@@ -1629,6 +1665,7 @@ public class Session {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -1649,6 +1686,7 @@ public class Session {
    * @param haveSorted deprecated, whether the times have been sorted
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -1692,6 +1730,7 @@ public class Session {
    *
    * @param haveSorted deprecated, whether the times have been sorted
    */
+  @Override
   public void insertStringRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -1732,6 +1771,7 @@ public class Session {
    * <p>Each row could have same deviceId but different time, number of 
measurements, number of
    * values as String
    */
+  @Override
   public void insertStringRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -1750,6 +1790,7 @@ public class Session {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -1771,6 +1812,7 @@ public class Session {
    * @param haveSorted deprecated, whether the times have been sorted
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -1814,6 +1856,7 @@ public class Session {
    *
    * @param haveSorted deprecated, whether the times have been sorted
    */
+  @Override
   public void insertAlignedStringRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -1856,6 +1899,7 @@ public class Session {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedStringRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -2123,6 +2167,7 @@ public class Session {
    *
    * @param tablet data batch
    */
+  @Override
   public void insertTablet(Tablet tablet)
       throws StatementExecutionException, IoTDBConnectionException {
     insertTablet(tablet, false);
@@ -2134,6 +2179,7 @@ public class Session {
    * @param tablet data batch
    * @param sorted deprecated, whether times in Tablet are in ascending order
    */
+  @Override
   public void insertTablet(Tablet tablet, boolean sorted)
       throws IoTDBConnectionException, StatementExecutionException {
     TSInsertTabletReq request = genTSInsertTabletReq(tablet, sorted, false);
@@ -2154,6 +2200,7 @@ public class Session {
    *
    * @param tablet data batch
    */
+  @Override
   public void insertAlignedTablet(Tablet tablet)
       throws StatementExecutionException, IoTDBConnectionException {
     insertAlignedTablet(tablet, false);
@@ -2165,6 +2212,7 @@ public class Session {
    * @param tablet data batch
    * @param sorted deprecated, whether times in Tablet are in ascending order
    */
+  @Override
   public void insertAlignedTablet(Tablet tablet, boolean sorted)
       throws IoTDBConnectionException, StatementExecutionException {
     TSInsertTabletReq request = genTSInsertTabletReq(tablet, sorted, true);
@@ -2204,6 +2252,7 @@ public class Session {
    *
    * @param tablets data batch in multiple device
    */
+  @Override
   public void insertTablets(Map<String, Tablet> tablets)
       throws IoTDBConnectionException, StatementExecutionException {
     insertTablets(tablets, false);
@@ -2216,6 +2265,7 @@ public class Session {
    * @param tablets data batch in multiple device
    * @param sorted deprecated, whether times in each Tablet are in ascending 
order
    */
+  @Override
   public void insertTablets(Map<String, Tablet> tablets, boolean sorted)
       throws IoTDBConnectionException, StatementExecutionException {
     if (enableCacheLeader) {
@@ -2242,6 +2292,7 @@ public class Session {
    *
    * @param tablets data batch in multiple device
    */
+  @Override
   public void insertAlignedTablets(Map<String, Tablet> tablets)
       throws IoTDBConnectionException, StatementExecutionException {
     insertAlignedTablets(tablets, false);
@@ -2254,6 +2305,7 @@ public class Session {
    * @param tablets data batch in multiple device
    * @param sorted deprecated, whether times in each Tablet are in ascending 
order
    */
+  @Override
   public void insertAlignedTablets(Map<String, Tablet> tablets, boolean sorted)
       throws IoTDBConnectionException, StatementExecutionException {
     if (enableCacheLeader) {
@@ -2323,6 +2375,7 @@ public class Session {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertTablet(Tablet tablet)
       throws IoTDBConnectionException, StatementExecutionException {
     testInsertTablet(tablet, false);
@@ -2332,6 +2385,7 @@ public class Session {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertTablet(Tablet tablet, boolean sorted)
       throws IoTDBConnectionException, StatementExecutionException {
     TSInsertTabletReq request = genTSInsertTabletReq(tablet, sorted, false);
@@ -2342,6 +2396,7 @@ public class Session {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertTablets(Map<String, Tablet> tablets)
       throws IoTDBConnectionException, StatementExecutionException {
     testInsertTablets(tablets, false);
@@ -2351,6 +2406,7 @@ public class Session {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertTablets(Map<String, Tablet> tablets, boolean sorted)
       throws IoTDBConnectionException, StatementExecutionException {
     TSInsertTabletsReq request =
@@ -2362,6 +2418,7 @@ public class Session {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertRecords(
       List<String> deviceIds,
       List<Long> times,
@@ -2389,6 +2446,7 @@ public class Session {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertRecords(
       List<String> deviceIds,
       List<Long> times,
@@ -2417,6 +2475,7 @@ public class Session {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertRecord(
       String deviceId, long time, List<String> measurements, List<String> 
values)
       throws IoTDBConnectionException, StatementExecutionException {
@@ -2438,6 +2497,7 @@ public class Session {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertRecord(
       String deviceId,
       long time,
@@ -2464,6 +2524,7 @@ public class Session {
    *
    * @param path timeseries to delete, should be a whole path
    */
+  @Override
   public void deleteTimeseries(String path)
       throws IoTDBConnectionException, StatementExecutionException {
     defaultSessionConnection.deleteTimeseries(Collections.singletonList(path));
@@ -2474,6 +2535,7 @@ public class Session {
    *
    * @param paths timeseries to delete, should be a whole path
    */
+  @Override
   public void deleteTimeseries(List<String> paths)
       throws IoTDBConnectionException, StatementExecutionException {
     defaultSessionConnection.deleteTimeseries(paths);
@@ -2485,6 +2547,7 @@ public class Session {
    * @param path data in which time series to delete
    * @param endTime data with time stamp less than or equal to time will be 
deleted
    */
+  @Override
   public void deleteData(String path, long endTime)
       throws IoTDBConnectionException, StatementExecutionException {
     deleteData(Collections.singletonList(path), Long.MIN_VALUE, endTime);
@@ -2496,6 +2559,7 @@ public class Session {
    * @param paths data in which time series to delete
    * @param endTime data with time stamp less than or equal to time will be 
deleted
    */
+  @Override
   public void deleteData(List<String> paths, long endTime)
       throws IoTDBConnectionException, StatementExecutionException {
     deleteData(paths, Long.MIN_VALUE, endTime);
@@ -2508,6 +2572,7 @@ public class Session {
    * @param startTime delete range start time
    * @param endTime delete range end time
    */
+  @Override
   public void deleteData(List<String> paths, long startTime, long endTime)
       throws IoTDBConnectionException, StatementExecutionException {
     TSDeleteDataReq request = genTSDeleteDataReq(paths, startTime, endTime);
@@ -2663,6 +2728,7 @@ public class Session {
     return sortedBitMap;
   }
 
+  @Override
   public void setSchemaTemplate(String templateName, String prefixPath)
       throws IoTDBConnectionException, StatementExecutionException {
     TSSetSchemaTemplateReq request = getTSSetSchemaTemplateReq(templateName, 
prefixPath);
@@ -2683,6 +2749,7 @@ public class Session {
    *
    * @see Template
    */
+  @Override
   public void createSchemaTemplate(Template template)
       throws IOException, IoTDBConnectionException, 
StatementExecutionException {
     TSCreateSchemaTemplateReq req = new TSCreateSchemaTemplateReq();
@@ -2705,6 +2772,7 @@ public class Session {
    * @param compressors compression type of each measurement in the template
    * @param isAligned specify whether these flat measurements are aligned
    */
+  @Override
   public void createSchemaTemplate(
       String templateName,
       List<String> measurements,
@@ -2748,6 +2816,7 @@ public class Session {
    * @throws StatementExecutionException
    */
   @Deprecated
+  @Override
   public void createSchemaTemplate(
       String name,
       List<String> schemaNames,
@@ -2780,6 +2849,7 @@ public class Session {
    * @param encodings Encoding of these measurements.
    * @param compressors CompressionType of these measurements.
    */
+  @Override
   public void addAlignedMeasurementsInTemplate(
       String templateName,
       List<String> measurementsPath,
@@ -2803,6 +2873,7 @@ public class Session {
    * @param measurementPath If prefix of the path exists in template and not 
aligned, throw
    *     exception.
    */
+  @Override
   public void addAlignedMeasurementInTemplate(
       String templateName,
       String measurementPath,
@@ -2824,6 +2895,7 @@ public class Session {
    * @param templateName Template to add unaligned measurements.
    * @param measurementsPath If prefix of any path exist in template but 
aligned, throw exception.
    */
+  @Override
   public void addUnalignedMeasurementsInTemplate(
       String templateName,
       List<String> measurementsPath,
@@ -2846,6 +2918,7 @@ public class Session {
    * @param templateName Template to add a single unaligned measurement.
    * @param measurementPath If prefix of path exists in template but aligned, 
throw exception.
    */
+  @Override
   public void addUnalignedMeasurementInTemplate(
       String templateName,
       String measurementPath,
@@ -2867,6 +2940,7 @@ public class Session {
    * @param templateName Template to prune.
    * @param path Remove node from template specified by the path, including 
its children nodes.
    */
+  @Override
   public void deleteNodeInTemplate(String templateName, String path)
       throws IOException, IoTDBConnectionException, 
StatementExecutionException {
     TSPruneSchemaTemplateReq req = new TSPruneSchemaTemplateReq();
@@ -2876,6 +2950,7 @@ public class Session {
   }
 
   /** @return Amount of measurements in the template */
+  @Override
   public int countMeasurementsInTemplate(String name)
       throws StatementExecutionException, IoTDBConnectionException {
     TSQueryTemplateReq req = new TSQueryTemplateReq();
@@ -2886,6 +2961,7 @@ public class Session {
   }
 
   /** @return If the node specified by the path is a measurement. */
+  @Override
   public boolean isMeasurementInTemplate(String templateName, String path)
       throws StatementExecutionException, IoTDBConnectionException {
     TSQueryTemplateReq req = new TSQueryTemplateReq();
@@ -2897,6 +2973,7 @@ public class Session {
   }
 
   /** @return if there is a node correspond to the path in the template. */
+  @Override
   public boolean isPathExistInTemplate(String templateName, String path)
       throws StatementExecutionException, IoTDBConnectionException {
     TSQueryTemplateReq req = new TSQueryTemplateReq();
@@ -2908,6 +2985,7 @@ public class Session {
   }
 
   /** @return All paths of measurements in the template. */
+  @Override
   public List<String> showMeasurementsInTemplate(String templateName)
       throws StatementExecutionException, IoTDBConnectionException {
     TSQueryTemplateReq req = new TSQueryTemplateReq();
@@ -2919,6 +2997,7 @@ public class Session {
   }
 
   /** @return All paths of measurements under the pattern in the template. */
+  @Override
   public List<String> showMeasurementsInTemplate(String templateName, String 
pattern)
       throws StatementExecutionException, IoTDBConnectionException {
     TSQueryTemplateReq req = new TSQueryTemplateReq();
@@ -2930,6 +3009,7 @@ public class Session {
   }
 
   /** @return All template names. */
+  @Override
   public List<String> showAllTemplates()
       throws StatementExecutionException, IoTDBConnectionException {
     TSQueryTemplateReq req = new TSQueryTemplateReq();
@@ -2940,6 +3020,7 @@ public class Session {
   }
 
   /** @return All paths have been set to designated template. */
+  @Override
   public List<String> showPathsTemplateSetOn(String templateName)
       throws StatementExecutionException, IoTDBConnectionException {
     TSQueryTemplateReq req = new TSQueryTemplateReq();
@@ -2950,6 +3031,7 @@ public class Session {
   }
 
   /** @return All paths are using designated template. */
+  @Override
   public List<String> showPathsTemplateUsingOn(String templateName)
       throws StatementExecutionException, IoTDBConnectionException {
     TSQueryTemplateReq req = new TSQueryTemplateReq();
@@ -2959,6 +3041,7 @@ public class Session {
     return resp.getMeasurements();
   }
 
+  @Override
   public void unsetSchemaTemplate(String prefixPath, String templateName)
       throws IoTDBConnectionException, StatementExecutionException {
     TSUnsetSchemaTemplateReq request = getTSUnsetSchemaTemplateReq(prefixPath, 
templateName);
@@ -2966,6 +3049,7 @@ public class Session {
   }
 
   /** Set designated path using template, act like the sql-statement with same 
name and syntax. */
+  @Override
   public void createTimeseriesOfTemplateOnPath(String path)
       throws IoTDBConnectionException, StatementExecutionException {
     TSSetUsingTemplateReq request = new TSSetUsingTemplateReq();
@@ -2974,11 +3058,13 @@ public class Session {
   }
 
   /** Inverse of {@linkplain #createTimeseriesOfTemplateOnPath}, IMPLYING data 
deletion. */
+  @Override
   public void deactivateTemplateOn(String templateName, String prefixPath)
       throws IoTDBConnectionException, StatementExecutionException {
     defaultSessionConnection.deactivateTemplate(templateName, prefixPath);
   }
 
+  @Override
   public void dropSchemaTemplate(String templateName)
       throws IoTDBConnectionException, StatementExecutionException {
     TSDropSchemaTemplateReq request = getTSDropSchemaTemplateReq(templateName);
@@ -3073,6 +3159,7 @@ public class Session {
   }
 
   /** Transmit insert record request for operation sync */
+  @Override
   public void operationSyncTransmit(ByteBuffer buffer)
       throws IoTDBConnectionException, StatementExecutionException {
     try {
@@ -3090,27 +3177,33 @@ public class Session {
     return request;
   }
 
+  @Override
   public boolean isEnableQueryRedirection() {
     return enableQueryRedirection;
   }
 
+  @Override
   public void setEnableQueryRedirection(boolean enableQueryRedirection) {
     this.enableQueryRedirection = enableQueryRedirection;
   }
 
+  @Override
   public boolean isEnableCacheLeader() {
     return enableCacheLeader;
   }
 
+  @Override
   public void setEnableCacheLeader(boolean enableCacheLeader) {
     this.enableCacheLeader = enableCacheLeader;
   }
 
+  @Override
   public TSBackupConfigurationResp getBackupConfiguration()
       throws IoTDBConnectionException, StatementExecutionException {
     return defaultSessionConnection.getBackupConfiguration();
   }
 
+  @Override
   public TSConnectionInfoResp fetchAllConnections() throws 
IoTDBConnectionException {
     return defaultSessionConnection.fetchAllConnections();
   }
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 711f7f66df..929e1d107c 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
@@ -23,6 +23,7 @@ import org.apache.iotdb.rpc.StatementExecutionException;
 import org.apache.iotdb.service.rpc.thrift.TSBackupConfigurationResp;
 import org.apache.iotdb.service.rpc.thrift.TSConnectionInfoResp;
 import org.apache.iotdb.session.Config;
+import org.apache.iotdb.session.ISession;
 import org.apache.iotdb.session.Session;
 import org.apache.iotdb.session.SessionDataSet;
 import org.apache.iotdb.session.template.Template;
@@ -65,7 +66,7 @@ import java.util.concurrent.ConcurrentMap;
  * <p>Another case that you have to manually call closeResultSet() is that 
when there is exception
  * when you call SessionDataSetWrapper.hasNext() or next()
  */
-public class SessionPool {
+public class SessionPool implements ISessionPool {
 
   private static final Logger logger = 
LoggerFactory.getLogger(SessionPool.class);
   public static final String SESSION_POOL_IS_CLOSED = "Session pool is closed";
@@ -74,9 +75,9 @@ public class SessionPool {
   private static final int RETRY = 3;
   private static final int FINAL_RETRY = RETRY - 1;
 
-  private final ConcurrentLinkedDeque<Session> queue = new 
ConcurrentLinkedDeque<>();
+  private final ConcurrentLinkedDeque<ISession> queue = new 
ConcurrentLinkedDeque<>();
   // for session whose resultSet is not released.
-  private final ConcurrentMap<Session, Session> occupied = new 
ConcurrentHashMap<>();
+  private final ConcurrentMap<ISession, ISession> occupied = new 
ConcurrentHashMap<>();
   private int size = 0;
   private int maxSize = 0;
   private final long waitToGetSessionTimeoutInMs;
@@ -317,8 +318,8 @@ public class SessionPool {
   // if this method throws an exception, either the server is broken, or the 
ip/port/user/password
   // is incorrect.
   @SuppressWarnings({"squid:S3776", "squid:S2446"}) // Suppress high Cognitive 
Complexity warning
-  private Session getSession() throws IoTDBConnectionException {
-    Session session = queue.poll();
+  private ISession getSession() throws IoTDBConnectionException {
+    ISession session = queue.poll();
     if (closed) {
       throw new IoTDBConnectionException(SESSION_POOL_IS_CLOSED);
     }
@@ -417,16 +418,18 @@ public class SessionPool {
     return session;
   }
 
+  @Override
   public int currentAvailableSize() {
     return queue.size();
   }
 
+  @Override
   public int currentOccupiedSize() {
     return occupied.size();
   }
 
   @SuppressWarnings({"squid:S2446"})
-  private void putBack(Session session) {
+  private void putBack(ISession session) {
     queue.push(session);
     synchronized (this) {
       // we do not need to notifyAll as any waited thread can continue to work 
after waked up.
@@ -439,13 +442,14 @@ public class SessionPool {
     }
   }
 
-  private void occupy(Session session) {
+  private void occupy(ISession session) {
     occupied.put(session, session);
   }
 
+  @Override
   /** close all connections in the pool */
   public synchronized void close() {
-    for (Session session : queue) {
+    for (ISession session : queue) {
       try {
         session.close();
       } catch (IoTDBConnectionException e) {
@@ -453,7 +457,7 @@ public class SessionPool {
         logger.warn(CLOSE_THE_SESSION_FAILED, e);
       }
     }
-    for (Session session : occupied.keySet()) {
+    for (ISession session : occupied.keySet()) {
       try {
         session.close();
       } catch (IoTDBConnectionException e) {
@@ -467,6 +471,7 @@ public class SessionPool {
     occupied.clear();
   }
 
+  @Override
   public void closeResultSet(SessionDataSetWrapper wrapper) {
     boolean putback = true;
     try {
@@ -475,7 +480,7 @@ public class SessionPool {
       tryConstructNewSession();
       putback = false;
     } finally {
-      Session session = occupied.remove(wrapper.session);
+      ISession session = occupied.remove(wrapper.session);
       if (putback && session != null) {
         putBack(wrapper.session);
       }
@@ -509,7 +514,7 @@ public class SessionPool {
     }
   }
 
-  private void closeSession(Session session) {
+  private void closeSession(ISession session) {
     if (session != null) {
       try {
         session.close();
@@ -521,7 +526,7 @@ public class SessionPool {
   }
 
   private void cleanSessionAndMayThrowConnectionException(
-      Session session, int times, IoTDBConnectionException e) throws 
IoTDBConnectionException {
+      ISession session, int times, IoTDBConnectionException e) throws 
IoTDBConnectionException {
     closeSession(session);
     tryConstructNewSession();
     if (times == FINAL_RETRY) {
@@ -532,12 +537,12 @@ public class SessionPool {
           e);
     }
   }
-
   /**
    * insert the data of a device. For each timestamp, the number of 
measurements is the same.
    *
    * @param tablet data batch
    */
+  @Override
   public void insertTablet(Tablet tablet)
       throws IoTDBConnectionException, StatementExecutionException {
     /*
@@ -553,6 +558,7 @@ public class SessionPool {
     insertTablet(tablet, false);
   }
 
+  @Override
   /**
    * insert the data of a device. For each timestamp, the number of 
measurements is the same.
    *
@@ -573,7 +579,7 @@ public class SessionPool {
      */
 
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertTablet(tablet, sorted);
         putBack(session);
@@ -589,6 +595,7 @@ public class SessionPool {
     }
   }
 
+  @Override
   /**
    * insert the data of a device. For each timestamp, the number of 
measurements is the same.
    *
@@ -600,7 +607,6 @@ public class SessionPool {
       throws IoTDBConnectionException, StatementExecutionException {
     insertAlignedTablet(tablet, false);
   }
-
   /**
    * insert the data of a device. For each timestamp, the number of 
measurements is the same.
    *
@@ -609,10 +615,11 @@ public class SessionPool {
    * @param tablet a tablet data of one device
    * @param sorted whether times in Tablet are in ascending order
    */
+  @Override
   public void insertAlignedTablet(Tablet tablet, boolean sorted)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertAlignedTablet(tablet, sorted);
         putBack(session);
@@ -627,36 +634,36 @@ public class SessionPool {
       }
     }
   }
-
   /**
    * use batch interface to insert data
    *
    * @param tablets multiple batch
    */
+  @Override
   public void insertTablets(Map<String, Tablet> tablets)
       throws IoTDBConnectionException, StatementExecutionException {
     insertTablets(tablets, false);
   }
-
   /**
    * use batch interface to insert data
    *
    * @param tablets multiple batch
    */
+  @Override
   public void insertAlignedTablets(Map<String, Tablet> tablets)
       throws IoTDBConnectionException, StatementExecutionException {
     insertAlignedTablets(tablets, false);
   }
-
   /**
    * use batch interface to insert aligned data
    *
    * @param tablets multiple batch
    */
+  @Override
   public void insertTablets(Map<String, Tablet> tablets, boolean sorted)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertTablets(tablets, sorted);
         putBack(session);
@@ -677,10 +684,11 @@ public class SessionPool {
    *
    * @param tablets multiple batch
    */
+  @Override
   public void insertAlignedTablets(Map<String, Tablet> tablets, boolean sorted)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertAlignedTablets(tablets, sorted);
         putBack(session);
@@ -703,6 +711,7 @@ public class SessionPool {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecords(
       List<String> deviceIds,
       List<Long> times,
@@ -711,7 +720,7 @@ public class SessionPool {
       List<List<Object>> valuesList)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertRecords(deviceIds, times, measurementsList, typesList, 
valuesList);
         putBack(session);
@@ -734,6 +743,7 @@ public class SessionPool {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedRecords(
       List<String> multiSeriesIds,
       List<Long> times,
@@ -742,7 +752,7 @@ public class SessionPool {
       List<List<Object>> valuesList)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertAlignedRecords(
             multiSeriesIds, times, multiMeasurementComponentsList, typesList, 
valuesList);
@@ -766,6 +776,7 @@ public class SessionPool {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -774,7 +785,7 @@ public class SessionPool {
       List<List<Object>> valuesList)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertRecordsOfOneDevice(
             deviceId, times, measurementsList, typesList, valuesList, false);
@@ -799,6 +810,7 @@ public class SessionPool {
    * @see Session#insertTablet(Tablet)
    */
   @Deprecated
+  @Override
   public void insertOneDeviceRecords(
       String deviceId,
       List<Long> times,
@@ -807,7 +819,7 @@ public class SessionPool {
       List<List<Object>> valuesList)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertRecordsOfOneDevice(
             deviceId, times, measurementsList, typesList, valuesList, false);
@@ -832,6 +844,7 @@ public class SessionPool {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertStringRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -839,7 +852,7 @@ public class SessionPool {
       List<List<String>> valuesList)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertStringRecordsOfOneDevice(
             deviceId, times, measurementsList, valuesList, false);
@@ -864,6 +877,7 @@ public class SessionPool {
    * @param haveSorted whether the times list has been ordered.
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -873,7 +887,7 @@ public class SessionPool {
       boolean haveSorted)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertRecordsOfOneDevice(
             deviceId, times, measurementsList, typesList, valuesList, 
haveSorted);
@@ -899,6 +913,7 @@ public class SessionPool {
    * @see Session#insertTablet(Tablet)
    */
   @Deprecated
+  @Override
   public void insertOneDeviceRecords(
       String deviceId,
       List<Long> times,
@@ -908,7 +923,7 @@ public class SessionPool {
       boolean haveSorted)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertRecordsOfOneDevice(
             deviceId, times, measurementsList, typesList, valuesList, 
haveSorted);
@@ -934,6 +949,7 @@ public class SessionPool {
    * @param haveSorted whether the times list has been ordered.
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertStringRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -942,7 +958,7 @@ public class SessionPool {
       boolean haveSorted)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertStringRecordsOfOneDevice(
             deviceId, times, measurementsList, valuesList, haveSorted);
@@ -967,6 +983,7 @@ public class SessionPool {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -975,7 +992,7 @@ public class SessionPool {
       List<List<Object>> valuesList)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertAlignedRecordsOfOneDevice(
             deviceId, times, measurementsList, typesList, valuesList, false);
@@ -1000,6 +1017,7 @@ public class SessionPool {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedStringRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -1007,7 +1025,7 @@ public class SessionPool {
       List<List<String>> valuesList)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertAlignedStringRecordsOfOneDevice(
             deviceId, times, measurementsList, valuesList);
@@ -1033,6 +1051,7 @@ public class SessionPool {
    * @param haveSorted whether the times list has been ordered.
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -1042,7 +1061,7 @@ public class SessionPool {
       boolean haveSorted)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertAlignedRecordsOfOneDevice(
             deviceId, times, measurementsList, typesList, valuesList, 
haveSorted);
@@ -1068,6 +1087,7 @@ public class SessionPool {
    * @param haveSorted whether the times list has been ordered.
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedStringRecordsOfOneDevice(
       String deviceId,
       List<Long> times,
@@ -1076,7 +1096,7 @@ public class SessionPool {
       boolean haveSorted)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertAlignedStringRecordsOfOneDevice(
             deviceId, times, measurementsList, valuesList, haveSorted);
@@ -1100,6 +1120,7 @@ public class SessionPool {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecords(
       List<String> deviceIds,
       List<Long> times,
@@ -1107,7 +1128,7 @@ public class SessionPool {
       List<List<String>> valuesList)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertRecords(deviceIds, times, measurementsList, valuesList);
         putBack(session);
@@ -1130,6 +1151,7 @@ public class SessionPool {
    *
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedRecords(
       List<String> multiSeriesIds,
       List<Long> times,
@@ -1137,7 +1159,7 @@ public class SessionPool {
       List<List<String>> valuesList)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertAlignedRecords(
             multiSeriesIds, times, multiMeasurementComponentsList, valuesList);
@@ -1161,6 +1183,7 @@ public class SessionPool {
    * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecord(
       String deviceId,
       long time,
@@ -1169,7 +1192,7 @@ public class SessionPool {
       List<Object> values)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertRecord(deviceId, time, measurements, types, values);
         putBack(session);
@@ -1192,6 +1215,7 @@ public class SessionPool {
    * @see Session#insertAlignedRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedRecord(
       String multiSeriesId,
       long time,
@@ -1200,7 +1224,7 @@ public class SessionPool {
       List<Object> values)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertAlignedRecord(multiSeriesId, time, 
multiMeasurementComponents, types, values);
         putBack(session);
@@ -1223,11 +1247,12 @@ public class SessionPool {
    * @see Session#insertRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertRecord(
       String deviceId, long time, List<String> measurements, List<String> 
values)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertRecord(deviceId, time, measurements, values);
         putBack(session);
@@ -1250,11 +1275,12 @@ public class SessionPool {
    * @see Session#insertAlignedRecords(List, List, List, List, List)
    * @see Session#insertTablet(Tablet)
    */
+  @Override
   public void insertAlignedRecord(
       String multiSeriesId, long time, List<String> 
multiMeasurementComponents, List<String> values)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.insertAlignedRecord(multiSeriesId, time, 
multiMeasurementComponents, values);
         putBack(session);
@@ -1274,10 +1300,11 @@ public class SessionPool {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertTablet(Tablet tablet)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.testInsertTablet(tablet);
         putBack(session);
@@ -1297,10 +1324,11 @@ public class SessionPool {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertTablets(Map<String, Tablet> tablets)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.testInsertTablets(tablets);
         putBack(session);
@@ -1320,6 +1348,7 @@ public class SessionPool {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertRecords(
       List<String> deviceIds,
       List<Long> times,
@@ -1327,7 +1356,7 @@ public class SessionPool {
       List<List<String>> valuesList)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.testInsertRecords(deviceIds, times, measurementsList, 
valuesList);
         putBack(session);
@@ -1347,6 +1376,7 @@ public class SessionPool {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertRecords(
       List<String> deviceIds,
       List<Long> times,
@@ -1355,7 +1385,7 @@ public class SessionPool {
       List<List<Object>> valuesList)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.testInsertRecords(deviceIds, times, measurementsList, 
typesList, valuesList);
         putBack(session);
@@ -1375,11 +1405,12 @@ public class SessionPool {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertRecord(
       String deviceId, long time, List<String> measurements, List<String> 
values)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.testInsertRecord(deviceId, time, measurements, values);
         putBack(session);
@@ -1399,6 +1430,7 @@ public class SessionPool {
    * This method NOT insert data into database and the server just return 
after accept the request,
    * this method should be used to test other time cost in client
    */
+  @Override
   public void testInsertRecord(
       String deviceId,
       long time,
@@ -1407,7 +1439,7 @@ public class SessionPool {
       List<Object> values)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.testInsertRecord(deviceId, time, measurements, types, values);
         putBack(session);
@@ -1428,10 +1460,11 @@ public class SessionPool {
    *
    * @param path timeseries to delete, should be a whole path
    */
+  @Override
   public void deleteTimeseries(String path)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.deleteTimeseries(path);
         putBack(session);
@@ -1452,10 +1485,11 @@ public class SessionPool {
    *
    * @param paths timeseries to delete, should be a whole path
    */
+  @Override
   public void deleteTimeseries(List<String> paths)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.deleteTimeseries(paths);
         putBack(session);
@@ -1477,10 +1511,11 @@ public class SessionPool {
    * @param path data in which time series to delete
    * @param time data with time stamp less than or equal to time will be 
deleted
    */
+  @Override
   public void deleteData(String path, long time)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.deleteData(path, time);
         putBack(session);
@@ -1502,10 +1537,11 @@ public class SessionPool {
    * @param paths data in which time series to delete
    * @param time data with time stamp less than or equal to time will be 
deleted
    */
+  @Override
   public void deleteData(List<String> paths, long time)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.deleteData(paths, time);
         putBack(session);
@@ -1528,10 +1564,11 @@ public class SessionPool {
    * @param startTime delete range start time
    * @param endTime delete range end time
    */
+  @Override
   public void deleteData(List<String> paths, long startTime, long endTime)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.deleteData(paths, startTime, endTime);
         putBack(session);
@@ -1547,10 +1584,11 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void setStorageGroup(String storageGroupId)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.setStorageGroup(storageGroupId);
         putBack(session);
@@ -1566,10 +1604,11 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void deleteStorageGroup(String storageGroup)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.deleteStorageGroup(storageGroup);
         putBack(session);
@@ -1585,10 +1624,11 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void deleteStorageGroups(List<String> storageGroup)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.deleteStorageGroups(storageGroup);
         putBack(session);
@@ -1604,11 +1644,12 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void createTimeseries(
       String path, TSDataType dataType, TSEncoding encoding, CompressionType 
compressor)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.createTimeseries(path, dataType, encoding, compressor);
         putBack(session);
@@ -1624,6 +1665,7 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void createTimeseries(
       String path,
       TSDataType dataType,
@@ -1635,7 +1677,7 @@ public class SessionPool {
       String measurementAlias)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.createTimeseries(
             path, dataType, encoding, compressor, props, tags, attributes, 
measurementAlias);
@@ -1652,6 +1694,7 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void createMultiTimeseries(
       List<String> paths,
       List<TSDataType> dataTypes,
@@ -1663,7 +1706,7 @@ public class SessionPool {
       List<String> measurementAliasList)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.createMultiTimeseries(
             paths,
@@ -1687,10 +1730,11 @@ public class SessionPool {
     }
   }
 
+  @Override
   public boolean checkTimeseriesExists(String path)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         boolean resp = session.checkTimeseriesExists(path);
         putBack(session);
@@ -1708,6 +1752,7 @@ public class SessionPool {
     return false;
   }
 
+  @Override
   /**
    * Construct Template at session and create it at server.
    *
@@ -1716,7 +1761,7 @@ public class SessionPool {
   public void createSchemaTemplate(Template template)
       throws IOException, IoTDBConnectionException, 
StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.createSchemaTemplate(template);
         putBack(session);
@@ -1743,6 +1788,7 @@ public class SessionPool {
    * @param compressors compression type of each measurement in the template
    * @param isAligned specify whether these flat measurements are aligned
    */
+  @Override
   public void createSchemaTemplate(
       String templateName,
       List<String> measurements,
@@ -1752,7 +1798,7 @@ public class SessionPool {
       boolean isAligned)
       throws IOException, IoTDBConnectionException, 
StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.createSchemaTemplate(
             templateName, measurements, dataTypes, encodings, compressors, 
isAligned);
@@ -1788,6 +1834,7 @@ public class SessionPool {
    * @throws StatementExecutionException
    */
   @Deprecated
+  @Override
   public void createSchemaTemplate(
       String name,
       List<String> schemaNames,
@@ -1797,7 +1844,7 @@ public class SessionPool {
       List<CompressionType> compressors)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.createSchemaTemplate(
             name, schemaNames, measurements, dataTypes, encodings, 
compressors);
@@ -1814,6 +1861,7 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void addAlignedMeasurementsInTemplate(
       String templateName,
       List<String> measurementsPath,
@@ -1822,7 +1870,7 @@ public class SessionPool {
       List<CompressionType> compressors)
       throws IOException, IoTDBConnectionException, 
StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.addAlignedMeasurementsInTemplate(
             templateName, measurementsPath, dataTypes, encodings, compressors);
@@ -1839,6 +1887,7 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void addAlignedMeasurementInTemplate(
       String templateName,
       String measurementPath,
@@ -1847,7 +1896,7 @@ public class SessionPool {
       CompressionType compressor)
       throws IOException, IoTDBConnectionException, 
StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.addAlignedMeasurementInTemplate(
             templateName, measurementPath, dataType, encoding, compressor);
@@ -1864,6 +1913,7 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void addUnalignedMeasurementsInTemplate(
       String templateName,
       List<String> measurementsPath,
@@ -1872,7 +1922,7 @@ public class SessionPool {
       List<CompressionType> compressors)
       throws IOException, IoTDBConnectionException, 
StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.addUnalignedMeasurementsInTemplate(
             templateName, measurementsPath, dataTypes, encodings, compressors);
@@ -1889,6 +1939,7 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void addUnalignedMeasurementInTemplate(
       String templateName,
       String measurementPath,
@@ -1897,7 +1948,7 @@ public class SessionPool {
       CompressionType compressor)
       throws IOException, IoTDBConnectionException, 
StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.addUnalignedMeasurementInTemplate(
             templateName, measurementPath, dataType, encoding, compressor);
@@ -1914,10 +1965,11 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void deleteNodeInTemplate(String templateName, String path)
       throws IOException, IoTDBConnectionException, 
StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.deleteNodeInTemplate(templateName, path);
         putBack(session);
@@ -1933,10 +1985,11 @@ public class SessionPool {
     }
   }
 
+  @Override
   public int countMeasurementsInTemplate(String name)
       throws StatementExecutionException, IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         int resp = session.countMeasurementsInTemplate(name);
         putBack(session);
@@ -1953,10 +2006,11 @@ public class SessionPool {
     return -1;
   }
 
+  @Override
   public boolean isMeasurementInTemplate(String templateName, String path)
       throws StatementExecutionException, IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         boolean resp = session.isMeasurementInTemplate(templateName, path);
         putBack(session);
@@ -1973,10 +2027,11 @@ public class SessionPool {
     return false;
   }
 
+  @Override
   public boolean isPathExistInTemplate(String templateName, String path)
       throws StatementExecutionException, IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         boolean resp = session.isPathExistInTemplate(templateName, path);
         putBack(session);
@@ -1993,10 +2048,11 @@ public class SessionPool {
     return false;
   }
 
+  @Override
   public List<String> showMeasurementsInTemplate(String templateName)
       throws StatementExecutionException, IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         List<String> resp = session.showMeasurementsInTemplate(templateName);
         putBack(session);
@@ -2013,10 +2069,11 @@ public class SessionPool {
     return null;
   }
 
+  @Override
   public List<String> showMeasurementsInTemplate(String templateName, String 
pattern)
       throws StatementExecutionException, IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         List<String> resp = session.showMeasurementsInTemplate(templateName, 
pattern);
         putBack(session);
@@ -2033,10 +2090,11 @@ public class SessionPool {
     return null;
   }
 
+  @Override
   public List<String> showAllTemplates()
       throws StatementExecutionException, IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         List<String> resp = session.showAllTemplates();
         putBack(session);
@@ -2053,10 +2111,11 @@ public class SessionPool {
     return null;
   }
 
+  @Override
   public List<String> showPathsTemplateSetOn(String templateName)
       throws StatementExecutionException, IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         List<String> resp = session.showPathsTemplateSetOn(templateName);
         putBack(session);
@@ -2073,10 +2132,11 @@ public class SessionPool {
     return null;
   }
 
+  @Override
   public List<String> showPathsTemplateUsingOn(String templateName)
       throws StatementExecutionException, IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         List<String> resp = session.showPathsTemplateUsingOn(templateName);
         putBack(session);
@@ -2093,10 +2153,11 @@ public class SessionPool {
     return null;
   }
 
+  @Override
   public void setSchemaTemplate(String templateName, String prefixPath)
       throws StatementExecutionException, IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.setSchemaTemplate(templateName, prefixPath);
         putBack(session);
@@ -2113,10 +2174,11 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void unsetSchemaTemplate(String prefixPath, String templateName)
       throws StatementExecutionException, IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.unsetSchemaTemplate(prefixPath, templateName);
         putBack(session);
@@ -2133,10 +2195,11 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void createTimeseriesOfTemplateOnPath(String path)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.createTimeseriesOfTemplateOnPath(path);
         putBack(session);
@@ -2152,10 +2215,11 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void deactivateTempalte(String templateName, String prefixPath)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.deactivateTemplateOn(templateName, prefixPath);
         putBack(session);
@@ -2172,10 +2236,11 @@ public class SessionPool {
     }
   }
 
+  @Override
   public void dropSchemaTemplate(String templateName)
       throws StatementExecutionException, IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.dropSchemaTemplate(templateName);
         putBack(session);
@@ -2201,10 +2266,11 @@ public class SessionPool {
    *     happen
    */
   @SuppressWarnings("squid:S2095") // Suppress wrapper not closed warning
+  @Override
   public SessionDataSetWrapper executeQueryStatement(String sql)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         SessionDataSet resp = session.executeQueryStatement(sql);
         SessionDataSetWrapper wrapper = new SessionDataSetWrapper(resp, 
session, this);
@@ -2234,10 +2300,11 @@ public class SessionPool {
    *     happen
    */
   @SuppressWarnings("squid:S2095") // Suppress wrapper not closed warning
+  @Override
   public SessionDataSetWrapper executeQueryStatement(String sql, long 
timeoutInMs)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         SessionDataSet resp = session.executeQueryStatement(sql, timeoutInMs);
         SessionDataSetWrapper wrapper = new SessionDataSetWrapper(resp, 
session, this);
@@ -2261,10 +2328,11 @@ public class SessionPool {
    *
    * @param sql non query statement
    */
+  @Override
   public void executeNonQueryStatement(String sql)
       throws StatementExecutionException, IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         session.executeNonQueryStatement(sql);
         putBack(session);
@@ -2281,10 +2349,11 @@ public class SessionPool {
   }
 
   @SuppressWarnings("squid:S2095") // Suppress wrapper not closed warning
+  @Override
   public SessionDataSetWrapper executeRawDataQuery(List<String> paths, long 
startTime, long endTime)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         SessionDataSet resp = session.executeRawDataQuery(paths, startTime, 
endTime);
         SessionDataSetWrapper wrapper = new SessionDataSetWrapper(resp, 
session, this);
@@ -2304,10 +2373,11 @@ public class SessionPool {
   }
 
   /** Transmit insert record request for OperationSync */
+  @Override
   public boolean operationSyncTransmit(ByteBuffer buffer)
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         buffer.position(0);
         session.operationSyncTransmit(buffer);
@@ -2325,9 +2395,10 @@ public class SessionPool {
     return false;
   }
 
+  @Override
   public SystemStatus getSystemStatus() throws IoTDBConnectionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         SystemStatus status = session.getSystemStatus();
         putBack(session);
@@ -2343,10 +2414,11 @@ public class SessionPool {
     return null;
   }
 
+  @Override
   public TSBackupConfigurationResp getBackupConfiguration()
       throws IoTDBConnectionException, StatementExecutionException {
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         TSBackupConfigurationResp resp = session.getBackupConfiguration();
         putBack(session);
@@ -2362,54 +2434,66 @@ public class SessionPool {
     return null;
   }
 
+  @Override
   public int getMaxSize() {
     return maxSize;
   }
 
+  @Override
   public String getHost() {
     return host;
   }
 
+  @Override
   public int getPort() {
     return port;
   }
 
+  @Override
   public String getUser() {
     return user;
   }
 
+  @Override
   public String getPassword() {
     return password;
   }
 
+  @Override
   public int getFetchSize() {
     return fetchSize;
   }
 
+  @Override
   public ZoneId getZoneId() {
     return zoneId;
   }
 
+  @Override
   public long getWaitToGetSessionTimeoutInMs() {
     return waitToGetSessionTimeoutInMs;
   }
 
+  @Override
   public boolean isEnableCompression() {
     return enableCompression;
   }
 
+  @Override
   public boolean isEnableCacheLeader() {
     return enableCacheLeader;
   }
 
+  @Override
   public int getConnectionTimeoutInMs() {
     return connectionTimeoutInMs;
   }
 
+  @Override
   public TSConnectionInfoResp fetchAllConnections() throws 
IoTDBConnectionException {
 
     for (int i = 0; i < RETRY; i++) {
-      Session session = getSession();
+      ISession session = getSession();
       try {
         TSConnectionInfoResp resp = session.fetchAllConnections();
         putBack(session);

Reply via email to