Suggestion: Before you continue with HiTSDB SDK, we recommend you read Terms and HTTP API Reference first to learn the basics of HiTSDB and the usage of API.

You must create your TSDB client before using the SDK. An TSDB object is an available, thread-safe client object. This article describes using the TSDB class to create an TSDB object or client.

A TSDB class is an operation class of the TSDB client. Objects of the TSDB class are the basis for reading, putting, or operating HiTSDB in other ways.

The following classes are required before creating TSDB class objects:

  • HiTSDBConfig class: fundamental class of the HiTSDB client.
  • HiTSDBClientFactory class: the factory class of HiTSDB class.

An HiTSDB can be generated after a configured HiTSDBConfig class introduces the Connect method of the HiTSDBClientFactory class.

Note: before creating a TSDB object, create an HiTSDBConfig object.

Sample code

// Configure HiTSDBConfig parameters and create HiTSDBConfig instances.
// Example.hitsdb.com is a domain or address. 8242 is a network port of HiTSBD. You can check your actual domain, address, and network port on the console.
HiTSDBConfig config = HiTSDBConfig.address("example.hitsdb.com",8242).config();

// An HiTSDB object is generated by using HiTSDBClientFactory.
HiTSDB tsdb = HiTSDBClientFactory.connect(config);

Suggestion: Before using TSDB SDK, we that you review Terms and [HTTP API Reference] for basic concepts of TSDB and how to use the API.