Communication Service protocol

    IoTDB server and client use thrift for communication. In actual use, it is recommended to use the native client package provided by IoTDB: Session or Session Pool. If you have special needs, you can also program directly against the RPC interface

    to change the default thrift port

    1. TSOpenSessionResp openSession(1:TSOpenSessionReq req);
    2. // close a session
    3. TSStatus closeSession(1:TSCloseSessionReq req);
    4. // run an SQL statement in batch
    5. TSExecuteStatementResp executeStatement(1:TSExecuteStatementReq req);
    6. // execute SQL statement in batch
    7. TSStatus executeBatchStatement(1:TSExecuteBatchStatementReq req);
    8. // execute query SQL statement
    9. TSExecuteStatementResp executeQueryStatement(1:TSExecuteStatementReq req);
    10. // execute insert, delete and update SQL statement
    11. TSExecuteStatementResp executeUpdateStatement(1:TSExecuteStatementReq req);
    12. // fetch next query result
    13. TSFetchResultsResp fetchResults(1:TSFetchResultsReq req)
    14. // fetch meta data
    15. TSFetchMetadataResp fetchMetadata(1:TSFetchMetadataReq req)
    16. // cancel a query
    17. TSStatus cancelOperation(1:TSCancelOperationReq req);
    18. // close a query dataset
    19. TSStatus closeOperation(1:TSCloseOperationReq req);
    20. TSGetTimeZoneResp getTimeZone(1:i64 sessionId);
    21. // set time zone
    22. // get server's properties
    23. ServerProperties getProperties();
    24. // set storage group
    25. TSStatus setStorageGroup(1:i64 sessionId, 2:string storageGroup);
    26. // create timeseries
    27. TSStatus createTimeseries(1:TSCreateTimeseriesReq req);
    28. // create multi timeseries
    29. TSStatus createMultiTimeseries(1:TSCreateMultiTimeseriesReq req);
    30. // delete timeseries
    31. TSStatus deleteTimeseries(1:i64 sessionId, 2:list<string> path)
    32. // delete sttorage groups
    33. TSStatus deleteStorageGroups(1:i64 sessionId, 2:list<string> storageGroup);
    34. // insert record
    35. TSStatus insertRecord(1:TSInsertRecordReq req);
    36. // insert record in string format
    37. TSStatus insertStringRecord(1:TSInsertStringRecordReq req);
    38. // insert tablet
    39. TSStatus insertTablet(1:TSInsertTabletReq req);
    40. // insert tablets in batch
    41. TSStatus insertTablets(1:TSInsertTabletsReq req);
    42. TSStatus insertRecords(1:TSInsertRecordsReq req);
    43. // insert records of one device
    44. TSStatus insertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
    45. // insert records in batch as string format
    46. TSStatus insertStringRecords(1:TSInsertStringRecordsReq req);
    47. // test the latency of innsert tablet,caution:no data will be inserted, only for test latency
    48. TSStatus testInsertTablet(1:TSInsertTabletReq req);
    49. // test the latency of innsert tablets,caution:no data will be inserted, only for test latency
    50. TSStatus testInsertTablets(1:TSInsertTabletsReq req);
    51. // test the latency of innsert record,caution:no data will be inserted, only for test latency
    52. TSStatus testInsertRecord(1:TSInsertRecordReq req);
    53. // test the latency of innsert record in string format,caution:no data will be inserted, only for test latency
    54. TSStatus testInsertStringRecord(1:TSInsertStringRecordReq req);
    55. // test the latency of innsert records,caution:no data will be inserted, only for test latency
    56. TSStatus testInsertRecords(1:TSInsertRecordsReq req);
    57. // test the latency of innsert records of one device,caution:no data will be inserted, only for test latency
    58. TSStatus testInsertRecordsOfOneDevice(1:TSInsertRecordsOfOneDeviceReq req);
    59. // test the latency of innsert records in string formate,caution:no data will be inserted, only for test latency
    60. TSStatus testInsertStringRecords(1:TSInsertStringRecordsReq req);
    61. // delete data
    62. TSStatus deleteData(1:TSDeleteDataReq req);
    63. // execute raw data query
    64. TSExecuteStatementResp executeRawDataQuery(1:TSRawDataQueryReq req);
    65. i64 requestStatementId(1:i64 sessionId);

    We will use thrift compile IDL file in mvn Compilation, in which generate target .class file target file path is “thrift/target/classes/org/apache/iotdb/service/rpc/thrift”