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()
-
-
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 ip, int port, java.lang.String user, java.lang.String password, int maxSize)SessionPool(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression)SessionPool(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression, boolean enableCacheLeader)SessionPool(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize, int fetchSize, long waitToGetSessionTimeoutInMs, boolean enableCompression, java.time.ZoneId zoneId, boolean enableCacheLeader, int connectionTimeoutInMs)SessionPool(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize, java.time.ZoneId zoneId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckTimeseriesExists(java.lang.String path)voidclose()close all connections in the poolvoidcloseResultSet(SessionDataSetWrapper wrapper)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)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 timeseriesvoiddeleteStorageGroup(java.lang.String storageGroup)voiddeleteStorageGroups(java.util.List<java.lang.String> storageGroup)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 schemavoidexecuteNonQueryStatement(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.SessionDataSetWrapperexecuteRawDataQuery(java.util.List<java.lang.String> paths, long startTime, long endTime)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)Insert data that belong to the same device in batch format, which can reduce the overhead of network.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)Insert data that belong to the same device in batch format, which can reduce the overhead of network.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.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 datavoidsetStorageGroup(java.lang.String storageGroupId)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 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 client
-
-
-
Field Detail
-
SESSION_POOL_IS_CLOSED
public static final java.lang.String SESSION_POOL_IS_CLOSED
- See Also:
- Constant Field Values
-
CLOSE_THE_SESSION_FAILED
public static final java.lang.String CLOSE_THE_SESSION_FAILED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SessionPool
public SessionPool(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize)
-
SessionPool
public SessionPool(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression)
-
SessionPool
public SessionPool(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize, boolean enableCompression, boolean enableCacheLeader)
-
SessionPool
public SessionPool(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize, java.time.ZoneId zoneId)
-
SessionPool
public SessionPool(java.lang.String ip, int port, java.lang.String user, java.lang.String password, int maxSize, int fetchSize, long waitToGetSessionTimeoutInMs, boolean enableCompression, java.time.ZoneId zoneId, boolean enableCacheLeader, int connectionTimeoutInMs)
-
-
Method Detail
-
currentAvailableSize
public int currentAvailableSize()
-
currentOccupiedSize
public int currentOccupiedSize()
-
close
public void close()
close all connections in the pool
-
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
-
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
-
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 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)
-
insertOneDeviceRecords
public void insertOneDeviceRecords(java.lang.String deviceId, java.util.List<java.lang.Long> times, java.util.List<java.util.List<java.lang.String>> measurementsList, java.util.List<java.util.List<org.apache.iotdb.tsfile.file.metadata.enums.TSDataType>> typesList, java.util.List<java.util.List<java.lang.Object>> valuesList) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.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
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.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)
-
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)
-
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)
-
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)
-
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
-
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
-
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
public void setStorageGroup(java.lang.String storageGroupId) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
deleteStorageGroup
public void deleteStorageGroup(java.lang.String storageGroup) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
deleteStorageGroups
public void deleteStorageGroups(java.util.List<java.lang.String> storageGroup) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException- Throws:
org.apache.iotdb.rpc.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
-
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
-
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) throws org.apache.iotdb.rpc.IoTDBConnectionException, org.apache.iotdb.rpc.StatementExecutionException
- Throws:
org.apache.iotdb.rpc.IoTDBConnectionExceptionorg.apache.iotdb.rpc.StatementExecutionException
-
-