public class TimestreamDBClient extends Object implements TimestreamDB
TimestreamDBClient, providing functionalities for table creation/deletion and data read/write.
By default, the backend automatically enables the updateTime timeline update feature, which can be disabled via TimestreamDBConfiguration.dumpMeta.
When the automatic updateTime timeline update feature is enabled (via TimestreamDBConfiguration.dumpMeta), the TimestreamDBClient backend maintains an in-memory cache of recently updated timelines. During data writes, it determines whether the timeline's updateTime needs to be updated (if not present in the cache or if the last update exceeds the configured threshold). If an update is required, a record is inserted into the meta table (updating only updateTime).
The asynchronous API for data writes is implemented through TableStoreWriter. To retrieve the results of asynchronous writes, you can pass a TableStoreCallback, which is shared across all data table writes.
| 构造器和说明 |
|---|
TimestreamDBClient(AsyncClient asyncClient,
TimestreamDBConfiguration config)
Constructor of TimestreamDBClient
|
TimestreamDBClient(AsyncClient asyncClient,
TimestreamDBConfiguration config,
WriterConfig writerConfig,
TableStoreCallback<RowChange,ConsumedCapacity> callback)
Constructor of TimestreamDBClient
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Close the client and release resources.
|
void |
createDataTable(String tableName)
Create a data table
|
void |
createMetaTable()
Create the meta table without creating indexes for attributes.
|
void |
createMetaTable(List<AttributeIndexSchema> indexForAttributes)
Create the meta table and create indexes for the specified attributes.
|
TimestreamDataTable |
dataTable(String tableName)
Get the operation object of the data table
|
void |
deleteDataTable(String tableName)
Delete the table
|
void |
deleteMetaTable()
Delete the meta table
|
TimestreamMetaTable |
metaTable()
Get the operation object for the meta table
|
public TimestreamDBClient(AsyncClient asyncClient, TimestreamDBConfiguration config)
asyncClient - TableStore asynchronous clientconfig - Client configurationpublic TimestreamDBClient(AsyncClient asyncClient, TimestreamDBConfiguration config, WriterConfig writerConfig, TableStoreCallback<RowChange,ConsumedCapacity> callback)
asyncClient - TableStore asynchronous clientconfig - client configurationwriterConfig - WriterConfig for the TableStoreWriter used by all data tablescallback - Shared TableStoreCallback for the TableStoreWriter used by all data tablespublic void close()
TimestreamDBMake sure to release resources after all requests have been executed. After releasing resources, no further requests can be sent, and ongoing requests may not return results.
close 在接口中 TimestreamDBpublic void createMetaTable()
TimestreamDBcreateMetaTable 在接口中 TimestreamDBpublic void createMetaTable(List<AttributeIndexSchema> indexForAttributes)
TimestreamDBAttributes must not be reserved fields (h, n, t, s).
createMetaTable 在接口中 TimestreamDBpublic void deleteMetaTable()
TimestreamDBdeleteMetaTable 在接口中 TimestreamDBpublic void createDataTable(String tableName)
TimestreamDBcreateDataTable 在接口中 TimestreamDBtableName - Name of the data tablepublic void deleteDataTable(String tableName)
TimestreamDBdeleteDataTable 在接口中 TimestreamDBtableName - the name of the tablepublic TimestreamDataTable dataTable(String tableName)
TimestreamDBdataTable 在接口中 TimestreamDBtableName - Name of the data tablepublic TimestreamMetaTable metaTable()
TimestreamDBmetaTable 在接口中 TimestreamDBCopyright © 2025. All Rights Reserved.