Class Session

  • All Implemented Interfaces:
    java.lang.AutoCloseable, ISession

    public class Session
    extends java.lang.Object
    implements ISession
    • Nested Class Summary

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

      Constructors 
      Constructor Description
      Session​(java.lang.String host, int rpcPort)  
      Session​(java.lang.String host, int rpcPort, java.lang.String username, java.lang.String password)  
      Session​(java.lang.String host, int rpcPort, java.lang.String username, java.lang.String password, boolean enableRedirection)  
      Session​(java.lang.String host, int rpcPort, java.lang.String username, java.lang.String password, int fetchSize)  
      Session​(java.lang.String host, int rpcPort, java.lang.String username, java.lang.String password, int fetchSize, long queryTimeoutInMs)  
      Session​(java.lang.String host, int rpcPort, java.lang.String username, java.lang.String password, int fetchSize, java.time.ZoneId zoneId, boolean enableRedirection)  
      Session​(java.lang.String host, int rpcPort, java.lang.String username, java.lang.String password, int fetchSize, java.time.ZoneId zoneId, int thriftDefaultBufferSize, int thriftMaxFrameSize, boolean enableRedirection, Version version)  
      Session​(java.lang.String host, int rpcPort, java.lang.String username, java.lang.String password, java.time.ZoneId zoneId)  
      Session​(java.lang.String host, java.lang.String rpcPort, java.lang.String username, java.lang.String password)  
      Session​(java.util.List<java.lang.String> nodeUrls, java.lang.String username, java.lang.String password)  
      Session​(java.util.List<java.lang.String> nodeUrls, java.lang.String username, java.lang.String password, int fetchSize)
      Multiple nodeUrl,If one node down, connect to the next one
      Session​(java.util.List<java.lang.String> nodeUrls, java.lang.String username, java.lang.String password, int fetchSize, java.time.ZoneId zoneId, int thriftDefaultBufferSize, int thriftMaxFrameSize, boolean enableRedirection, Version version)  
      Session​(java.util.List<java.lang.String> nodeUrls, java.lang.String username, java.lang.String password, 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()  
      SessionConnection constructSessionConnection​(Session session, org.apache.iotdb.common.rpc.thrift.TEndPoint endpoint, java.time.ZoneId zoneId)  
      int countMeasurementsInTemplate​(java.lang.String name)  
      void createAlignedTimeseries​(java.lang.String deviceId, 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, java.util.List<java.lang.String> measurementAliasList)  
      void createAlignedTimeseries​(java.lang.String deviceId, 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, java.util.List<java.lang.String> measurementAliasList, 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)  
      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)  
      void deleteData​(java.lang.String path, long endTime)
      delete data <= time in one timeseries
      void deleteData​(java.util.List<java.lang.String> paths, long endTime)
      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)  
      void deleteStorageGroups​(java.util.List<java.lang.String> storageGroups)  
      void deleteTimeseries​(java.lang.String path)
      delete a timeseries, including data and schema
      void deleteTimeseries​(java.util.List<java.lang.String> paths)
      delete some timeseries, including data and schema
      void dropSchemaTemplate​(java.lang.String templateName)  
      SessionDataSet executeLastDataQuery​(java.util.List<java.lang.String> paths)
      query eg.
      SessionDataSet executeLastDataQuery​(java.util.List<java.lang.String> paths, long LastTime, long timeOut)
      query e.g.
      void executeNonQueryStatement​(java.lang.String sql)
      execute non query statement
      SessionDataSet executeQueryStatement​(java.lang.String sql)
      execute query sql
      SessionDataSet executeQueryStatement​(java.lang.String sql, long timeoutInMs)
      execute query sql with explicit timeout
      SessionDataSet executeRawDataQuery​(java.util.List<java.lang.String> paths, long startTime, long endTime, long timeOut)
      query eg.
      org.apache.iotdb.service.rpc.thrift.TSConnectionInfoResp fetchAllConnections()  
      int getFetchSize()  
      long getQueryTimeout()  
      java.lang.String getTimestampPrecision()  
      java.lang.String getTimeZone()  
      Version getVersion()  
      void insertAlignedRecord​(java.lang.String deviceId, long time, java.util.List<java.lang.String> measurements, 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 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 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> 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 aligned multiple rows, which can reduce the overhead of network.
      void insertAlignedRecords​(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 aligned multiple rows, 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 multiple rows, 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 multiple rows, 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 multiple rows with String format data, 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 multiple rows with String format data, which can reduce the overhead of network.
      void insertAlignedTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet)
      insert the aligned timeseries data of a device.
      void insertAlignedTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet, boolean sorted)
      insert the aligned timeseries data of a device.
      void insertAlignedTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets)
      insert aligned data of several deivces.
      void insertAlignedTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets, boolean sorted)
      insert aligned data of several devices.
      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.lang.Object... values)
      insert data in one row, if you want to 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 multiple rows, 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 multiple rows, 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 multiple rows, 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 multiple rows, 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 multiple rows with String format data, 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 multiple rows with String format data, 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 a Tablet
      void insertTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets)
      insert the data of several deivces.
      void insertTablets​(java.util.Map<java.lang.String,​org.apache.iotdb.tsfile.write.record.Tablet> tablets, boolean sorted)
      insert the data of several devices.
      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 open()  
      void open​(boolean enableRPCCompression)  
      void open​(boolean enableRPCCompression, int connectionTimeoutInMs)  
      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 storageGroup)  
      void setTimeZone​(java.lang.String zoneId)  
      void setTimeZoneOfSession​(java.lang.String zoneId)
      Only changes the member variable of the Session object without sending it to server.
      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 sortTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet)  
      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

      • protocolVersion

        protected static final org.apache.iotdb.service.rpc.thrift.TSProtocolVersion protocolVersion
      • MSG_UNSUPPORTED_DATA_TYPE

        public static final java.lang.String MSG_UNSUPPORTED_DATA_TYPE
        See Also:
        Constant Field Values
      • MSG_DONOT_ENABLE_REDIRECT

        public static final java.lang.String MSG_DONOT_ENABLE_REDIRECT
        See Also:
        Constant Field Values
      • nodeUrls

        protected java.util.List<java.lang.String> nodeUrls
      • username

        protected java.lang.String username
      • password

        protected java.lang.String password
      • fetchSize

        protected int fetchSize
      • enableRPCCompression

        protected boolean enableRPCCompression
      • connectionTimeoutInMs

        protected int connectionTimeoutInMs
      • zoneId

        protected java.time.ZoneId zoneId
      • thriftDefaultBufferSize

        protected int thriftDefaultBufferSize
      • thriftMaxFrameSize

        protected int thriftMaxFrameSize
      • defaultEndPoint

        protected org.apache.iotdb.common.rpc.thrift.TEndPoint defaultEndPoint
      • enableRedirection

        protected boolean enableRedirection
      • deviceIdToEndpoint

        protected volatile java.util.Map<java.lang.String,​org.apache.iotdb.common.rpc.thrift.TEndPoint> deviceIdToEndpoint
      • endPointToSessionConnection

        protected volatile java.util.Map<org.apache.iotdb.common.rpc.thrift.TEndPoint,​SessionConnection> endPointToSessionConnection
      • enableQueryRedirection

        protected boolean enableQueryRedirection
      • version

        protected Version version
    • Constructor Detail

      • Session

        public Session​(java.lang.String host,
                       int rpcPort)
      • Session

        public Session​(java.lang.String host,
                       java.lang.String rpcPort,
                       java.lang.String username,
                       java.lang.String password)
      • Session

        public Session​(java.lang.String host,
                       int rpcPort,
                       java.lang.String username,
                       java.lang.String password)
      • Session

        public Session​(java.lang.String host,
                       int rpcPort,
                       java.lang.String username,
                       java.lang.String password,
                       int fetchSize)
      • Session

        public Session​(java.lang.String host,
                       int rpcPort,
                       java.lang.String username,
                       java.lang.String password,
                       int fetchSize,
                       long queryTimeoutInMs)
      • Session

        public Session​(java.lang.String host,
                       int rpcPort,
                       java.lang.String username,
                       java.lang.String password,
                       java.time.ZoneId zoneId)
      • Session

        public Session​(java.lang.String host,
                       int rpcPort,
                       java.lang.String username,
                       java.lang.String password,
                       boolean enableRedirection)
      • Session

        public Session​(java.lang.String host,
                       int rpcPort,
                       java.lang.String username,
                       java.lang.String password,
                       int fetchSize,
                       java.time.ZoneId zoneId,
                       boolean enableRedirection)
      • Session

        public Session​(java.lang.String host,
                       int rpcPort,
                       java.lang.String username,
                       java.lang.String password,
                       int fetchSize,
                       java.time.ZoneId zoneId,
                       int thriftDefaultBufferSize,
                       int thriftMaxFrameSize,
                       boolean enableRedirection,
                       Version version)
      • Session

        public Session​(java.util.List<java.lang.String> nodeUrls,
                       java.lang.String username,
                       java.lang.String password)
      • Session

        public Session​(java.util.List<java.lang.String> nodeUrls,
                       java.lang.String username,
                       java.lang.String password,
                       int fetchSize)
        Multiple nodeUrl,If one node down, connect to the next one
        Parameters:
        nodeUrls - List Multiple ip:rpcPort eg.127.0.0.1:9001
      • Session

        public Session​(java.util.List<java.lang.String> nodeUrls,
                       java.lang.String username,
                       java.lang.String password,
                       java.time.ZoneId zoneId)
      • Session

        public Session​(java.util.List<java.lang.String> nodeUrls,
                       java.lang.String username,
                       java.lang.String password,
                       int fetchSize,
                       java.time.ZoneId zoneId,
                       int thriftDefaultBufferSize,
                       int thriftMaxFrameSize,
                       boolean enableRedirection,
                       Version version)
    • Method Detail

      • setFetchSize

        public void setFetchSize​(int fetchSize)
        Specified by:
        setFetchSize in interface ISession
      • open

        public void open()
                  throws org.apache.iotdb.rpc.IoTDBConnectionException
        Specified by:
        open in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
      • open

        public void open​(boolean enableRPCCompression)
                  throws org.apache.iotdb.rpc.IoTDBConnectionException
        Specified by:
        open in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
      • open

        public void open​(boolean enableRPCCompression,
                         int connectionTimeoutInMs)
                  throws org.apache.iotdb.rpc.IoTDBConnectionException
        Specified by:
        open in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
      • close

        public void close()
                   throws org.apache.iotdb.rpc.IoTDBConnectionException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
      • constructSessionConnection

        public SessionConnection constructSessionConnection​(Session session,
                                                            org.apache.iotdb.common.rpc.thrift.TEndPoint endpoint,
                                                            java.time.ZoneId zoneId)
                                                     throws org.apache.iotdb.rpc.IoTDBConnectionException
        Specified by:
        constructSessionConnection in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
      • getTimeZone

        public java.lang.String getTimeZone()
        Specified by:
        getTimeZone in interface ISession
      • setTimeZone

        public void setTimeZone​(java.lang.String zoneId)
                         throws org.apache.iotdb.rpc.StatementExecutionException,
                                org.apache.iotdb.rpc.IoTDBConnectionException
        Specified by:
        setTimeZone in interface ISession
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • setTimeZoneOfSession

        public void setTimeZoneOfSession​(java.lang.String zoneId)
        Only changes the member variable of the Session object without sending it to server.
        Specified by:
        setTimeZoneOfSession in interface ISession
      • setStorageGroup

        public void setStorageGroup​(java.lang.String storageGroup)
                             throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                    org.apache.iotdb.rpc.StatementExecutionException
        Specified by:
        setStorageGroup in interface ISession
        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
        Specified by:
        deleteStorageGroup in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • deleteStorageGroups

        public void deleteStorageGroups​(java.util.List<java.lang.String> storageGroups)
                                 throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                        org.apache.iotdb.rpc.StatementExecutionException
        Specified by:
        deleteStorageGroups in interface ISession
        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
        Specified by:
        createDatabase in interface ISession
        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
        Specified by:
        deleteDatabase in interface ISession
        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
        Specified by:
        deleteDatabases in interface ISession
        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
        Specified by:
        createTimeseries in interface ISession
        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
        Specified by:
        createTimeseries in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • createAlignedTimeseries

        public void createAlignedTimeseries​(java.lang.String deviceId,
                                            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,
                                            java.util.List<java.lang.String> measurementAliasList)
                                     throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                            org.apache.iotdb.rpc.StatementExecutionException
        Specified by:
        createAlignedTimeseries in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • createAlignedTimeseries

        public void createAlignedTimeseries​(java.lang.String deviceId,
                                            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,
                                            java.util.List<java.lang.String> measurementAliasList,
                                            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)
                                     throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                            org.apache.iotdb.rpc.StatementExecutionException
        Specified by:
        createAlignedTimeseries in interface ISession
        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
        Specified by:
        createMultiTimeseries in interface ISession
        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
        Specified by:
        checkTimeseriesExists in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • setQueryTimeout

        public void setQueryTimeout​(long timeoutInMs)
      • getQueryTimeout

        public long getQueryTimeout()
      • executeQueryStatement

        public SessionDataSet executeQueryStatement​(java.lang.String sql)
                                             throws org.apache.iotdb.rpc.StatementExecutionException,
                                                    org.apache.iotdb.rpc.IoTDBConnectionException
        execute query sql
        Specified by:
        executeQueryStatement in interface ISession
        Parameters:
        sql - query statement
        Returns:
        result set
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • executeQueryStatement

        public SessionDataSet executeQueryStatement​(java.lang.String sql,
                                                    long timeoutInMs)
                                             throws org.apache.iotdb.rpc.StatementExecutionException,
                                                    org.apache.iotdb.rpc.IoTDBConnectionException
        execute query sql with explicit timeout
        Specified by:
        executeQueryStatement in interface ISession
        Parameters:
        sql - query statement
        timeoutInMs - the timeout of this query, in milliseconds
        Returns:
        result set
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • executeNonQueryStatement

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

        public SessionDataSet executeRawDataQuery​(java.util.List<java.lang.String> paths,
                                                  long startTime,
                                                  long endTime,
                                                  long timeOut)
                                           throws org.apache.iotdb.rpc.StatementExecutionException,
                                                  org.apache.iotdb.rpc.IoTDBConnectionException
        query eg. select * from paths where time >= startTime and time < endTime time interval include startTime and exclude endTime
        Specified by:
        executeRawDataQuery in interface ISession
        Parameters:
        paths - series path
        startTime - included
        endTime - excluded
        Returns:
        data set
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException - statement is not right
        org.apache.iotdb.rpc.IoTDBConnectionException - the network is not good
      • executeLastDataQuery

        public SessionDataSet executeLastDataQuery​(java.util.List<java.lang.String> paths,
                                                   long LastTime,
                                                   long timeOut)
                                            throws org.apache.iotdb.rpc.StatementExecutionException,
                                                   org.apache.iotdb.rpc.IoTDBConnectionException
        query e.g. select last data from paths where time >= lastTime
        Specified by:
        executeLastDataQuery in interface ISession
        Parameters:
        paths - timeSeries eg. root.ln.d1.s1,root.ln.d1.s2
        LastTime - get the last data, whose timestamp is greater than or equal LastTime e.g. 1621326244168
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • executeLastDataQuery

        public SessionDataSet executeLastDataQuery​(java.util.List<java.lang.String> paths)
                                            throws org.apache.iotdb.rpc.StatementExecutionException,
                                                   org.apache.iotdb.rpc.IoTDBConnectionException
        query eg. select last status from root.ln.wf01.wt01; + =
        Specified by:
        executeLastDataQuery in interface ISession
        Parameters:
        paths - timeSeries. eg.root.ln.d1.s1,root.ln.d1.s2
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • 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.lang.Object... values)
                          throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                 org.apache.iotdb.rpc.StatementExecutionException
        insert data in one row, if you want to improve your performance, please use insertRecords method or insertTablet method
        Specified by:
        insertRecord in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        insertRecords(List, List, List, List, List), insertTablet(Tablet)
      • getTimestampPrecision

        public java.lang.String getTimestampPrecision()
                                               throws org.apache.thrift.TException
        Specified by:
        getTimestampPrecision in interface ISession
        Throws:
        org.apache.thrift.TException
      • 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
        Specified by:
        insertRecord in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        insertRecords(List, List, List, List, List), insertTablet(Tablet)
      • insertAlignedRecord

        public void insertAlignedRecord​(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 aligned data in one row, if you want improve your performance, please use insertAlignedRecords method or insertTablet method.
        Specified by:
        insertAlignedRecord in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        insertAlignedRecords(List, List, List, List, List), 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
        Specified by:
        insertRecord in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        insertRecords(List, List, List, List, List), insertTablet(Tablet)
      • insertAlignedRecord

        public void insertAlignedRecord​(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 aligned data in one row, if you want improve your performance, please use insertAlignedRecords method or insertTablet method.
        Specified by:
        insertAlignedRecord in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        insertAlignedRecords(List, List, List, List, List), 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 multiple rows, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method

        Each row is independent, which could have different deviceId, time, number of measurements

        Specified by:
        insertRecords in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        insertTablet(Tablet)
      • insertAlignedRecords

        public void insertAlignedRecords​(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 aligned multiple rows, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method

        Each row is independent, which could have different prefixPath, time, number of subMeasurements

        Specified by:
        insertAlignedRecords in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        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<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 multiple rows, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method

        Each row is independent, which could have different deviceId, time, number of measurements

        Specified by:
        insertRecords in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        insertTablet(Tablet)
      • insertAlignedRecords

        public void insertAlignedRecords​(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 aligned multiple rows, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method

        Each row is independent, which could have different prefixPath, time, number of subMeasurements

        Specified by:
        insertAlignedRecords in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        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 multiple rows, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method

        Each row could have same deviceId but different time, number of measurements

        Specified by:
        insertRecordsOfOneDevice in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        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 multiple rows, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method

        Each row could have same deviceId but different time, number of measurements

        Specified by:
        insertRecordsOfOneDevice in interface ISession
        Parameters:
        haveSorted - deprecated, whether the times have been sorted
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        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 multiple rows with String format data, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method

        Each row could have same deviceId but different time, number of measurements, number of values as String

        Specified by:
        insertStringRecordsOfOneDevice in interface ISession
        Parameters:
        haveSorted - deprecated, whether the times have been sorted
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • 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 multiple rows with String format data, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method

        Each row could have same deviceId but different time, number of measurements, number of values as String

        Specified by:
        insertStringRecordsOfOneDevice in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • 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 multiple rows, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method

        Each row could have same prefixPath but different time, number of measurements

        Specified by:
        insertAlignedRecordsOfOneDevice in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        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 multiple rows, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method

        Each row could have same prefixPath but different time, number of measurements

        Specified by:
        insertAlignedRecordsOfOneDevice in interface ISession
        Parameters:
        haveSorted - deprecated, whether the times have been sorted
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        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 multiple rows with String format data, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method

        Each row could have same deviceId but different time, number of measurements, number of values as String

        Specified by:
        insertAlignedStringRecordsOfOneDevice in interface ISession
        Parameters:
        haveSorted - deprecated, whether the times have been sorted
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • 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 multiple rows with String format data, which can reduce the overhead of network. This method is just like jdbc executeBatch, we pack some insert request in batch and send them to server. If you want improve your performance, please see insertTablet method

        Each row could have same prefixPath but different time, number of measurements, number of values as String

        Specified by:
        insertAlignedStringRecordsOfOneDevice in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
        See Also:
        insertTablet(Tablet)
      • insertTablet

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

        a Tablet example: device1 time s1, s2, s3 1, 1, 1, 1 2, 2, 2, 2 3, 3, 3, 3

        times in Tablet may be not in ascending order

        Specified by:
        insertTablet in interface ISession
        Parameters:
        tablet - data batch
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • 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 a Tablet
        Specified by:
        insertTablet in interface ISession
        Parameters:
        tablet - data batch
        sorted - deprecated, 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.StatementExecutionException,
                                        org.apache.iotdb.rpc.IoTDBConnectionException
        insert the aligned timeseries data of a device. For each timestamp, the number of measurements is the same.

        a Tablet example: device1 time s1, s2, s3 1, 1, 1, 1 2, 2, 2, 2 3, 3, 3, 3

        times in Tablet may be not in ascending order

        Specified by:
        insertAlignedTablet in interface ISession
        Parameters:
        tablet - data batch
        Throws:
        org.apache.iotdb.rpc.StatementExecutionException
        org.apache.iotdb.rpc.IoTDBConnectionException
      • 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 aligned timeseries data of a device.
        Specified by:
        insertAlignedTablet in interface ISession
        Parameters:
        tablet - data batch
        sorted - deprecated, 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
        insert the data of several deivces. Given a deivce, for each timestamp, the number of measurements is the same.

        Times in each Tablet may not be in ascending order

        Specified by:
        insertTablets in interface ISession
        Parameters:
        tablets - data batch in multiple device
        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
        insert the data of several devices. Given a device, for each timestamp, the number of measurements is the same.
        Specified by:
        insertTablets in interface ISession
        Parameters:
        tablets - data batch in multiple device
        sorted - deprecated, whether times in each Tablet are in ascending order
        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
        insert aligned data of several deivces. Given a deivce, for each timestamp, the number of measurements is the same.

        Times in each Tablet may not be in ascending order

        Specified by:
        insertAlignedTablets in interface ISession
        Parameters:
        tablets - data batch in multiple device
        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
        insert aligned data of several devices. Given a device, for each timestamp, the number of measurements is the same.
        Specified by:
        insertAlignedTablets in interface ISession
        Parameters:
        tablets - data batch in multiple device
        sorted - deprecated, whether times in each Tablet are in ascending order
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • 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
        Specified by:
        testInsertTablet in interface ISession
        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
        Specified by:
        testInsertTablet in interface ISession
        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
        Specified by:
        testInsertTablets in interface ISession
        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
        Specified by:
        testInsertTablets in interface ISession
        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
        Specified by:
        testInsertRecords in interface ISession
        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
        Specified by:
        testInsertRecords in interface ISession
        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
        Specified by:
        testInsertRecord in interface ISession
        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
        Specified by:
        testInsertRecord in interface ISession
        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
        Specified by:
        deleteTimeseries in interface ISession
        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 some timeseries, including data and schema
        Specified by:
        deleteTimeseries in interface ISession
        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 endTime)
                        throws org.apache.iotdb.rpc.IoTDBConnectionException,
                               org.apache.iotdb.rpc.StatementExecutionException
        delete data <= time in one timeseries
        Specified by:
        deleteData in interface ISession
        Parameters:
        path - data in which time series to delete
        endTime - 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 endTime)
                        throws org.apache.iotdb.rpc.IoTDBConnectionException,
                               org.apache.iotdb.rpc.StatementExecutionException
        delete data <= time in multiple timeseries
        Specified by:
        deleteData in interface ISession
        Parameters:
        paths - data in which time series to delete
        endTime - 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
        Specified by:
        deleteData in interface ISession
        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
      • sortTablet

        public void sortTablet​(org.apache.iotdb.tsfile.write.record.Tablet tablet)
        Specified by:
        sortTablet in interface ISession
      • setSchemaTemplate

        public void setSchemaTemplate​(java.lang.String templateName,
                                      java.lang.String prefixPath)
                               throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                      org.apache.iotdb.rpc.StatementExecutionException
        Specified by:
        setSchemaTemplate in interface ISession
        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.

        The template instance constructed within session is SUGGESTED to be a flat measurement template, which has no internal nodes inside a template.

        For example, template(s1, s2, s3) is a flat measurement template, while template2(GPS.x, GPS.y, s1) is not.

        Tree-structured template, which is contrary to flat measurement template, may not be supported in further version of IoTDB

        Specified by:
        createSchemaTemplate in interface ISession
        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.
        Specified by:
        createSchemaTemplate in interface ISession
        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.
        Specified by:
        createSchemaTemplate in interface ISession
        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
        Specified by:
        addAlignedMeasurementsInTemplate in interface ISession
        Parameters:
        templateName - Template to add aligned measurements.
        measurementsPath - If measurements get different prefix, or the prefix already exists in template but not aligned, throw exception.
        dataTypes - Data type of these measurements.
        encodings - Encoding of these measurements.
        compressors - CompressionType of these measurements.
        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
        Specified by:
        addAlignedMeasurementInTemplate in interface ISession
        Parameters:
        templateName - Template to add a single aligned measurement.
        measurementPath - If prefix of the path exists in template and not aligned, throw exception.
        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
        Specified by:
        addUnalignedMeasurementsInTemplate in interface ISession
        Parameters:
        templateName - Template to add unaligned measurements.
        measurementsPath - If prefix of any path exist in template but aligned, throw exception.
        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
        Specified by:
        addUnalignedMeasurementInTemplate in interface ISession
        Parameters:
        templateName - Template to add a single unaligned measurement.
        measurementPath - If prefix of path exists in template but aligned, throw exception.
        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
        Specified by:
        deleteNodeInTemplate in interface ISession
        Parameters:
        templateName - Template to prune.
        path - Remove node from template specified by the path, including its children nodes.
        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
        Specified by:
        countMeasurementsInTemplate in interface ISession
        Returns:
        Amount of measurements in the template
        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
        Specified by:
        isMeasurementInTemplate in interface ISession
        Returns:
        If the node specified by the path is a measurement.
        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
        Specified by:
        isPathExistInTemplate in interface ISession
        Returns:
        if there is a node correspond to the path in the template.
        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
        Specified by:
        showMeasurementsInTemplate in interface ISession
        Returns:
        All paths of measurements in the template.
        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
        Specified by:
        showMeasurementsInTemplate in interface ISession
        Returns:
        All paths of measurements under the pattern in the template.
        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
        Specified by:
        showAllTemplates in interface ISession
        Returns:
        All template names.
        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
        Specified by:
        showPathsTemplateSetOn in interface ISession
        Returns:
        All paths have been set to designated template.
        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
        Specified by:
        showPathsTemplateUsingOn in interface ISession
        Returns:
        All paths are using designated template.
        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.IoTDBConnectionException,
                                        org.apache.iotdb.rpc.StatementExecutionException
        Specified by:
        unsetSchemaTemplate in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • dropSchemaTemplate

        public void dropSchemaTemplate​(java.lang.String templateName)
                                throws org.apache.iotdb.rpc.IoTDBConnectionException,
                                       org.apache.iotdb.rpc.StatementExecutionException
        Specified by:
        dropSchemaTemplate in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException
        org.apache.iotdb.rpc.StatementExecutionException
      • setEnableQueryRedirection

        public void setEnableQueryRedirection​(boolean enableQueryRedirection)
        Specified by:
        setEnableQueryRedirection in interface ISession
      • setEnableRedirection

        public void setEnableRedirection​(boolean enableRedirection)
        Specified by:
        setEnableRedirection in interface ISession
      • fetchAllConnections

        public org.apache.iotdb.service.rpc.thrift.TSConnectionInfoResp fetchAllConnections()
                                                                                     throws org.apache.iotdb.rpc.IoTDBConnectionException
        Specified by:
        fetchAllConnections in interface ISession
        Throws:
        org.apache.iotdb.rpc.IoTDBConnectionException