Class SessionPool


  • public class SessionPool
    extends java.lang.Object
    SessionPool is a wrapper of a Session Set. Using SessionPool, the user do not need to consider how to reuse a session connection. Even if the session is disconnected, the session pool can recognize it and remove the broken session connection and create a new one.

    If there is no available connections and the pool reaches its max size, the all methods will hang until there is a available connection.

    If a user has waited for a session for more than 60 seconds, a warn log will be printed.

    The only thing you have to remember is that:

    For a query, if you have get all data, i.e., SessionDataSetWrapper.hasNext() == false, it is ok. Otherwise, i.e., you want to stop the query before you get all data (SessionDataSetWrapper.hasNext() == true), then you have to call closeResultSet(SessionDataSetWrapper wrapper) manually. Otherwise the connection is occupied by the query.

    Another case that you have to manually call closeResultSet() is that when there is exception when you call SessionDataSetWrapper.hasNext() or next()

    • Constructor Summary

      Constructors 
      Constructor Description
      SessionPool​(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize)  
      SessionPool​(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression)  
      SessionPool​(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression, boolean enableCacheLeader)  
      SessionPool​(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize, int fetchSize, long waitToGetSessionTimeoutInMs, boolean enableCompression, java.time.ZoneId zoneId, boolean enableCacheLeader, int connectionTimeoutInMs)  
      SessionPool​(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize, java.time.ZoneId zoneId)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean checkTimeseriesExists​(java.lang.String path)  
      void close()
      close all connections in the pool
      void closeResultSet​(SessionDataSetWrapper wrapper)  
      void createMultiTimeseries​(java.util.List<java.lang.String> paths, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> dataTypes, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding> encodings, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.CompressionType> compressors, java.util.List<java.util.Map<java.lang.String,​java.lang.String>> propsList, java.util.List<java.util.Map<java.lang.String,​java.lang.String>> tagsList, java.util.List<java.util.Map<java.lang.String,​java.lang.String>> attributesList, java.util.List<java.lang.String> measurementAliasList)  
      void createTimeseries​(java.lang.String path, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding, org.apache.iotdb.tsfile.file.metadata.enums.CompressionType compressor)  
      void createTimeseries​(java.lang.String path, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding, org.apache.iotdb.tsfile.file.metadata.enums.CompressionType compressor, java.util.Map<java.lang.String,​java.lang.String> props, java.util.Map<java.lang.String,​java.lang.String> tags, java.util.Map<java.lang.String,​java.lang.String> attributes, java.lang.String measurementAlias)  
      int currentAvailableSize()  
      int currentOccupiedSize()  
      void deleteData​(java.lang.String path, long time)
      delete data <= time in one timeseries
      void deleteData​(java.util.List<java.lang.String> paths, long time)
      delete data <= time in multiple timeseries
      void deleteData​(java.util.List<java.lang.String> paths, long startTime, long endTime)
      delete data >= startTime and data <= endTime in multiple timeseries
      void deleteStorageGroup​(java.lang.String storageGroup)  
      void deleteStorageGroups​(java.util.List<java.lang.String> storageGroup)  
      void deleteTimeseries​(java.lang.String path)
      delete a timeseries, including data and schema
      void deleteTimeseries​(java.util.List<java.lang.String> paths)
      delete a timeseries, including data and schema
      void executeNonQueryStatement​(java.lang.String sql)
      execute non query statement
      SessionDataSetWrapper executeQueryStatement​(java.lang.String sql)
      execure query sql users must call closeResultSet(SessionDataSetWrapper) if they do not use the SessionDataSet any more.
      SessionDataSetWrapper executeRawDataQuery​(java.util.List<java.lang.String> paths, long startTime, long endTime)  
      void insertOneDeviceRecords​(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList)
      Insert data that belong to the same device in batch format, which can reduce the overhead of network.
      void insertOneDeviceRecords​(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList, boolean haveSorted)
      Insert data that belong to the same device in batch format, which can reduce the overhead of network.
      void insertRecord​(java.lang.String deviceId, long time, java.util.List<java.lang.String> measurements, java.util.List<java.lang.String> values)
      insert data in one row, if you want improve your performance, please use insertRecords method or insertTablet method
      void insertRecord​(java.lang.String deviceId, long time, java.util.List<java.lang.String> measurements, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> types, java.util.List<java.lang.Object> values)
      insert data in one row, if you want improve your performance, please use insertRecords method or insertTablet method
      void insertRecords​(java.util.List<java.lang.String> deviceIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<java.lang.String>> valuesList)
      Insert data in batch format, which can reduce the overhead of network.
      void insertRecords​(java.util.List<java.lang.String> deviceIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList)
      Insert data in batch format, which can reduce the overhead of network.
      void insertTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet)
      insert the data of a device.
      void insertTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet, boolean sorted)
      insert the data of a device.
      void insertTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets)
      use batch interface to insert data
      void insertTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets, boolean sorted)
      use batch interface to insert data
      void setStorageGroup​(java.lang.String storageGroupId)  
      void testInsertRecord​(java.lang.String deviceId, long time, java.util.List<java.lang.String> measurements, java.util.List<java.lang.String> values)
      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
      void testInsertRecord​(java.lang.String deviceId, long time, java.util.List<java.lang.String> measurements, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> types, java.util.List<java.lang.Object> values)
      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
      void testInsertRecords​(java.util.List<java.lang.String> deviceIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<java.lang.String>> valuesList)
      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
      void testInsertRecords​(java.util.List<java.lang.String> deviceIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList)
      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
      void testInsertTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet)
      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
      void testInsertTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets)
      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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SESSION_POOL_IS_CLOSED

        public static final java.lang.String SESSION_POOL_IS_CLOSED
        See Also:
        Constant Field Values
      • CLOSE_THE_SESSION_FAILED

        public static final java.lang.String CLOSE_THE_SESSION_FAILED
        See Also:
        Constant Field Values
    • Constructor Detail

      • SessionPool

        public SessionPool​(java.lang.String ip,
                           int port,
                           java.lang.String user,
                           java.lang.String password,
                           int maxSize)
      • SessionPool

        public SessionPool​(java.lang.String ip,
                           int port,
                           java.lang.String user,
                           java.lang.String password,
                           int maxSize,
                           boolean enableCompression)
      • SessionPool

        public SessionPool​(java.lang.String ip,
                           int port,
                           java.lang.String user,
                           java.lang.String password,
                           int maxSize,
                           boolean enableCompression,
                           boolean enableCacheLeader)
      • SessionPool

        public SessionPool​(java.lang.String ip,
                           int port,
                           java.lang.String user,
                           java.lang.String password,
                           int maxSize,
                           java.time.ZoneId zoneId)
      • SessionPool

        public SessionPool​(java.lang.String ip,
                           int port,
                           java.lang.String user,
                           java.lang.String password,
                           int maxSize,
                           int fetchSize,
                           long waitToGetSessionTimeoutInMs,
                           boolean enableCompression,
                           java.time.ZoneId zoneId,
                           boolean enableCacheLeader,
                           int connectionTimeoutInMs)
    • Method Detail

      • currentAvailableSize

        public int currentAvailableSize()
      • currentOccupiedSize

        public int currentOccupiedSize()
      • close

        public void close()
        close all connections in the pool
      • insertTablet

        public void insertTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet)
                          throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                 org.apache.iotdb.rpc.StatementExecutionException
        insert the data of a device. For each timestamp, the number of measurements is the same.
        Parameters:
        tablet - data batch
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • insertTablet

        public void insertTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet,
                                 boolean sorted)
                          throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                 org.apache.iotdb.rpc.StatementExecutionException
        insert the data of a device. For each timestamp, the number of measurements is the same.

        Users need to control the count of Tablet and write a batch when it reaches the maxBatchSize

        Parameters:
        tablet - a tablet data of one device
        sorted - whether times in Tablet are in ascending order
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • insertTablets

        public void insertTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets)
                           throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                  org.apache.iotdb.rpc.StatementExecutionException
        use batch interface to insert data
        Parameters:
        tablets - multiple batch
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • insertTablets

        public void insertTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets,
                                  boolean sorted)
                           throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                  org.apache.iotdb.rpc.StatementExecutionException
        use batch interface to insert data
        Parameters:
        tablets - multiple batch
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • insertRecords

        public void insertRecords​(java.util.List<java.lang.String> deviceIds,
                                  java.util.List<java.lang.Long> times,
                                  java.util.List<java.util.List<java.lang.String>> measurementsList,
                                  java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList,
                                  java.util.List<java.util.List<java.lang.Object>> valuesList)
                           throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                  org.apache.iotdb.rpc.StatementExecutionException
        Insert data in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        Session.insertTablet(Tablet)
      • insertOneDeviceRecords

        public void insertOneDeviceRecords​(java.lang.String deviceId,
                                           java.util.List<java.lang.Long> times,
                                           java.util.List<java.util.List<java.lang.String>> measurementsList,
                                           java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList,
                                           java.util.List<java.util.List<java.lang.Object>> valuesList)
                                    throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                           org.apache.iotdb.rpc.StatementExecutionException
        Insert data that belong to the same device in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        Session.insertTablet(Tablet)
      • insertOneDeviceRecords

        public void insertOneDeviceRecords​(java.lang.String deviceId,
                                           java.util.List<java.lang.Long> times,
                                           java.util.List<java.util.List<java.lang.String>> measurementsList,
                                           java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList,
                                           java.util.List<java.util.List<java.lang.Object>> valuesList,
                                           boolean haveSorted)
                                    throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                           org.apache.iotdb.rpc.StatementExecutionException
        Insert data that belong to the same device in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method
        Parameters:
        haveSorted - whether the times list has been ordered.
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        Session.insertTablet(Tablet)
      • insertRecords

        public void insertRecords​(java.util.List<java.lang.String> deviceIds,
                                  java.util.List<java.lang.Long> times,
                                  java.util.List<java.util.List<java.lang.String>> measurementsList,
                                  java.util.List<java.util.List<java.lang.String>> valuesList)
                           throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                  org.apache.iotdb.rpc.StatementExecutionException
        Insert data in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        Session.insertTablet(Tablet)
      • insertRecord

        public void insertRecord​(java.lang.String deviceId,
                                 long time,
                                 java.util.List<java.lang.String> measurements,
                                 java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> types,
                                 java.util.List<java.lang.Object> values)
                          throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                 org.apache.iotdb.rpc.StatementExecutionException
        insert data in one row, if you want improve your performance, please use insertRecords method or insertTablet method
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        Session.insertRecords(List, List, List, List, List), Session.insertTablet(Tablet)
      • insertRecord

        public void insertRecord​(java.lang.String deviceId,
                                 long time,
                                 java.util.List<java.lang.String> measurements,
                                 java.util.List<java.lang.String> values)
                          throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                 org.apache.iotdb.rpc.StatementExecutionException
        insert data in one row, if you want improve your performance, please use insertRecords method or insertTablet method
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        Session.insertRecords(List, List, List, List, List), Session.insertTablet(Tablet)
      • testInsertTablet

        public void testInsertTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet)
                              throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                     org.apache.iotdb.rpc.StatementExecutionException
        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
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • testInsertTablets

        public void testInsertTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets)
                               throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                      org.apache.iotdb.rpc.StatementExecutionException
        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
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • testInsertRecords

        public void testInsertRecords​(java.util.List<java.lang.String> deviceIds,
                                      java.util.List<java.lang.Long> times,
                                      java.util.List<java.util.List<java.lang.String>> measurementsList,
                                      java.util.List<java.util.List<java.lang.String>> valuesList)
                               throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                      org.apache.iotdb.rpc.StatementExecutionException
        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
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • testInsertRecords

        public void testInsertRecords​(java.util.List<java.lang.String> deviceIds,
                                      java.util.List<java.lang.Long> times,
                                      java.util.List<java.util.List<java.lang.String>> measurementsList,
                                      java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList,
                                      java.util.List<java.util.List<java.lang.Object>> valuesList)
                               throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                      org.apache.iotdb.rpc.StatementExecutionException
        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
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • testInsertRecord

        public void testInsertRecord​(java.lang.String deviceId,
                                     long time,
                                     java.util.List<java.lang.String> measurements,
                                     java.util.List<java.lang.String> values)
                              throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                     org.apache.iotdb.rpc.StatementExecutionException
        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
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • testInsertRecord

        public void testInsertRecord​(java.lang.String deviceId,
                                     long time,
                                     java.util.List<java.lang.String> measurements,
                                     java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> types,
                                     java.util.List<java.lang.Object> values)
                              throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                     org.apache.iotdb.rpc.StatementExecutionException
        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
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • deleteTimeseries

        public void deleteTimeseries​(java.lang.String path)
                              throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                     org.apache.iotdb.rpc.StatementExecutionException
        delete a timeseries, including data and schema
        Parameters:
        path - timeseries to delete, should be a whole path
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • deleteTimeseries

        public void deleteTimeseries​(java.util.List<java.lang.String> paths)
                              throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                     org.apache.iotdb.rpc.StatementExecutionException
        delete a timeseries, including data and schema
        Parameters:
        paths - timeseries to delete, should be a whole path
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • deleteData

        public void deleteData​(java.lang.String path,
                               long time)
                        throws org.apache.iotdb.rpc.IoTDBConnectionException,
                               org.apache.iotdb.rpc.StatementExecutionException
        delete data <= time in one timeseries
        Parameters:
        path - data in which time series to delete
        time - data with time stamp less than or equal to time will be deleted
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • deleteData

        public void deleteData​(java.util.List<java.lang.String> paths,
                               long time)
                        throws org.apache.iotdb.rpc.IoTDBConnectionException,
                               org.apache.iotdb.rpc.StatementExecutionException
        delete data <= time in multiple timeseries
        Parameters:
        paths - data in which time series to delete
        time - data with time stamp less than or equal to time will be deleted
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • deleteData

        public void deleteData​(java.util.List<java.lang.String> paths,
                               long startTime,
                               long endTime)
                        throws org.apache.iotdb.rpc.IoTDBConnectionException,
                               org.apache.iotdb.rpc.StatementExecutionException
        delete data >= startTime and data <= endTime in multiple timeseries
        Parameters:
        paths - data in which time series to delete
        startTime - delete range start time
        endTime - delete range end time
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • setStorageGroup

        public void setStorageGroup​(java.lang.String storageGroupId)
                             throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                    org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • deleteStorageGroup

        public void deleteStorageGroup​(java.lang.String storageGroup)
                                throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                       org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • deleteStorageGroups

        public void deleteStorageGroups​(java.util.List<java.lang.String> storageGroup)
                                 throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                        org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • createTimeseries

        public void createTimeseries​(java.lang.String path,
                                     org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType,
                                     org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding,
                                     org.apache.iotdb.tsfile.file.metadata.enums.CompressionType compressor)
                              throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                     org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • createTimeseries

        public void createTimeseries​(java.lang.String path,
                                     org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType,
                                     org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding,
                                     org.apache.iotdb.tsfile.file.metadata.enums.CompressionType compressor,
                                     java.util.Map<java.lang.String,​java.lang.String> props,
                                     java.util.Map<java.lang.String,​java.lang.String> tags,
                                     java.util.Map<java.lang.String,​java.lang.String> attributes,
                                     java.lang.String measurementAlias)
                              throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                     org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • createMultiTimeseries

        public void createMultiTimeseries​(java.util.List<java.lang.String> paths,
                                          java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> dataTypes,
                                          java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding> encodings,
                                          java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.CompressionType> compressors,
                                          java.util.List<java.util.Map<java.lang.String,​java.lang.String>> propsList,
                                          java.util.List<java.util.Map<java.lang.String,​java.lang.String>> tagsList,
                                          java.util.List<java.util.Map<java.lang.String,​java.lang.String>> attributesList,
                                          java.util.List<java.lang.String> measurementAliasList)
                                   throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                          org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • checkTimeseriesExists

        public boolean checkTimeseriesExists​(java.lang.String path)
                                      throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                             org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • executeQueryStatement

        public SessionDataSetWrapper executeQueryStatement​(java.lang.String sql)
                                                    throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                                           org.apache.iotdb.rpc.StatementExecutionException
        execure query sql users must call closeResultSet(SessionDataSetWrapper) if they do not use the SessionDataSet any more. users do not need to call sessionDataSet.closeOpeationHandler() any more.
        Parameters:
        sql - query statement
        Returns:
        result set Notice that you must get the result instance. Otherwise a data leakage will happen
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • executeNonQueryStatement

        public void executeNonQueryStatement​(java.lang.String sql)
                                      throws org.apache.iotdb.rpc.StatementExecutionException,
                                             org.apache.iotdb.rpc.IoTDBConnectionException
        execute non query statement
        Parameters:
        sql - non query statement
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • executeRawDataQuery

        public SessionDataSetWrapper executeRawDataQuery​(java.util.List<java.lang.String> paths,
                                                         long startTime,
                                                         long endTime)
                                                  throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                                         org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException