Overview of thrift-datanode RPC interfaces
masterthrift-datanode module maintains all Remote Procedure Call (RPC) interfaces used for communication between IoTDB clients and the server.repository·master·Indexed 27 days ago
https://github.com/apache/iotdbA high-performance, lightweight data management system designed for time series data in industrial IoT applications. This documentation covers Docker deployment (standalone, confignode, datanode, and ainode), MQTT service customization, JDBC and ODBC connectivity, C REST client implementation, and integration testing in simple and cluster modes.
thrift-datanode module maintains all Remote Procedure Call (RPC) interfaces used for communication between IoTDB clients and the server.Apache IoTDB is designed to be deployed as operator-managed infrastructure within a trusted network by default. Understanding the trust boundaries is critical for secure deployment:
root superuser and those controlling the deployment/host are considered trusted.The Consensus Layer provides an abstraction for managing multiple copies of application data to ensure fault tolerance and data integrity. It hides the complexities of specific consensus algorithms (like Raft) behind a unified interface.
IStateMachine: The user application component that manages a local copy of the data.Peer: The smallest consensus unit within a process, which contains an IStateMachine.ConsensusGroup: A collection of Peer instances that all manage the same copy of data.IConsensus: The interface defining the core functionality of the Consensus Layer.ConsensusFactory: The entry point used to instantiate specific consensus implementations.When writing data to a ConsensusGroup via IConsensus::write, the operation is sent to the group leader's IStateMachine::write. The leader decides on the write, applies it to its local state machine, and forwards the operation to other members in the group.
Choose the pre-built SDK zip file based on your target environment's operating system and glibc/MSVC version. Once downloaded, unzip it and set the IOTDB_SESSION_HOME environment variable to the extraction directory to simplify integration.
Available Classifiers:
linux-x86_64-glibc2.28linux-aarch64-glibc2.28macos-x86_64macos-aarch64windows-x86_64-msvc14.1windows-x86_64-msvc14.2windows-x86_64-msvc14.3windows-x86_64-msvc14.4The SDK includes include/ (public API headers), lib/ (shared/dynamic libraries), cmake/ (package config), and pkgconfig/ (metadata). Thrift and Boost are already encapsulated and do not require separate installation.
unzip iotdb-session-cpp-2.0.11-SNAPSHOT-linux-x86_64-glibc2.28.zip
export IOTDB_SESSION_HOME=$PWD/iotdb-session-cpp-2.0.11-SNAPSHOT-linux-x86_64-glibc2.28When upgrading from version 0.11.x to 0.12.x, perform the following updates in your configuration:
iotdb_version to 0.12.x.virtual_storage_group_num property.time_encoder property.You can build the C++ client using either Maven (as a wrapper) or standalone CMake.
Use Maven to build the SDK and package it into a zip file. The Maven build sets the installation prefix to target/install/.
Linux/macOS (Library only):
mvn -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests packageWindows (MSVC): You must provide the path to your Boost installation.
mvn -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests "-Dboost.include.dir=C:\boost_1_88_0" packageIf Maven is not available, use CMake directly.
Linux/macOS:
cmake -S iotdb-client/client-cpp -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target installWindows (Visual Studio):
cmake -S iotdb-client/client-cpp -B build -G "Visual Studio 17 2022" -A x64
cmake --build build --config Release --target installYou can build the C++ SDK using Maven or directly via CMake.
To build the package using Maven, use the with-cpp profile. To perform an offline build, set iotdb.offline=ON and ensure all required platform-specific tarballs are pre-populated in the third-party/ sub-directory.
To build using CMake, you can use the IOTDB_OFFLINE flag for offline builds.
Before building offline, you must manually place the following files in the third-party/ directory corresponding to your platform:
thrift-0.23.0.tar.gz, boost_1_60_0.tar.gz, m4-1.4.19.tar.gz, flex-2.6.4.tar.gz, bison-3.8.tar.gz, and optionally openssl-3.5.0.tar.gz.thrift-0.23.0.tar.gz, boost_1_84_0.tar.gz, and optionally openssl-3.5.0.tar.gz.thrift-0.23.0.tar.gz, boost_1_60_0.tar.gz, and optionally openssl-3.5.0.tar.gz.# Maven offline build
mvn -P with-cpp -pl iotdb-client/client-cpp -am -DskipTests \
-Diotdb.offline=ON package
# CMake offline build
cmake -S iotdb-client/client-cpp -B build -DIOTDB_OFFLINE=ON
cmake --build build --config Release --target installIntegration tests in Simple mode (1 config node and 1 data node running tree model ITs) can be executed via Maven.
To run only the integration tests, use the following command:
mvn clean verify -DskipUTs -pl integration-test -am -P with-integration-testsNote for IDE users (IntelliJ): If running in an IDE for the first time or after changing dependent module code, you must first generate the integration-test/target/template-node directory using this command:
mvn clean package -DskipTests -pl integration-test -am -P with-integration-testsOnce generated, you can run individual test cases directly from the IDE.
To add an AINode to an existing cluster, you can use Docker Compose or a docker run command with specific environment variables to point to the ConfigNode and cluster ingress settings.
# Using Docker Compose (requires docker-compose-ainode.yml)
docker compose -f docker-compose-ainode.yml up -d
# Using Docker Run (v2.0.7+)
docker run -d \
--name iotdb-ainode \
--network host \
-p 10810:10810 \
-p 8080:8080 \
-e AIN_SEED_CONFIG_NODE=127.0.0.1:10710 \
-e AIN_RPC_ADDRESS=127.0.0.1 \
-e AIN_RPC_PORT=10810 \
-e AIN_CLUSTER_INGRESS_ADDRESS=127.0.0.1 \
-e AIN_CLUSTER_INGRESS_PORT=6667 \
-e AIN_CLUSTER_INGRESS_USERNAME=root \
-e AIN_CLUSTER_INGRESS_PASSWORD=root \
apache/iotdb:2.0.11-SNAPSHOT-ainodeWhen upgrading from IoTDB 0.8.x to 0.9.x (version-1), note the following API additions and removals:
TSBatchInsertionReq and the insertBatch method (returning TSExecuteBatchStatementResp).TSCreateTimeseriesReq and the createTimeseries method. Also added TSCreateMultiTimeseriesReq and createMultiTimeseries.TSInsertReq and the insertRow method. Added TSDeleteDataReq and the deleteData method. Added deleteTimeseries and deleteStorageGroups methods.TSStatusType.TSSetStorageGroupReq has been removed.TSDataValue and TSRowRecord have been removed.TSFetchMetadataResp have been removed, including version, childPaths, nodesList, storageGroups, devices, nodeTimeseriesNum, timeseriesList, and timeseriesNum.When upgrading from IoTDB 0.9.x (version-1) to 0.10.x (version-2), note these significant API renames and changes:
insertRows $\rightarrow$ insertRecordsinsert $\rightarrow$ insertRecordinsertBatch $\rightarrow$ insertTabletTSStatusType $\rightarrow$ TSStatusTS_SessionHandles $\rightarrow$ SessionIdsTSOperationHandle $\rightarrow$ queryIdsTSInsertInBatchReq and TSInsertReq, use TsDataType and binary instead of string.sessionId is now a required parameter in getTimeZone, getProperties, setStorageGroup, and createTimeseries.TSExecuteStatementResp and TSFetchResultsResp now include an optional TSQueryNonAlignDataSet. TSFetchResultsReq now requires a bool isAlign field.TSInsertTabletsReq and the insertTablets method.inferType field to TSInsertRecordReq.TS_SessionHandle and TSHandleIdentifier have been removed.TSStatus and TSExecuteInsertRowInBatchResp have been removed.