|
| 1 | +# **核心概念** |
| 2 | + |
| 3 | +### **Row Record** |
| 4 | + |
| 5 | +- 对**IoTDB**中的`record`数据进行封装和抽象。 |
| 6 | +- 示例: |
| 7 | + |
| 8 | +| timestamp | status | temperature | |
| 9 | +| --------- | ------ | ----------- | |
| 10 | +| 1 | 0 | 20 | |
| 11 | + |
| 12 | +- 构造方法: |
| 13 | + |
| 14 | +```c# |
| 15 | +var rowRecord = |
| 16 | + new RowRecord(long timestamps, List<object> values, List<string> measurements); |
| 17 | +``` |
| 18 | + |
| 19 | +### **Tablet** |
| 20 | + |
| 21 | +- 一种类似于表格的数据结构,包含一个设备的若干行非空数据块。 |
| 22 | +- 示例: |
| 23 | + |
| 24 | +| time | status | temperature | |
| 25 | +| ---- | ------ | ----------- | |
| 26 | +| 1 | 0 | 20 | |
| 27 | +| 2 | 0 | 20 | |
| 28 | +| 3 | 3 | 21 | |
| 29 | + |
| 30 | +- 构造方法: |
| 31 | + |
| 32 | +```c# |
| 33 | +var tablet = |
| 34 | + Tablet(string deviceId, List<string> measurements, List<List<object>> values, List<long> timestamps); |
| 35 | +``` |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +# **API** |
| 40 | + |
| 41 | +### **基础接口** |
| 42 | + |
| 43 | +| api name | parameters | notes | use example | |
| 44 | +| -------------- | ------------------------- | ------------------------ | ----------------------------- | |
| 45 | +| Open | bool | open session | session_pool.Open(false) | |
| 46 | +| Close | null | close session | session_pool.Close() | |
| 47 | +| IsOpen | null | check if session is open | session_pool.IsOpen() | |
| 48 | +| OpenDebugMode | LoggingConfiguration=null | open debug mode | session_pool.OpenDebugMode() | |
| 49 | +| CloseDebugMode | null | close debug mode | session_pool.CloseDebugMode() | |
| 50 | +| SetTimeZone | string | set time zone | session_pool.GetTimeZone() | |
| 51 | +| GetTimeZone | null | get time zone | session_pool.GetTimeZone() | |
| 52 | + |
| 53 | +### **Record相关接口** |
| 54 | + |
| 55 | +| api name | parameters | notes | use example | |
| 56 | +| ----------------------------------- | ----------------------------- | ----------------------------------- | ------------------------------------------------------------ | |
| 57 | +| InsertRecordAsync | string, RowRecord | insert single record | session_pool.InsertRecordAsync("root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE", new RowRecord(1, values, measures)); | |
| 58 | +| InsertRecordsAsync | List<string>, List<RowRecord> | insert records | session_pool.InsertRecordsAsync(device_id, rowRecords) | |
| 59 | +| InsertRecordsOfOneDeviceAsync | string, List<RowRecord> | insert records of one device | session_pool.InsertRecordsOfOneDeviceAsync(device_id, rowRecords) | |
| 60 | +| InsertRecordsOfOneDeviceSortedAsync | string, List<RowRecord> | insert sorted records of one device | InsertRecordsOfOneDeviceSortedAsync(deviceId, sortedRowRecords); | |
| 61 | +| TestInsertRecordAsync | string, RowRecord | test insert record | session_pool.TestInsertRecordAsync("root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE", rowRecord) | |
| 62 | +| TestInsertRecordsAsync | List<string>, List<RowRecord> | test insert record | session_pool.TestInsertRecordsAsync(device_id, rowRecords) | |
| 63 | + |
| 64 | +### **Tablet相关接口** |
| 65 | + |
| 66 | +| api name | parameters | notes | use example | |
| 67 | +| ---------------------- | ------------ | -------------------- | -------------------------------------------- | |
| 68 | +| InsertTabletAsync | Tablet | insert single tablet | session_pool.InsertTabletAsync(tablet) | |
| 69 | +| InsertTabletsAsync | List<Tablet> | insert tablets | session_pool.InsertTabletsAsync(tablets) | |
| 70 | +| TestInsertTabletAsync | Tablet | test insert tablet | session_pool.TestInsertTabletAsync(tablet) | |
| 71 | +| TestInsertTabletsAsync | List<Tablet> | test insert tablets | session_pool.TestInsertTabletsAsync(tablets) | |
| 72 | + |
| 73 | +- ### **SQL语句接口** |
| 74 | + |
| 75 | +| api name | parameters | notes | use example | |
| 76 | +| ----------------------------- | ---------- | ------------------------------ | ------------------------------------------------------------ | |
| 77 | +| ExecuteQueryStatementAsync | string | execute sql query statement | session_pool.ExecuteQueryStatementAsync("select * from root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE where time<15"); | |
| 78 | +| ExecuteNonQueryStatementAsync | string | execute sql nonquery statement | session_pool.ExecuteNonQueryStatementAsync( "create timeseries root.97209_TEST_CSHARP_CLIENT_GROUP.TEST_CSHARP_CLIENT_DEVICE.status with datatype=BOOLEAN,encoding=PLAIN") | |
| 79 | + |
| 80 | +- ### 数据表接口 |
| 81 | + |
| 82 | +| api name | parameters | notes | use example | |
| 83 | +| -------------------------- | ------------------------------------------------------------ | --------------------------- | ------------------------------------------------------------ | |
| 84 | +| SetStorageGroup | string | set storage group | session_pool.SetStorageGroup("root.97209_TEST_CSHARP_CLIENT_GROUP_01") | |
| 85 | +| CreateTimeSeries | string, TSDataType, TSEncoding, Compressor | create time series | session_pool.InsertTabletsAsync(tablets) | |
| 86 | +| DeleteStorageGroupAsync | string | delete single storage group | session_pool.DeleteStorageGroupAsync("root.97209_TEST_CSHARP_CLIENT_GROUP_01") | |
| 87 | +| DeleteStorageGroupsAsync | List<string> | delete storage group | session_pool.DeleteStorageGroupAsync("root.97209_TEST_CSHARP_CLIENT_GROUP") | |
| 88 | +| CreateMultiTimeSeriesAsync | List<string>, List<TSDataType> , List<TSEncoding> , List<Compressor> | create multi time series | session_pool.CreateMultiTimeSeriesAsync(ts_path_lst, data_type_lst, encoding_lst, compressor_lst); | |
| 89 | +| DeleteTimeSeriesAsync | List<string> | delete time series | | |
| 90 | +| DeleteTimeSeriesAsync | string | delete time series | | |
| 91 | +| DeleteDataAsync | List<string>, long, long | delete data | session_pool.DeleteDataAsync(ts_path_lst, 2, 3) | |
| 92 | + |
| 93 | +- ### **辅助接口** |
| 94 | + |
| 95 | +| api name | parameters | notes | use example | |
| 96 | +| -------------------------- | ---------- | --------------------------- | ---------------------------------------------------- | |
| 97 | +| CheckTimeSeriesExistsAsync | string | check if time series exists | session_pool.CheckTimeSeriesExistsAsync(time series) | |
| 98 | + |
0 commit comments