Class SessionPool
- java.lang.Object
-
- org.apache.iotdb.session.pool.SessionPool
-
public class SessionPool extends java.lang.ObjectSessionPool is a wrapper of a Session Set. Using SessionPool, the user do not need to consider how to reuse a session connection. Even if the session is disconnected, the session pool can recognize it and remove the broken session connection and create a new one.If there is no available connections and the pool reaches its max size, the all methods will hang until there is a available connection.
If a user has waited for a session for more than 60 seconds, a warn log will be printed.
The only thing you have to remember is that:
For a query, if you have get all data, i.e., SessionDataSetWrapper.hasNext() == false, it is ok. Otherwise, i.e., you want to stop the query before you get all data (SessionDataSetWrapper.hasNext() == true), then you have to call closeResultSet(SessionDataSetWrapper wrapper) manually. Otherwise the connection is occupied by the query.
Another case that you have to manually call closeResultSet() is that when there is exception when you call SessionDataSetWrapper.hasNext() or next()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSessionPool.Builder
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCLOSE_THE_SESSION_FAILEDstatic java.lang.StringSESSION_POOL_IS_CLOSED
-
Constructor Summary
Constructors Constructor Description SessionPool(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize)SessionPool(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression)SessionPool(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression, boolean enableRedirection)SessionPool(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize, int fetchSize, long waitToGetSessionTimeoutInMs, boolean enableCompression, java.time.ZoneId zoneId, boolean enableRedirection, int connectionTimeoutInMs, Version version, int thriftDefaultBufferSize, int thriftMaxFrameSize)SessionPool(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize, java.time.ZoneId zoneId)SessionPool(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize)SessionPool(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression)SessionPool(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression, boolean enableRedirection)SessionPool(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize, int fetchSize, long waitToGetSessionTimeoutInMs, boolean enableCompression, java.time.ZoneId zoneId, boolean enableRedirection, int connectionTimeoutInMs, Version version, int thriftDefaultBufferSize, int thriftMaxFrameSize)SessionPool(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize, java.time.ZoneId zoneId)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddAlignedMeasurementInTemplate(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)voidaddAlignedMeasurementsInTemplate(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)voidaddUnalignedMeasurementInTemplate(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)voidaddUnalignedMeasurementsInTemplate(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)booleancheckTimeseriesExists(java.lang.String path)voidclose()close all connections in the poolvoidcloseResultSet(SessionDataSetWrapper wrapper)intcountMeasurementsInTemplate(java.lang.String name)voidcreateDatabase(java.lang.String database)voidcreateMultiTimeseries(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)voidcreateSchemaTemplate(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.voidcreateSchemaTemplate(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.voidcreateSchemaTemplate(Template template)Construct Template at session and create it at server.voidcreateTimeseries(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)voidcreateTimeseries(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)intcurrentAvailableSize()intcurrentOccupiedSize()voiddeleteData(java.lang.String path, long time)delete data <= time in one timeseriesvoiddeleteData(java.util.List<java.lang.String> paths, long time)delete data <= time in multiple timeseriesvoiddeleteData(java.util.List<java.lang.String> paths, long startTime, long endTime)delete data >= startTime and data <= endTime in multiple timeseriesvoiddeleteDatabase(java.lang.String database)voiddeleteDatabases(java.util.List<java.lang.String> databases)voiddeleteNodeInTemplate(java.lang.String templateName, java.lang.String path)voiddeleteStorageGroup(java.lang.String storageGroup)Deprecated.UsedeleteDatabase(String)instead.voiddeleteStorageGroups(java.util.List<java.lang.String> storageGroup)Deprecated.UsedeleteDatabases(List)instead.voiddeleteTimeseries(java.lang.String path)delete a timeseries, including data and schemavoiddeleteTimeseries(java.util.List<java.lang.String> paths)delete a timeseries, including data and schemavoiddropSchemaTemplate(java.lang.String templateName)SessionDataSetWrapperexecuteLastDataQuery(java.util.List<java.lang.String> paths)SessionDataSetWrapperexecuteLastDataQuery(java.util.List<java.lang.String> paths, long LastTime, long timeOut)voidexecuteNonQueryStatement(java.lang.String sql)execute non query statementSessionDataSetWrapperexecuteQueryStatement(java.lang.String sql)execure query sql users must call closeResultSet(SessionDataSetWrapper) if they do not use the SessionDataSet any more.SessionDataSetWrapperexecuteQueryStatement(java.lang.String sql, long timeoutInMs)execure query sql users must call closeResultSet(SessionDataSetWrapper) if they do not use the SessionDataSet any more.SessionDataSetWrapperexecuteRawDataQuery(java.util.List<java.lang.String> paths, long startTime, long endTime, long timeOut)org.apache.iotdb.service.rpc.thrift.TSConnectionInfoRespfetchAllConnections()intgetConnectionTimeoutInMs()intgetFetchSize()java.lang.StringgetHost()intgetMaxSize()java.lang.StringgetPassword()intgetPort()longgetQueryTimeout()java.lang.StringgetUser()VersiongetVersion()longgetWaitToGetSessionTimeoutInMs()java.time.ZoneIdgetZoneId()voidinsertAlignedRecord(java.lang.String multiSeriesId, long time, java.util.List<java.lang.String> multiMeasurementComponents, java.util.List<java.lang.String> values)insert aligned data in one row, if you want improve your performance, please use insertAlignedRecords method or insertTablet method.voidinsertAlignedRecord(java.lang.String multiSeriesId, long time, java.util.List<java.lang.String> multiMeasurementComponents, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> types, java.util.List<java.lang.Object> values)insert aligned data in one row, if you want improve your performance, please use insertAlignedRecords method or insertTablet method.voidinsertAlignedRecords(java.util.List<java.lang.String> multiSeriesIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> multiMeasurementComponentsList, java.util.List<java.util.List<java.lang.String>> valuesList)Insert aligned data in batch format, which can reduce the overhead of network.voidinsertAlignedRecords(java.util.List<java.lang.String> multiSeriesIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> multiMeasurementComponentsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList)Insert aligned data in batch format, which can reduce the overhead of network.voidinsertAlignedRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList)Insert aligned data that belong to the same device in batch format, which can reduce the overhead of network.voidinsertAlignedRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList, boolean haveSorted)Insert aligned data that belong to the same device in batch format, which can reduce the overhead of network.voidinsertAlignedStringRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<java.lang.String>> valuesList)Insert aligned data as String format that belong to the same device in batch format, which can reduce the overhead of network.voidinsertAlignedStringRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<java.lang.String>> valuesList, boolean haveSorted)Insert aligned data as String format that belong to the same device in batch format, which can reduce the overhead of network.voidinsertAlignedTablet(org.apache.iotdb.tsfile.write.record.Tablet tablet)insert the data of a device.voidinsertAlignedTablet(org.apache.iotdb.tsfile.write.record.Tablet tablet, boolean sorted)insert the data of a device.voidinsertAlignedTablets(java.util.Map<java.lang.String,org.apache.iotdb.tsfile.write.record.Tablet> tablets)use batch interface to insert datavoidinsertAlignedTablets(java.util.Map<java.lang.String,org.apache.iotdb.tsfile.write.record.Tablet> tablets, boolean sorted)use batch interface to insert aligned datavoidinsertOneDeviceRecords(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList)Deprecated.voidinsertOneDeviceRecords(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList, boolean haveSorted)Deprecated.voidinsertRecord(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 methodvoidinsertRecord(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 methodvoidinsertRecords(java.util.List<java.lang.String> deviceIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<java.lang.String>> valuesList)Insert data in batch format, which can reduce the overhead of network.voidinsertRecords(java.util.List<java.lang.String> deviceIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList)Insert data in batch format, which can reduce the overhead of network.voidinsertRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList)Insert data that belong to the same device in batch format, which can reduce the overhead of network.voidinsertRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList, boolean haveSorted)Insert data that belong to the same device in batch format, which can reduce the overhead of network.voidinsertStringRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<java.lang.String>> valuesList)Insert String format data that belong to the same device in batch format, which can reduce the overhead of network.voidinsertStringRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<java.lang.String>> valuesList, boolean haveSorted)Insert String format data that belong to the same device in batch format, which can reduce the overhead of network.voidinsertTablet(org.apache.iotdb.tsfile.write.record.Tablet tablet)insert the data of a device.voidinsertTablet(org.apache.iotdb.tsfile.write.record.Tablet tablet, boolean sorted)insert the data of a device.voidinsertTablets(java.util.Map<java.lang.String,org.apache.iotdb.tsfile.write.record.Tablet> tablets)use batch interface to insert datavoidinsertTablets(java.util.Map<java.lang.String,org.apache.iotdb.tsfile.write.record.Tablet> tablets, boolean sorted)use batch interface to insert aligned databooleanisEnableCompression()booleanisEnableQueryRedirection()booleanisEnableRedirection()booleanisMeasurementInTemplate(java.lang.String templateName, java.lang.String path)booleanisPathExistInTemplate(java.lang.String templateName, java.lang.String path)voidsetEnableQueryRedirection(boolean enableQueryRedirection)voidsetEnableRedirection(boolean enableRedirection)voidsetFetchSize(int fetchSize)voidsetQueryTimeout(long timeoutInMs)voidsetSchemaTemplate(java.lang.String templateName, java.lang.String prefixPath)voidsetStorageGroup(java.lang.String storageGroupId)Deprecated.UsecreateDatabase(String)instead.voidsetTimeZone(java.lang.String zoneId)voidsetVersion(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)voidtestInsertRecord(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 clientvoidtestInsertRecord(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 clientvoidtestInsertRecords(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 clientvoidtestInsertRecords(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 clientvoidtestInsertTablet(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 clientvoidtestInsertTablet(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 clientvoidtestInsertTablets(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 clientvoidtestInsertTablets(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 clientvoidunsetSchemaTemplate(java.lang.String prefixPath, java.lang.String templateName)
-
-
-
Field Detail
-
SESSION_POOL_IS_CLOSED
public static final java.lang.String SESSION_POOL_IS_CLOSED
- See Also:
- Constant Field Values
-
CLOSE_THE_SESSION_FAILED
public static final java.lang.String CLOSE_THE_SESSION_FAILED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SessionPool
public SessionPool(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize)
-
SessionPool
public SessionPool(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize)
-
SessionPool
public SessionPool(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression)
-
SessionPool
public SessionPool(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression)
-
SessionPool
public SessionPool(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression, boolean enableRedirection)
-
SessionPool
public SessionPool(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression, boolean enableRedirection)
-
SessionPool
public SessionPool(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize, java.time.ZoneId zoneId)
-
SessionPool
public SessionPool(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize, java.time.ZoneId zoneId)
-
SessionPool
public SessionPool(java.lang.String host, int port, java.lang.String user, java.lang.String password, int maxSize, int fetchSize, long waitToGetSessionTimeoutInMs, boolean enableCompression, java.time.ZoneId zoneId, boolean enableRedirection, int connectionTimeoutInMs, Version version, int thriftDefaultBufferSize, int thriftMaxFrameSize)
-
SessionPool
public SessionPool(java.util.List<java.lang.String> nodeUrls, java.lang.String user, java.lang.String password, int maxSize, int fetchSize, long waitToGetSessionTimeoutInMs, boolean enableCompression, java.time.ZoneId zoneId, boolean enableRedirection, int connectionTimeoutInMs, Version version, int thriftDefaultBufferSize, int thriftMaxFrameSize)
-
-
Method Detail
-
currentAvailableSize
public int currentAvailableSize()
-
currentOccupiedSize
public int currentOccupiedSize()
-
close
public void close()
close all connections in the pool
-
closeResultSet
public void closeResultSet(SessionDataSetWrapper wrapper)
-
insertTablet
public void insertTablet(org.apache.iotdb.tsfile.write.record.Tablet tablet) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptioninsert the data of a device. For each timestamp, the number of measurements is the same.- Parameters:
tablet- data batch- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
insertTablet
public void insertTablet(org.apache.iotdb.tsfile.write.record.Tablet tablet, boolean sorted) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptioninsert the data of a device. For each timestamp, the number of measurements is the same.Users need to control the count of Tablet and write a batch when it reaches the maxBatchSize
- Parameters:
tablet- a tablet data of one devicesorted- whether times in Tablet are in ascending order- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
insertAlignedTablet
public void insertAlignedTablet(org.apache.iotdb.tsfile.write.record.Tablet tablet) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptioninsert the data of a device. For each timestamp, the number of measurements is the same.Users need to control the count of Tablet and write a batch when it reaches the maxBatchSize
- Parameters:
tablet- a tablet data of one device- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
insertAlignedTablet
public void insertAlignedTablet(org.apache.iotdb.tsfile.write.record.Tablet tablet, boolean sorted) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptioninsert the data of a device. For each timestamp, the number of measurements is the same.Users need to control the count of Tablet and write a batch when it reaches the maxBatchSize
- Parameters:
tablet- a tablet data of one devicesorted- whether times in Tablet are in ascending order- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionuse batch interface to insert data- Parameters:
tablets- multiple batch- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionuse batch interface to insert data- Parameters:
tablets- multiple batch- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionuse batch interface to insert aligned data- Parameters:
tablets- multiple batch- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionuse batch interface to insert aligned data- Parameters:
tablets- multiple batch- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
insertRecords
public void insertRecords(java.util.List<java.lang.String> deviceIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionInsert data in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertAlignedRecords
public void insertAlignedRecords(java.util.List<java.lang.String> multiSeriesIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> multiMeasurementComponentsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionInsert aligned data in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertRecordsOfOneDevice
public void insertRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionInsert data that belong to the same device in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertOneDeviceRecords
@Deprecated public void insertOneDeviceRecords(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionDeprecated.Insert data that belong to the same device in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertStringRecordsOfOneDevice
public void insertStringRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<java.lang.String>> valuesList) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionInsert String format data that belong to the same device in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertRecordsOfOneDevice
public void insertRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList, boolean haveSorted) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionInsert data that belong to the same device in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method- Parameters:
haveSorted- whether the times list has been ordered.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertOneDeviceRecords
@Deprecated public void insertOneDeviceRecords(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList, boolean haveSorted) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionDeprecated.Insert data that belong to the same device in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method- Parameters:
haveSorted- whether the times list has been ordered.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertStringRecordsOfOneDevice
public void insertStringRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<java.lang.String>> valuesList, boolean haveSorted) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionInsert String format data that belong to the same device in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method- Parameters:
haveSorted- whether the times list has been ordered.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertAlignedRecordsOfOneDevice
public void insertAlignedRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionInsert aligned data that belong to the same device in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertAlignedStringRecordsOfOneDevice
public void insertAlignedStringRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<java.lang.String>> valuesList) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionInsert aligned data as String format that belong to the same device in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertAlignedRecordsOfOneDevice
public void insertAlignedRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList, boolean haveSorted) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionInsert aligned data that belong to the same device in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method.- Parameters:
haveSorted- whether the times list has been ordered.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertAlignedStringRecordsOfOneDevice
public void insertAlignedStringRecordsOfOneDevice(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<java.lang.String>> valuesList, boolean haveSorted) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionInsert aligned data as String format that belong to the same device in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method.- Parameters:
haveSorted- whether the times list has been ordered.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertRecords
public void insertRecords(java.util.List<java.lang.String> deviceIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<java.lang.String>> valuesList) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionInsert data in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertAlignedRecords
public void insertAlignedRecords(java.util.List<java.lang.String> multiSeriesIds, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> multiMeasurementComponentsList, java.util.List<java.util.List<java.lang.String>> valuesList) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionInsert aligned data in batch format, which can reduce the overhead of network. This method is just like jdbc batch insert, we pack some insert request in batch and send them to server If you want improve your performance, please see insertTablet method.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertTablet(Tablet)
-
insertRecord
public void insertRecord(java.lang.String deviceId, long time, java.util.List<java.lang.String> measurements, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> types, java.util.List<java.lang.Object> values) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptioninsert data in one row, if you want improve your performance, please use insertRecords method or insertTablet method- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertRecords(List, List, List, List, List),Session.insertTablet(Tablet)
-
insertAlignedRecord
public void insertAlignedRecord(java.lang.String multiSeriesId, long time, java.util.List<java.lang.String> multiMeasurementComponents, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> types, java.util.List<java.lang.Object> values) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptioninsert aligned data in one row, if you want improve your performance, please use insertAlignedRecords method or insertTablet method.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertAlignedRecords(List, List, List, List, List),Session.insertTablet(Tablet)
-
insertRecord
public void insertRecord(java.lang.String deviceId, long time, java.util.List<java.lang.String> measurements, java.util.List<java.lang.String> values) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptioninsert data in one row, if you want improve your performance, please use insertRecords method or insertTablet method- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertRecords(List, List, List, List, List),Session.insertTablet(Tablet)
-
insertAlignedRecord
public void insertAlignedRecord(java.lang.String multiSeriesId, long time, java.util.List<java.lang.String> multiMeasurementComponents, java.util.List<java.lang.String> values) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptioninsert aligned data in one row, if you want improve your performance, please use insertAlignedRecords method or insertTablet method.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException- See Also:
Session.insertAlignedRecords(List, List, List, List, List),Session.insertTablet(Tablet)
-
testInsertTablet
public void testInsertTablet(org.apache.iotdb.tsfile.write.record.Tablet tablet) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionThis method NOT insert data into database and the server just return after accept the request, this method should be used to test other time cost in client- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionThis method NOT insert data into database and the server just return after accept the request, this method should be used to test other time cost in client- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionThis method NOT insert data into database and the server just return after accept the request, this method should be used to test other time cost in client- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionThis method NOT insert data into database and the server just return after accept the request, this method should be used to test other time cost in client- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionThis method NOT insert data into database and the server just return after accept the request, this method should be used to test other time cost in client- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionThis method NOT insert data into database and the server just return after accept the request, this method should be used to test other time cost in client- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionThis method NOT insert data into database and the server just return after accept the request, this method should be used to test other time cost in client- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionThis method NOT insert data into database and the server just return after accept the request, this method should be used to test other time cost in client- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
deleteTimeseries
public void deleteTimeseries(java.lang.String path) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptiondelete a timeseries, including data and schema- Parameters:
path- timeseries to delete, should be a whole path- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptiondelete a timeseries, including data and schema- Parameters:
paths- timeseries to delete, should be a whole path- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
deleteData
public void deleteData(java.lang.String path, long time) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptiondelete data <= time in one timeseries- Parameters:
path- data in which time series to deletetime- data with time stamp less than or equal to time will be deleted- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
deleteData
public void deleteData(java.util.List<java.lang.String> paths, long time) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptiondelete data <= time in multiple timeseries- Parameters:
paths- data in which time series to deletetime- data with time stamp less than or equal to time will be deleted- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptiondelete data >= startTime and data <= endTime in multiple timeseries- Parameters:
paths- data in which time series to deletestartTime- delete range start timeendTime- delete range end time- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
setStorageGroup
@Deprecated public void setStorageGroup(java.lang.String storageGroupId) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionDeprecated.UsecreateDatabase(String)instead.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
deleteStorageGroup
@Deprecated public void deleteStorageGroup(java.lang.String storageGroup) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionDeprecated.UsedeleteDatabase(String)instead.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
deleteStorageGroups
@Deprecated public void deleteStorageGroups(java.util.List<java.lang.String> storageGroup) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionExceptionDeprecated.UsedeleteDatabases(List)instead.- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
createDatabase
public void createDatabase(java.lang.String database) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
deleteDatabase
public void deleteDatabase(java.lang.String database) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
deleteDatabases
public void deleteDatabases(java.util.List<java.lang.String> databases) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
createTimeseries
public void createTimeseries(java.lang.String path, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding, org.apache.iotdb.tsfile.file.metadata.enums.CompressionType compressor) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
createTimeseries
public void createTimeseries(java.lang.String path, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding, org.apache.iotdb.tsfile.file.metadata.enums.CompressionType compressor, java.util.Map<java.lang.String,java.lang.String> props, java.util.Map<java.lang.String,java.lang.String> tags, java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String measurementAlias) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
createMultiTimeseries
public void createMultiTimeseries(java.util.List<java.lang.String> paths, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> dataTypes, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding> encodings, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.CompressionType> compressors, java.util.List<java.util.Map<java.lang.String,java.lang.String>> propsList, java.util.List<java.util.Map<java.lang.String,java.lang.String>> tagsList, java.util.List<java.util.Map<java.lang.String,java.lang.String>> attributesList, java.util.List<java.lang.String> measurementAliasList) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
checkTimeseriesExists
public boolean checkTimeseriesExists(java.lang.String path) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
createSchemaTemplate
public void createSchemaTemplate(Template template) throws java.io.IOException, org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException
Construct Template at session and create it at server.- Throws:
java.io.IOExceptionorg.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionCreate a template with flat measurements, not tree structured. Need to specify datatype, encoding and compressor of each measurement, and alignment of these measurements at once.- Parameters:
measurements- flat measurements of the template, cannot contain character dotdataTypes- datatype of each measurement in the templateencodings- encodings of each measurement in the templatecompressors- compression type of each measurement in the templateisAligned- specify whether these flat measurements are aligned- Throws:
java.io.IOExceptionorg.apache.iotdb.rpc.IoTDBConnectionExceptionorg.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.StatementExecutionExceptionDeprecated.Compatible for rel/0.12, this method will create an unaligned flat template as a result. Notice that there is no aligned concept in 0.12, so only the first measurement in each nested list matters.- Parameters:
name- name of the templateschemaNames- it works as a virtual layer inside template in 0.12, and makes no difference after 0.13measurements- the first measurement in each nested list will constitute the final flat templatedataTypes- the data type of each measurement, only the first one in each nested list matters as aboveencodings- the encoding of each measurement, only the first one in each nested list matters as abovecompressors- the compressor of each measurement- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
addAlignedMeasurementsInTemplate
public void addAlignedMeasurementsInTemplate(java.lang.String templateName, java.util.List<java.lang.String> measurementsPath, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> dataTypes, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding> encodings, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.CompressionType> compressors) throws java.io.IOException, org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
java.io.IOExceptionorg.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
addAlignedMeasurementInTemplate
public void addAlignedMeasurementInTemplate(java.lang.String templateName, java.lang.String measurementPath, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding, org.apache.iotdb.tsfile.file.metadata.enums.CompressionType compressor) throws java.io.IOException, org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
java.io.IOExceptionorg.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
addUnalignedMeasurementsInTemplate
public void addUnalignedMeasurementsInTemplate(java.lang.String templateName, java.util.List<java.lang.String> measurementsPath, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType> dataTypes, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding> encodings, java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.CompressionType> compressors) throws java.io.IOException, org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
java.io.IOExceptionorg.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
addUnalignedMeasurementInTemplate
public void addUnalignedMeasurementInTemplate(java.lang.String templateName, java.lang.String measurementPath, org.apache.iotdb.tsfile.file.metadata.enums.TSDataType dataType, org.apache.iotdb.tsfile.file.metadata.enums.TSEncoding encoding, org.apache.iotdb.tsfile.file.metadata.enums.CompressionType compressor) throws java.io.IOException, org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
java.io.IOExceptionorg.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
deleteNodeInTemplate
public void deleteNodeInTemplate(java.lang.String templateName, java.lang.String path) throws java.io.IOException, org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
java.io.IOExceptionorg.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
countMeasurementsInTemplate
public int countMeasurementsInTemplate(java.lang.String name) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
isMeasurementInTemplate
public boolean isMeasurementInTemplate(java.lang.String templateName, java.lang.String path) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
isPathExistInTemplate
public boolean isPathExistInTemplate(java.lang.String templateName, java.lang.String path) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
showMeasurementsInTemplate
public java.util.List<java.lang.String> showMeasurementsInTemplate(java.lang.String templateName) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
showMeasurementsInTemplate
public java.util.List<java.lang.String> showMeasurementsInTemplate(java.lang.String templateName, java.lang.String pattern) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
showAllTemplates
public java.util.List<java.lang.String> showAllTemplates() throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
showPathsTemplateSetOn
public java.util.List<java.lang.String> showPathsTemplateSetOn(java.lang.String templateName) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
showPathsTemplateUsingOn
public java.util.List<java.lang.String> showPathsTemplateUsingOn(java.lang.String templateName) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
setSchemaTemplate
public void setSchemaTemplate(java.lang.String templateName, java.lang.String prefixPath) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
unsetSchemaTemplate
public void unsetSchemaTemplate(java.lang.String prefixPath, java.lang.String templateName) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
dropSchemaTemplate
public void dropSchemaTemplate(java.lang.String templateName) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
executeQueryStatement
public SessionDataSetWrapper executeQueryStatement(java.lang.String sql) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException
execure query sql users must call closeResultSet(SessionDataSetWrapper) if they do not use the SessionDataSet any more. users do not need to call sessionDataSet.closeOpeationHandler() any more.- Parameters:
sql- query statement- Returns:
- result set Notice that you must get the result instance. Otherwise a data leakage will happen
- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
executeQueryStatement
public SessionDataSetWrapper executeQueryStatement(java.lang.String sql, long timeoutInMs) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException
execure query sql users must call closeResultSet(SessionDataSetWrapper) if they do not use the SessionDataSet any more. users do not need to call sessionDataSet.closeOpeationHandler() any more.- Parameters:
sql- query statementtimeoutInMs- the timeout of this query, in milliseconds- Returns:
- result set Notice that you must get the result instance. Otherwise a data leakage will happen
- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
executeNonQueryStatement
public void executeNonQueryStatement(java.lang.String sql) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionExceptionexecute non query statement- Parameters:
sql- non query statement- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
executeRawDataQuery
public SessionDataSetWrapper executeRawDataQuery(java.util.List<java.lang.String> paths, long startTime, long endTime, long timeOut) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException
- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
executeLastDataQuery
public SessionDataSetWrapper executeLastDataQuery(java.util.List<java.lang.String> paths, long LastTime, long timeOut) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException
- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
executeLastDataQuery
public SessionDataSetWrapper executeLastDataQuery(java.util.List<java.lang.String> paths) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException
- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
getMaxSize
public int getMaxSize()
-
getHost
public java.lang.String getHost()
-
getPort
public int getPort()
-
getUser
public java.lang.String getUser()
-
getPassword
public java.lang.String getPassword()
-
setFetchSize
public void setFetchSize(int fetchSize)
-
getFetchSize
public int getFetchSize()
-
setTimeZone
public void setTimeZone(java.lang.String zoneId) throws org.apache.iotdb.rpc.StatementExecutionException, org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.StatementExecutionExceptionorg.apache.iotdb.rpc.IoTDBConnectionException
-
getZoneId
public java.time.ZoneId getZoneId()
-
getWaitToGetSessionTimeoutInMs
public long getWaitToGetSessionTimeoutInMs()
-
isEnableCompression
public boolean isEnableCompression()
-
setEnableRedirection
public void setEnableRedirection(boolean enableRedirection)
-
isEnableRedirection
public boolean isEnableRedirection()
-
setEnableQueryRedirection
public void setEnableQueryRedirection(boolean enableQueryRedirection)
-
isEnableQueryRedirection
public boolean isEnableQueryRedirection()
-
getConnectionTimeoutInMs
public int getConnectionTimeoutInMs()
-
fetchAllConnections
public org.apache.iotdb.service.rpc.thrift.TSConnectionInfoResp fetchAllConnections() throws org.apache.iotdb.rpc.IoTDBConnectionException- Throws:
org.apache.iotdb.rpc.IoTDBConnectionException
-
setVersion
public void setVersion(Version version)
-
getVersion
public Version getVersion()
-
setQueryTimeout
public void setQueryTimeout(long timeoutInMs)
-
getQueryTimeout
public long getQueryTimeout()
-
-