You can call the DescribeTimeseriesTable operation to query the information about a time series table, such as the time to live (TTL) configuration.
Prerequisites
A time series table is created. For more information, see Create a time series table.
A TimeseriesClient instance is initialized. For more information, see Initialize an OTSClient instance.
Parameter
Parameter | Description |
timeseriesTableName | The name of the time series table. |
Example
The following sample code provides an example on how to query the information about a time series table.
private static void describeTimeseriesTable(TimeseriesClient client) {
// Specify the name of the time series table.
String tableName = "<TIMESERIES_TABLE>";
DescribeTimeseriesTableResponse describeTimeseriesTableResponse = client.describeTimeseriesTable(new DescribeTimeseriesTableRequest(tableName));
TimeseriesTableMeta tableMeta = describeTimeseriesTableResponse.getTimeseriesTableMeta();
// View the name of the time series table.
System.out.println(tableMeta.getTimeseriesTableName());
// View the status of the time series table.
System.out.println(tableMeta.getStatus());
// View the TTL of data in the time series table.
System.out.println(tableMeta.getTimeseriesTableOptions().getTimeToLive());
// View the TTL of the time series metadata.
System.out.println(tableMeta.getTimeseriesMetaOptions().getMetaTimeToLive());
// Check whether the property columns of the time series metadata can be modified.
System.out.println(tableMeta.getTimeseriesMetaOptions().getAllowUpdateAttributes());
}