Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Updated on 2023-04-28 GMT+08:00

Java API

IoTDB provides a connection pool (SessionPool) for native APIs. When using the APIs, you only need to specify the pool size to obtain connections from the pool. If you cannot get a connection in 60 seconds, a warning log will be printed, but the program continues to wait.

When a connection is used, it automatically returns to the pool and waits to be used next time. When a connection is damaged, it is deleted from the pool and a new connection is created to perform user operations again.

For query operations:

  1. When SessionPool is used for query, the result set is SessionDataSetWrapper, the encapsulation class of SessionDataSet.
  2. If a query result set is not traversed and you do not want to continue traversing, you need to call closeResultSet to release the connection.
  3. If an exception is reported when you traverse a query result set, you need to call closeResultSet to release the connection.
  4. You can call the getColumnNames() method of SessionDataSetWrapper to obtain the column names in the result set.
Table 1 Sessions APIs and corresponding parameters

Method

Description

  • Session(String host, int rpcPort)
  • Session(String host, String rpcPort, String username, String password)
  • Session(String host, int rpcPort, String username, String password)

Initializes a session.

Session.open()

Opens a session.

Session.close()

Closes a session.

void setStorageGroup(String storageGroupId)

Sets a storage group.

  • void deleteStorageGroup(String storageGroup)
  • void deleteStorageGroups(List<String> storageGroups)

Deletes one or more storage groups.

  • void createTimeseries(String path, TSDataType dataType, TSEncoding encoding, CompressionType compressor, Map<String, String> props, Map<String, String> tags, Map<String, String> attributes, String measurementAlias)
  • void createMultiTimeseries(List<String> paths, List<TSDataType> dataTypes, List<TSEncoding> encodings, List<CompressionType> compressors, List<Map<String, String>> propsList, List<Map<String, String>> tagsList, List<Map<String, String>> attributesList, List<String> measurementAliasList)

Creates one or more time series.

  • void deleteTimeseries(String path)
  • void deleteTimeseries(List<String> paths)

Deletes one or more time series.

  • void deleteData(String path, long time)
  • void deleteData(List<String> paths, long time)

Deletes the data of one or more time series before or at a specific time point.

void insertRecord(String deviceId, long time, List<String> measurements, List<String> values)

Inserts a record, which contains the data of multiple measurement points of a device at a timestamp. Servers need to perform type inference, which may take extra time.

void insertTablet(Tablet tablet)

Inserts a tablet, which contains multiple rows of non-empty data blocks. The columns in each row are the same.

void insertTablets(Map<String, Tablet> tablet)

Inserts multiple tablets.

void insertRecords(List<String> deviceIds, List<Long> times, List<List<String>> measurementsList, List<List<String>> valuesList)

Inserts multiple records. Servers need to perform type inference, which may take extra time.

void insertRecord(String deviceId, long time, List<String> measurements, List<TSDataType> types, List<Object> values)

Inserts a record, which contains the data of multiple measurement points of a device at a timestamp. With the data type information, servers do not need to perform type inference, improving the performance.

void insertRecords(List<String> deviceIds, List<Long> times, List<List<String>> measurementsList, List<List<TSDataType>> typesList, List<List<Object>> valuesList)

Inserts multiple records. With the data type information, servers do not need to perform type inference, improving the performance.

submitApplication(SubmitApplicationRequest request)

Used by the client to submit a new application to ResourceManager.

void insertRecordsOfOneDevice(String deviceId, List<Long> times, List<List<String>> measurementsList, List<List<TSDataType>> typesList, List<List<Object>> valuesList)

Inserts multiple records of the same device.

SessionDataSet executeRawDataQuery(List<String> paths, long startTime, long endTime)

Queries raw data. The interval includes the start time but does not include the end time.

SessionDataSet executeQueryStatement(String sql)

Executes query statements.

void executeNonQueryStatement(String sql)

Executes non-query statements.

Table 2 Test APIs

Method

Description

  • void testInsertRecords(List<String> deviceIds, List<Long> times, List<List<String>> measurementsList, List<List<String>> valuesList)
  • void testInsertRecords(List<String> deviceIds, List<Long> times, List<List<String>> measurementsList, List<List<TSDataType>> typesList, List<List<Object>> valuesList)

Tests testInsertRecords. A response is returned immediately after data is transmitted to the server. No data is written.

  • void testInsertRecord(String deviceId, long time, List<String> measurements, List<String> values)
  • void testInsertRecord(String deviceId, long time, List<String> measurements, List<TSDataType> types, List<Object> values)

Tests insertRecord. A response is returned immediately after data is transmitted to the server. No data is written.

void testInsertTablet(Tablet tablet)

Tests insertTablet. A response is returned immediately after data is transmitted to the server. No data is written.

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya