pub struct Session { /* private fields */ }Expand description
IotDB Session
Implementations§
Source§impl Session
impl Session
pub fn connect(config: Config) -> Result<Session>
pub fn is_open(&self) -> bool
pub fn is_close(&self) -> bool
pub fn close(&mut self) -> Result<()>
Sourcepub fn set_storage_group(&mut self, storage_group: &str) -> Result<()>
pub fn set_storage_group(&mut self, storage_group: &str) -> Result<()>
Set a storage group
Sourcepub fn delete_storage_group(&mut self, storage_group: &str) -> Result<()>
pub fn delete_storage_group(&mut self, storage_group: &str) -> Result<()>
Delete a storage group.
Sourcepub fn delete_storage_groups(
&mut self,
storage_groups: Vec<String>,
) -> Result<()>
pub fn delete_storage_groups( &mut self, storage_groups: Vec<String>, ) -> Result<()>
Delete storage groups.
Sourcepub fn create_time_series(
&mut self,
ts_path: &str,
data_type: DataType,
encoding: Encoding,
compressor: Compressor,
) -> Result<()>
pub fn create_time_series( &mut self, ts_path: &str, data_type: DataType, encoding: Encoding, compressor: Compressor, ) -> Result<()>
Create single time-series
Sourcepub fn create_multi_time_series(
&mut self,
ts_path_vec: Vec<String>,
data_type_vec: Vec<i32>,
encoding_vec: Vec<i32>,
compressor_vec: Vec<i32>,
) -> Result<()>
pub fn create_multi_time_series( &mut self, ts_path_vec: Vec<String>, data_type_vec: Vec<i32>, encoding_vec: Vec<i32>, compressor_vec: Vec<i32>, ) -> Result<()>
Create multiple time-series
Sourcepub fn delete_time_series(&mut self, path_vec: Vec<String>) -> Result<()>
pub fn delete_time_series(&mut self, path_vec: Vec<String>) -> Result<()>
Delete multiple time series
Sourcepub fn check_time_series_exists(&mut self, path: &str) -> Result<bool>
pub fn check_time_series_exists(&mut self, path: &str) -> Result<bool>
Check whether a specific time-series exists
Sourcepub fn delete_data(
&mut self,
path_vec: Vec<String>,
timestamp: i64,
) -> Result<()>
pub fn delete_data( &mut self, path_vec: Vec<String>, timestamp: i64, ) -> Result<()>
Delete all data <= time in multiple time-series
Sourcepub fn insert_string_records(
&mut self,
device_ids: Vec<String>,
timestamps: Vec<i64>,
measurements_list: Vec<Vec<String>>,
values_list: Vec<Vec<String>>,
is_aligned: bool,
) -> Result<()>
pub fn insert_string_records( &mut self, device_ids: Vec<String>, timestamps: Vec<i64>, measurements_list: Vec<Vec<String>>, values_list: Vec<Vec<String>>, is_aligned: bool, ) -> Result<()>
special case for inserting one row of String (TEXT) value
Sourcepub fn insert_record(
&mut self,
device_id: &str,
timestamp: i64,
measurements: Vec<String>,
values: Vec<u8>,
is_aligned: bool,
) -> Result<()>
pub fn insert_record( &mut self, device_id: &str, timestamp: i64, measurements: Vec<String>, values: Vec<u8>, is_aligned: bool, ) -> Result<()>
Insert record
Sourcepub fn test_insert_record(
&mut self,
prefix_path: &str,
timestamp: i64,
measurements: Vec<String>,
values: Vec<u8>,
is_aligned: bool,
) -> Result<()>
pub fn test_insert_record( &mut self, prefix_path: &str, timestamp: i64, measurements: Vec<String>, values: Vec<u8>, is_aligned: bool, ) -> Result<()>
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
Sourcepub fn insert_records(
&mut self,
prefix_paths: Vec<String>,
timestamps: Vec<i64>,
measurements_list: Vec<Vec<String>>,
values_list: Vec<Vec<u8>>,
is_aligned: bool,
) -> Result<()>
pub fn insert_records( &mut self, prefix_paths: Vec<String>, timestamps: Vec<i64>, measurements_list: Vec<Vec<String>>, values_list: Vec<Vec<u8>>, is_aligned: bool, ) -> Result<()>
Insert records
Sourcepub fn test_insert_records(
&mut self,
prefix_paths: Vec<String>,
timestamps: Vec<i64>,
measurements_list: Vec<Vec<String>>,
values_list: Vec<Vec<u8>>,
is_aligned: bool,
) -> Result<()>
pub fn test_insert_records( &mut self, prefix_paths: Vec<String>, timestamps: Vec<i64>, measurements_list: Vec<Vec<String>>, values_list: Vec<Vec<u8>>, is_aligned: bool, ) -> Result<()>
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
Sourcepub fn insert_tablet(
&mut self,
prefix_path: &str,
measurements: Vec<String>,
values: Vec<u8>,
timestamps: Vec<u8>,
types: Vec<i32>,
size: i32,
is_aligned: bool,
) -> Result<()>
pub fn insert_tablet( &mut self, prefix_path: &str, measurements: Vec<String>, values: Vec<u8>, timestamps: Vec<u8>, types: Vec<i32>, size: i32, is_aligned: bool, ) -> Result<()>
insert one tablet, in a tablet, for each timestamp, the number of measurements is same for example three records in the same device can form a tablet: timestamps, m1, m2, m3 1, 125.3, True, text1 2, 111.6, False, text2 3, 688.6, True, text3 Notice: The tablet should not have empty cell The tablet itself is sorted TODO
Sourcepub fn insert_tablets(
&mut self,
prefix_paths: Vec<String>,
measurements_list: Vec<Vec<String>>,
values_list: Vec<Vec<u8>>,
timestamps_list: Vec<Vec<u8>>,
types_list: Vec<Vec<i32>>,
size_list: Vec<i32>,
is_aligned: bool,
) -> Result<()>
pub fn insert_tablets( &mut self, prefix_paths: Vec<String>, measurements_list: Vec<Vec<String>>, values_list: Vec<Vec<u8>>, timestamps_list: Vec<Vec<u8>>, types_list: Vec<Vec<i32>>, size_list: Vec<i32>, is_aligned: bool, ) -> Result<()>
insert multiple tablets, tablets are independent to each other TODO
Sourcepub fn insert_records_of_one_device()
pub fn insert_records_of_one_device()
TODO
Sourcepub fn insert_records_of_one_device_sorte()
pub fn insert_records_of_one_device_sorte()
TODO
Sourcepub fn gen_insert_records_of_one_device_request()
pub fn gen_insert_records_of_one_device_request()
TODO
Sourcepub fn test_insert_table()
pub fn test_insert_table()
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 TODO
Sourcepub fn test_insert_tablets()
pub fn test_insert_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 TODO
Sourcepub fn gen_insert_tablet_req()
pub fn gen_insert_tablet_req()
TODO
Sourcepub fn gen_insert_tablets_req()
pub fn gen_insert_tablets_req()
TODO
pub fn sql(&mut self, sql: &str) -> Result<DataSet>
Sourcepub fn exec_batch(&mut self, statements: Vec<String>) -> Result<()>
pub fn exec_batch(&mut self, statements: Vec<String>) -> Result<()>
execute batch statement and return a DataSets
Sourcepub fn exec_query(&mut self, query: &str) -> Result<DataSet>
pub fn exec_query(&mut self, query: &str) -> Result<DataSet>
execute query sql statement and return a DataSet
Sourcepub fn exec_update(&mut self, statement: &str) -> Result<DataSet>
pub fn exec_update(&mut self, statement: &str) -> Result<DataSet>
execute update statement and return a DataSet
Sourcepub fn exec_raw_data_query(
&mut self,
paths: Vec<String>,
start_time: i64,
end_time: i64,
) -> Result<DataSet>
pub fn exec_raw_data_query( &mut self, paths: Vec<String>, start_time: i64, end_time: i64, ) -> Result<DataSet>
execute row statement and return a DataSets
Sourcepub fn set_time_zone(&mut self, time_zone: &str) -> Result<()>
pub fn set_time_zone(&mut self, time_zone: &str) -> Result<()>
Set time zone
Auto Trait Implementations§
impl Freeze for Session
impl !RefUnwindSafe for Session
impl !Send for Session
impl !Sync for Session
impl Unpin for Session
impl !UnwindSafe for Session
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more