Tablestore SDK for Java provides a variety of operations on time series tables and time series data for the TimeSeries model.
The Tablestore TimeSeries model is designed based on the characteristics of time series data and is suitable for scenarios such as IoT device monitoring, device data collection, and machine data monitoring. For more information about the TimeSeries model, see Overview.
Operations on time series tables
To use the Tablestore TimeSeries model, you must call the CreateTimeseriesTable operation to create a time series table for storing time series data. For more information, see Create a time series table.
After you create a time series table, you can manage the time series table. The following table describes the operations that you can perform on time series tables.
Operation | Description |
You can call the ListTimeseriesTable operation to query the names of all existing time series tables in an instance. | |
You can call the DescribeTimeseriesTable operation to query the information about a time series table, such as the time to live (TTL) of the data in the table. | |
To clear historical data in a time series table or extend the retention period of data, you can call the UpdateTimeseriesTable operation to modify the TTL of the data in the time series table. After you modify the TTL of the data in a time series table, Tablestore automatically and asynchronously clears the data whose retention period exceeds the TTL from the time series table. | |
If you no longer need to use a time series table to store time series data, you can call the DeleteTimeseriesTable operation to delete the time series table. Important You cannot restore a time series table after it is deleted. Exercise caution when you perform this operation. |
Operations on time series data
After you create a time series table, you can call the PutTimeseriesData operation to write multiple rows of time series data to the time series table at a time. For more information, see Write time series data.
After time series data is written to a time series table, you can perform the following operations to query the time series data of a time series in the time series table:
If you have not obtained the information about the time series that you want to query, such as the metric name and data source, you can call the QueryTimeseriesMeta operation to specify multiple conditions to retrieve the required time series. For more information, see Retrieve time series.
If the properties in the time series metadata do not meet your requirements, you can update or delete the time series metadata.
Operation
Description
You can call the UpdateTimeseriesMeta operation to modify multiple properties in time series metadata at a time.
You can call the DeleteTimeseriesMeta operation to delete the metadata of multiple time series at a time.
You can call the GetTimeseriesData operation to query the time series data that meets specific conditions in a specific time series. For more information, see Query time series data.