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()

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  SessionPool.Builder  
    • Constructor Summary

      Constructors 
      Constructor Description
      SessionPool​(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize)  
      SessionPool​(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression)  
      SessionPool​(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression, boolean enableRedirection)  
      SessionPool​(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize, int fetchSize, long waitToGetSessionTimeoutInMs, boolean enableCompression, java.time.ZoneId zoneId, boolean enableRedirection, int connectionTimeoutInMs, Version version, int thriftDefaultBufferSize, int thriftMaxFrameSize)  
      SessionPool​(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize, java.time.ZoneId zoneId)  
      SessionPool​(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize)  
      SessionPool​(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression)  
      SessionPool​(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression, boolean enableRedirection)  
      SessionPool​(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize, int fetchSize, long waitToGetSessionTimeoutInMs, boolean enableCompression, java.time.ZoneId zoneId, boolean enableRedirection, int connectionTimeoutInMs, Version version, int thriftDefaultBufferSize, int thriftMaxFrameSize)  
      SessionPool​(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize, java.time.ZoneId zoneId)  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addAlignedMeasurementInTemplate​(java.lang.String templateName, java.lang.String measurementPath, 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 addAlignedMeasurementsInTemplate​(java.lang.String templateName, java.util.List<java.lang.String> measurementsPath, 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)  
      void addUnalignedMeasurementInTemplate​(java.lang.String templateName, java.lang.String measurementPath, 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 addUnalignedMeasurementsInTemplate​(java.lang.String templateName, java.util.List<java.lang.String> measurementsPath, 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)  
      boolean checkTimeseriesExists​(java.lang.String path)  
      void close()
      close all connections in the pool
      void closeResultSet​(SessionDataSetWrapper wrapper)  
      int countMeasurementsInTemplate​(java.lang.String name)  
      void createDatabase​(java.lang.String database)  
      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 createSchemaTemplate​(java.lang.String name, java.util.List<java.lang.String> schemaNames, java.util.List<java.util.List<java.lang.String>> measurements, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> dataTypes, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding>> encodings, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.CompressionType> compressors)
      Deprecated.
      void createSchemaTemplate​(java.lang.String templateName, java.util.List<java.lang.String> measurements, 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, boolean isAligned)
      Create a template with flat measurements, not tree structured.
      void createSchemaTemplate​(Template template)
      Construct Template at session and create it at server.
      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 deleteDatabase​(java.lang.String database)  
      void deleteDatabases​(java.util.List<java.lang.String> databases)  
      void deleteNodeInTemplate​(java.lang.String templateName, java.lang.String path)  
      void deleteStorageGroup​(java.lang.String storageGroup)
      Deprecated.
      void deleteStorageGroups​(java.util.List<java.lang.String> storageGroup)
      Deprecated.
      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 dropSchemaTemplate​(java.lang.String templateName)  
      SessionDataSetWrapper executeLastDataQuery​(java.util.List<java.lang.String> paths)  
      SessionDataSetWrapper executeLastDataQuery​(java.util.List<java.lang.String> paths, long LastTime, long timeOut)  
      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 executeQueryStatement​(java.lang.String sql, long timeoutInMs)
      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, long timeOut)  
      org.apache.iotdb.service.rpc.thrift.TSConnectionInfoResp fetchAllConnections()  
      int getConnectionTimeoutInMs()  
      int getFetchSize()  
      java.lang.String getHost()  
      int getMaxSize()  
      java.lang.String getPassword()  
      int getPort()  
      long getQueryTimeout()  
      java.lang.String getUser()  
      Version getVersion()  
      long getWaitToGetSessionTimeoutInMs()  
      java.time.ZoneId getZoneId()  
      void insertAlignedRecord​(java.lang.String multiSeriesId, long time, java.util.List<java.lang.String> multiMeasurementComponents, java.util.List<java.lang.String> values)
      insert aligned data in one row, if you want improve your performance, please use insertAlignedRecords method or insertTablet method.
      void insertAlignedRecord​(java.lang.String multiSeriesId, long time, java.util.List<java.lang.String> multiMeasurementComponents, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> types, java.util.List<java.lang.Object> values)
      insert aligned data in one row, if you want improve your performance, please use insertAlignedRecords method or insertTablet method.
      void insertAlignedRecords​(java.util.List<java.lang.String> multiSeriesIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> multiMeasurementComponentsList, java.util.List<java.util.List<java.lang.String>> valuesList)
      Insert aligned data in batch format, which can reduce the overhead of network.
      void insertAlignedRecords​(java.util.List<java.lang.String> multiSeriesIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> multiMeasurementComponentsList, 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 aligned data in batch format, which can reduce the overhead of network.
      void insertAlignedRecordsOfOneDevice​(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 aligned data that belong to the same device in batch format, which can reduce the overhead of network.
      void insertAlignedRecordsOfOneDevice​(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 aligned data that belong to the same device in batch format, which can reduce the overhead of network.
      void insertAlignedStringRecordsOfOneDevice​(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<java.lang.String>> valuesList)
      Insert aligned data as String format that belong to the same device in batch format, which can reduce the overhead of network.
      void insertAlignedStringRecordsOfOneDevice​(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<java.lang.String>> valuesList, boolean haveSorted)
      Insert aligned data as String format that belong to the same device in batch format, which can reduce the overhead of network.
      void insertAlignedTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet)
      insert the data of a device.
      void insertAlignedTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet, boolean sorted)
      insert the data of a device.
      void insertAlignedTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets)
      use batch interface to insert data
      void insertAlignedTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets, boolean sorted)
      use batch interface to insert aligned data
      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)
      Deprecated.
      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)
      Deprecated.
      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 insertRecordsOfOneDevice​(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 insertRecordsOfOneDevice​(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 insertStringRecordsOfOneDevice​(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<java.lang.String>> valuesList)
      Insert String format data that belong to the same device in batch format, which can reduce the overhead of network.
      void insertStringRecordsOfOneDevice​(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<java.lang.String>> valuesList, boolean haveSorted)
      Insert String format data that belong to the same device 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 aligned data
      boolean isEnableCompression()  
      boolean isEnableQueryRedirection()  
      boolean isEnableRedirection()  
      boolean isMeasurementInTemplate​(java.lang.String templateName, java.lang.String path)  
      boolean isPathExistInTemplate​(java.lang.String templateName, java.lang.String path)  
      void setEnableQueryRedirection​(boolean enableQueryRedirection)  
      void setEnableRedirection​(boolean enableRedirection)  
      void setFetchSize​(int fetchSize)  
      void setQueryTimeout​(long timeoutInMs)  
      void setSchemaTemplate​(java.lang.String templateName, java.lang.String prefixPath)  
      void setStorageGroup​(java.lang.String storageGroupId)
      Deprecated.
      void setTimeZone​(java.lang.String zoneId)  
      void setVersion​(Version version)  
      java.util.List<java.lang.String> showAllTemplates()  
      java.util.List<java.lang.String> showMeasurementsInTemplate​(java.lang.String templateName)  
      java.util.List<java.lang.String> showMeasurementsInTemplate​(java.lang.String templateName, java.lang.String pattern)  
      java.util.List<java.lang.String> showPathsTemplateSetOn​(java.lang.String templateName)  
      java.util.List<java.lang.String> showPathsTemplateUsingOn​(java.lang.String templateName)  
      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 testInsertTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet, boolean sorted)
      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
      void testInsertTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets, boolean sorted)
      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 unsetSchemaTemplate​(java.lang.String prefixPath, java.lang.String templateName)  
      • 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 host,
                           int port,
                           java.lang.String user,
                           java.lang.String password,
                           int maxSize)
      • SessionPool

        public SessionPool​(java.util.List<java.lang.String> nodeUrls,
                           java.lang.String user,
                           java.lang.String password,
                           int maxSize)
      • SessionPool

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

        public SessionPool​(java.util.List<java.lang.String> nodeUrls,
                           java.lang.String user,
                           java.lang.String password,
                           int maxSize,
                           boolean enableCompression)
      • SessionPool

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

        public SessionPool​(java.util.List<java.lang.String> nodeUrls,
                           java.lang.String user,
                           java.lang.String password,
                           int maxSize,
                           boolean enableCompression,
                           boolean enableRedirection)
      • SessionPool

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

        public SessionPool​(java.util.List<java.lang.String> nodeUrls,
                           java.lang.String user,
                           java.lang.String password,
                           int maxSize,
                           java.time.ZoneId zoneId)
      • SessionPool

        public SessionPool​(java.lang.String host,
                           int port,
                           java.lang.String user,
                           java.lang.String password,
                           int maxSize,
                           int fetchSize,
                           long waitToGetSessionTimeoutInMs,
                           boolean enableCompression,
                           java.time.ZoneId zoneId,
                           boolean enableRedirection,
                           int connectionTimeoutInMs,
                           Version version,
                           int thriftDefaultBufferSize,
                           int thriftMaxFrameSize)
      • SessionPool

        public SessionPool​(java.util.List<java.lang.String> nodeUrls,
                           java.lang.String user,
                           java.lang.String password,
                           int maxSize,
                           int fetchSize,
                           long waitToGetSessionTimeoutInMs,
                           boolean enableCompression,
                           java.time.ZoneId zoneId,
                           boolean enableRedirection,
                           int connectionTimeoutInMs,
                           Version version,
                           int thriftDefaultBufferSize,
                           int thriftMaxFrameSize)
    • 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
      • insertAlignedTablet

        public void insertAlignedTablet​(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.

        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
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • insertAlignedTablet

        public void insertAlignedTablet​(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
      • insertAlignedTablets

        public void insertAlignedTablets​(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 aligned data
        Parameters:
        tablets - multiple batch
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • insertAlignedTablets

        public void insertAlignedTablets​(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 aligned 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)
      • insertAlignedRecords

        public void insertAlignedRecords​(java.util.List<java.lang.String> multiSeriesIds,
                                         java.util.List<java.lang.Long> times,
                                         java.util.List<java.util.List<java.lang.String>> multiMeasurementComponentsList,
                                         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 aligned 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)
      • insertRecordsOfOneDevice

        public void insertRecordsOfOneDevice​(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

        @Deprecated
        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
        Deprecated.
        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)
      • insertStringRecordsOfOneDevice

        public void insertStringRecordsOfOneDevice​(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<java.lang.String>> valuesList)
                                            throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                                   org.apache.iotdb.rpc.StatementExecutionException
        Insert String format 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)
      • insertRecordsOfOneDevice

        public void insertRecordsOfOneDevice​(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)
      • insertOneDeviceRecords

        @Deprecated
        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
        Deprecated.
        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)
      • insertStringRecordsOfOneDevice

        public void insertStringRecordsOfOneDevice​(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<java.lang.String>> valuesList,
                                                   boolean haveSorted)
                                            throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                                   org.apache.iotdb.rpc.StatementExecutionException
        Insert String format 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)
      • insertAlignedRecordsOfOneDevice

        public void insertAlignedRecordsOfOneDevice​(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 aligned 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)
      • insertAlignedStringRecordsOfOneDevice

        public void insertAlignedStringRecordsOfOneDevice​(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<java.lang.String>> valuesList)
                                                   throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                                          org.apache.iotdb.rpc.StatementExecutionException
        Insert aligned data as String format 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)
      • insertAlignedRecordsOfOneDevice

        public void insertAlignedRecordsOfOneDevice​(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 aligned 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)
      • insertAlignedStringRecordsOfOneDevice

        public void insertAlignedStringRecordsOfOneDevice​(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<java.lang.String>> valuesList,
                                                          boolean haveSorted)
                                                   throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                                          org.apache.iotdb.rpc.StatementExecutionException
        Insert aligned data as String format 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)
      • insertAlignedRecords

        public void insertAlignedRecords​(java.util.List<java.lang.String> multiSeriesIds,
                                         java.util.List<java.lang.Long> times,
                                         java.util.List<java.util.List<java.lang.String>> multiMeasurementComponentsList,
                                         java.util.List<java.util.List<java.lang.String>> valuesList)
                                  throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                         org.apache.iotdb.rpc.StatementExecutionException
        Insert aligned 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)
      • insertAlignedRecord

        public void insertAlignedRecord​(java.lang.String multiSeriesId,
                                        long time,
                                        java.util.List<java.lang.String> multiMeasurementComponents,
                                        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 aligned data in one row, if you want improve your performance, please use insertAlignedRecords method or insertTablet method.
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        Session.insertAlignedRecords(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)
      • insertAlignedRecord

        public void insertAlignedRecord​(java.lang.String multiSeriesId,
                                        long time,
                                        java.util.List<java.lang.String> multiMeasurementComponents,
                                        java.util.List<java.lang.String> values)
                                 throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                        org.apache.iotdb.rpc.StatementExecutionException
        insert aligned data in one row, if you want improve your performance, please use insertAlignedRecords method or insertTablet method.
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        Session.insertAlignedRecords(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
      • testInsertTablet

        public void testInsertTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet,
                                     boolean sorted)
                              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
      • testInsertTablets

        public void testInsertTablets​(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
        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

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

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

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

        public void createDatabase​(java.lang.String database)
                            throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                   org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • deleteDatabase

        public void deleteDatabase​(java.lang.String database)
                            throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                   org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • deleteDatabases

        public void deleteDatabases​(java.util.List<java.lang.String> databases)
                             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
      • createSchemaTemplate

        public void createSchemaTemplate​(Template template)
                                  throws java.io.IOException,
                                         org.apache.iotdb.rpc.IoTDBConnectionException,
                                         org.apache.iotdb.rpc.StatementExecutionException
        Construct Template at session and create it at server.
        Throws:
        java.io.IOException
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        Template
      • createSchemaTemplate

        public void createSchemaTemplate​(java.lang.String templateName,
                                         java.util.List<java.lang.String> measurements,
                                         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,
                                         boolean isAligned)
                                  throws java.io.IOException,
                                         org.apache.iotdb.rpc.IoTDBConnectionException,
                                         org.apache.iotdb.rpc.StatementExecutionException
        Create a template with flat measurements, not tree structured. Need to specify datatype, encoding and compressor of each measurement, and alignment of these measurements at once.
        Parameters:
        measurements - flat measurements of the template, cannot contain character dot
        dataTypes - datatype of each measurement in the template
        encodings - encodings of each measurement in the template
        compressors - compression type of each measurement in the template
        isAligned - specify whether these flat measurements are aligned
        Throws:
        java.io.IOException
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • createSchemaTemplate

        @Deprecated
        public void createSchemaTemplate​(java.lang.String name,
                                         java.util.List<java.lang.String> schemaNames,
                                         java.util.List<java.util.List<java.lang.String>> measurements,
                                         java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> dataTypes,
                                         java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding>> encodings,
                                         java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.CompressionType> compressors)
                                  throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                         org.apache.iotdb.rpc.StatementExecutionException
        Deprecated.
        Compatible for rel/0.12, this method will create an unaligned flat template as a result. Notice that there is no aligned concept in 0.12, so only the first measurement in each nested list matters.
        Parameters:
        name - name of the template
        schemaNames - it works as a virtual layer inside template in 0.12, and makes no difference after 0.13
        measurements - the first measurement in each nested list will constitute the final flat template
        dataTypes - the data type of each measurement, only the first one in each nested list matters as above
        encodings - the encoding of each measurement, only the first one in each nested list matters as above
        compressors - the compressor of each measurement
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • addAlignedMeasurementsInTemplate

        public void addAlignedMeasurementsInTemplate​(java.lang.String templateName,
                                                     java.util.List<java.lang.String> measurementsPath,
                                                     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)
                                              throws java.io.IOException,
                                                     org.apache.iotdb.rpc.IoTDBConnectionException,
                                                     org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        java.io.IOException
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • addAlignedMeasurementInTemplate

        public void addAlignedMeasurementInTemplate​(java.lang.String templateName,
                                                    java.lang.String measurementPath,
                                                    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 java.io.IOException,
                                                    org.apache.iotdb.rpc.IoTDBConnectionException,
                                                    org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        java.io.IOException
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • addUnalignedMeasurementsInTemplate

        public void addUnalignedMeasurementsInTemplate​(java.lang.String templateName,
                                                       java.util.List<java.lang.String> measurementsPath,
                                                       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)
                                                throws java.io.IOException,
                                                       org.apache.iotdb.rpc.IoTDBConnectionException,
                                                       org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        java.io.IOException
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • addUnalignedMeasurementInTemplate

        public void addUnalignedMeasurementInTemplate​(java.lang.String templateName,
                                                      java.lang.String measurementPath,
                                                      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 java.io.IOException,
                                                      org.apache.iotdb.rpc.IoTDBConnectionException,
                                                      org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        java.io.IOException
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • deleteNodeInTemplate

        public void deleteNodeInTemplate​(java.lang.String templateName,
                                         java.lang.String path)
                                  throws java.io.IOException,
                                         org.apache.iotdb.rpc.IoTDBConnectionException,
                                         org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        java.io.IOException
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • countMeasurementsInTemplate

        public int countMeasurementsInTemplate​(java.lang.String name)
                                        throws org.apache.iotdb.rpc.StatementExecutionException,
                                               org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • isMeasurementInTemplate

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

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

        public java.util.List<java.lang.String> showMeasurementsInTemplate​(java.lang.String templateName)
                                                                    throws org.apache.iotdb.rpc.StatementExecutionException,
                                                                           org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • showMeasurementsInTemplate

        public java.util.List<java.lang.String> showMeasurementsInTemplate​(java.lang.String templateName,
                                                                           java.lang.String pattern)
                                                                    throws org.apache.iotdb.rpc.StatementExecutionException,
                                                                           org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • showAllTemplates

        public java.util.List<java.lang.String> showAllTemplates()
                                                          throws org.apache.iotdb.rpc.StatementExecutionException,
                                                                 org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • showPathsTemplateSetOn

        public java.util.List<java.lang.String> showPathsTemplateSetOn​(java.lang.String templateName)
                                                                throws org.apache.iotdb.rpc.StatementExecutionException,
                                                                       org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • showPathsTemplateUsingOn

        public java.util.List<java.lang.String> showPathsTemplateUsingOn​(java.lang.String templateName)
                                                                  throws org.apache.iotdb.rpc.StatementExecutionException,
                                                                         org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • setSchemaTemplate

        public void setSchemaTemplate​(java.lang.String templateName,
                                      java.lang.String prefixPath)
                               throws org.apache.iotdb.rpc.StatementExecutionException,
                                      org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • unsetSchemaTemplate

        public void unsetSchemaTemplate​(java.lang.String prefixPath,
                                        java.lang.String templateName)
                                 throws org.apache.iotdb.rpc.StatementExecutionException,
                                        org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • dropSchemaTemplate

        public void dropSchemaTemplate​(java.lang.String templateName)
                                throws org.apache.iotdb.rpc.StatementExecutionException,
                                       org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • 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
      • executeQueryStatement

        public SessionDataSetWrapper executeQueryStatement​(java.lang.String sql,
                                                           long timeoutInMs)
                                                    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
        timeoutInMs - the timeout of this query, in milliseconds
        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,
                                                         long timeOut)
                                                  throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                                         org.apache.iotdb.rpc.StatementExecutionException
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • executeLastDataQuery

        public SessionDataSetWrapper executeLastDataQuery​(java.util.List<java.lang.String> paths,
                                                          long LastTime,
                                                          long timeOut)
                                                   throws org.apache.iotdb.rpc.StatementExecutionException,
                                                          org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • executeLastDataQuery

        public SessionDataSetWrapper executeLastDataQuery​(java.util.List<java.lang.String> paths)
                                                   throws org.apache.iotdb.rpc.StatementExecutionException,
                                                          org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • getMaxSize

        public int getMaxSize()
      • getHost

        public java.lang.String getHost()
      • getPort

        public int getPort()
      • getUser

        public java.lang.String getUser()
      • getPassword

        public java.lang.String getPassword()
      • setFetchSize

        public void setFetchSize​(int fetchSize)
      • getFetchSize

        public int getFetchSize()
      • setTimeZone

        public void setTimeZone​(java.lang.String zoneId)
                         throws org.apache.iotdb.rpc.StatementExecutionException,
                                org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • getZoneId

        public java.time.ZoneId getZoneId()
      • getWaitToGetSessionTimeoutInMs

        public long getWaitToGetSessionTimeoutInMs()
      • isEnableCompression

        public boolean isEnableCompression()
      • setEnableRedirection

        public void setEnableRedirection​(boolean enableRedirection)
      • isEnableRedirection

        public boolean isEnableRedirection()
      • setEnableQueryRedirection

        public void setEnableQueryRedirection​(boolean enableQueryRedirection)
      • isEnableQueryRedirection

        public boolean isEnableQueryRedirection()
      • getConnectionTimeoutInMs

        public int getConnectionTimeoutInMs()
      • fetchAllConnections

        public org.apache.iotdb.service.rpc.thrift.TSConnectionInfoResp fetchAllConnections()
                                                                                     throws org.apache.iotdb.rpc.IoTDBConnectionException
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
      • setVersion

        public void setVersion​(Version version)
      • getVersion

        public Version getVersion()
      • setQueryTimeout

        public void setQueryTimeout​(long timeoutInMs)
      • getQueryTimeout

        public long getQueryTimeout()