public class AsyncClient extends Object implements AsyncClientInterface
| 构造器和说明 |
|---|
AsyncClient(String endpoint,
CredentialsProvider credsProvider,
String instanceName,
ClientConfiguration config,
ResourceManager resourceManager) |
AsyncClient(String endpoint,
String accessKeyId,
String accessKeySecret,
String instanceName)
Constructs a new
AsyncClient instance using the specified TableStore Endpoint and default configuration. |
AsyncClient(String endpoint,
String accessKeyId,
String accessKeySecret,
String instanceName,
ClientConfiguration config)
Constructs a new
AsyncClient instance using the specified TableStore Endpoint and default configuration. |
AsyncClient(String endpoint,
String accessKeyId,
String accessKeySecret,
String instanceName,
ClientConfiguration config,
ExecutorService callbackExecutor)
Constructs a new
AsyncClient instance using the specified TableStore Endpoint and default configuration. |
AsyncClient(String endpoint,
String accessKeyId,
String accessKeySecret,
String instanceName,
ClientConfiguration config,
ExecutorService callbackExecutor,
String stsToken)
Constructs a new
AsyncClient instance using the specified TableStore Endpoint and default configuration. |
AsyncClient(String endpoint,
String accessKeyId,
String accessKeySecret,
String instanceName,
ClientConfiguration config,
String stsToken)
Constructs a new
AsyncClient instance using the specified TableStore Endpoint and default configuration. |
AsyncClient(String endpoint,
String accessKeyId,
String accessKeySecret,
String instanceName,
String stsToken)
Constructs a new
AsyncClient instance with the specified TableStore Endpoint and default configuration. |
public AsyncClient(String endpoint, String accessKeyId, String accessKeySecret, String instanceName)
AsyncClient instance using the specified TableStore Endpoint and default configuration.endpoint - The endpoint of the TableStore service.accessKeyId - The Access ID for accessing the TableStore service.accessKeySecret - The Access Key for accessing the TableStore service.instanceName - The name of the instance for accessing the TableStore service.public AsyncClient(String endpoint, String accessKeyId, String accessKeySecret, String instanceName, String stsToken)
AsyncClient instance with the specified TableStore Endpoint and default configuration.endpoint - The endpoint of the TableStore service.accessKeyId - The Access ID for accessing the TableStore service.accessKeySecret - The Access Key for accessing the TableStore service.instanceName - The instance name for accessing the TableStore service.stsToken - Sts Token.public AsyncClient(String endpoint, String accessKeyId, String accessKeySecret, String instanceName, ClientConfiguration config)
AsyncClient instance using the specified TableStore Endpoint and default configuration.endpoint - The endpoint of the TableStore service.accessKeyId - The Access ID for accessing the TableStore service.accessKeySecret - The Access Key for accessing the TableStore service.instanceName - The instance name for accessing the TableStore service.config - The client configuration information (ClientConfiguration). If null is passed, the default configuration will be used.public AsyncClient(String endpoint, String accessKeyId, String accessKeySecret, String instanceName, ClientConfiguration config, String stsToken)
AsyncClient instance using the specified TableStore Endpoint and default configuration.endpoint - The endpoint of the TableStore service.accessKeyId - The Access ID for accessing the TableStore service.accessKeySecret - The Access Key for accessing the TableStore service.instanceName - The instance name for accessing the TableStore service.config - The client configuration information (ClientConfiguration). If null is passed, the default configuration will be used.stsToken - Sts Token.public AsyncClient(String endpoint, String accessKeyId, String accessKeySecret, String instanceName, ClientConfiguration config, ExecutorService callbackExecutor)
AsyncClient instance using the specified TableStore Endpoint and default configuration.endpoint - The endpoint of the TableStore service.accessKeyId - The Access ID for accessing the TableStore service.accessKeySecret - The Access Key for accessing the TableStore service.instanceName - The instance name for accessing the TableStore service.config - The client configuration information (ClientConfiguration). If null is passed, the default configuration will be used.callbackExecutor - Used to execute the Callback provided by the user when calling the asynchronous interface. If null is passed, the default configuration will be used
(a thread pool with the number of threads equal to the number of CPU cores).public AsyncClient(String endpoint, String accessKeyId, String accessKeySecret, String instanceName, ClientConfiguration config, ExecutorService callbackExecutor, String stsToken)
AsyncClient instance using the specified TableStore Endpoint and default configuration.endpoint - The endpoint of the TableStore service.accessKeyId - Access ID for accessing the TableStore service.accessKeySecret - Access Key for accessing the TableStore service.instanceName - Instance name for accessing the TableStore service.config - Client configuration information (ClientConfiguration). If null is passed, the default configuration will be used.callbackExecutor - Used to execute the Callback provided by users when calling asynchronous interfaces. If null is passed, the default configuration will be used
(a thread pool with the number of threads equal to the number of CPU cores).stsToken - Sts Token.public AsyncClient(String endpoint, CredentialsProvider credsProvider, String instanceName, ClientConfiguration config, ResourceManager resourceManager)
public String getEndpoint()
public String getInstanceName()
public Future<ListTableResponse> listTable(TableStoreCallback<ListTableRequest,ListTableResponse> callback)
AsyncClientInterfacelistTable 在接口中 AsyncClientInterfacecallback - The callback function to be called after the request is completed, can be null, which means no callback function is neededpublic Future<CreateTableResponse> createTable(CreateTableRequest request, TableStoreCallback<CreateTableRequest,CreateTableResponse> callback)
AsyncClientInterfaceAfter the table is created, it cannot be read from or written to immediately; you need to wait for a few seconds.
createTable 在接口中 AsyncClientInterfacerequest - Parameters required to execute the CreateTable operationcallback - The callback function to invoke after the request is completed; can be null, which means no callback function needs to be executedpublic Future<DescribeTableResponse> describeTable(DescribeTableRequest request, TableStoreCallback<DescribeTableRequest,DescribeTableResponse> callback)
AsyncClientInterfaceGet the detailed information of a table, which includes:
TableMeta)ReservedThroughputDetails)TableOptions)describeTable 在接口中 AsyncClientInterfacerequest - Parameters required to execute DescribeTablecallback - The callback function to be invoked upon request completion, can be null if no callback is neededpublic Future<DeleteTableResponse> deleteTable(DeleteTableRequest request, TableStoreCallback<DeleteTableRequest,DeleteTableResponse> callback)
AsyncClientInterfaceCaution: After the table is successfully deleted, all data under the table will be cleared and cannot be recovered. Please operate with caution!
deleteTable 在接口中 AsyncClientInterfacerequest - Parameters required to execute DeleteTablecallback - The callback function to be invoked after the request is completed. It can be null, which means no callback function is needed.public Future<UpdateTableResponse> updateTable(UpdateTableRequest request, TableStoreCallback<UpdateTableRequest,UpdateTableResponse> callback)
AsyncClientInterfaceFor example, a user may want to adjust the table's TTL, MaxVersions configurations, or if the user finds that the current reserved throughput is too low and needs to increase the reserved throughput.
The UpdateTable operation cannot be used to modify the table's TableMeta. The adjustable configurations are:
ReservedThroughput):
The reserved throughput of the table can be dynamically changed, and both read and write throughputs can be modified separately. The minimum time interval for adjusting the read/write throughput of each table is 1 minute.
If the current UpdateTable operation occurs less than 1 minute after the previous UpdateTable or CreateTable operation, the request will be rejected.
TableOptions):
Only some configuration items of the table can be dynamically changed, such as TTL, MaxVersions, etc.
updateTable 在接口中 AsyncClientInterfacerequest - Parameters required to execute UpdateTablecallback - The callback function to be invoked upon completion of the request, which can be null if no callback function is neededpublic Future<CreateIndexResponse> createIndex(CreateIndexRequest request, TableStoreCallback<CreateIndexRequest,CreateIndexResponse> callback)
AsyncClientInterfacecreateIndex 在接口中 AsyncClientInterfacerequest - Parameters required to execute CreateIndexcallback - The callback function to be invoked upon completion of the request, can be null which means no callback function is neededpublic Future<DeleteIndexResponse> deleteIndex(DeleteIndexRequest request, TableStoreCallback<DeleteIndexRequest,DeleteIndexResponse> callback)
AsyncClientInterfacedeleteIndex 在接口中 AsyncClientInterfacerequest - Parameters required to execute the deleteIndex operation.callback - The callback function to be invoked upon completion of the request, can be null if no callback is needed.public Future<AddDefinedColumnResponse> addDefinedColumn(AddDefinedColumnRequest request, TableStoreCallback<AddDefinedColumnRequest,AddDefinedColumnResponse> callback)
AsyncClientInterfaceaddDefinedColumn 在接口中 AsyncClientInterfacerequest - Parameters required for executing addDefinedColumncallback - The callback function to be called upon request completion, can be null which means no callback function is neededpublic Future<DeleteDefinedColumnResponse> deleteDefinedColumn(DeleteDefinedColumnRequest request, TableStoreCallback<DeleteDefinedColumnRequest,DeleteDefinedColumnResponse> callback)
AsyncClientInterfacedeleteDefinedColumn 在接口中 AsyncClientInterfacerequest - Parameters required to execute deleteDefinedColumn.callback - The callback function to be called upon request completion; can be null, which means no callback function is needed.public Future<GetRowResponse> getRow(GetRowRequest request, TableStoreCallback<GetRowRequest,GetRowResponse> callback)
AsyncClientInterfacegetRow 在接口中 AsyncClientInterfacerequest - The parameters required to perform the GetRow operation.callback - The callback function to be invoked upon request completion, can be null which means no callback function is needed.public Future<PutRowResponse> putRow(PutRowRequest request, TableStoreCallback<PutRowRequest,PutRowResponse> callback)
AsyncClientInterfaceIf the row to be written already exists, the old row will be deleted and the new row will be written.
If the row to be written does not exist, the new row will be written directly.
putRow 在接口中 AsyncClientInterfacerequest - Parameters required for the PutRow operation.callback - The callback function to be invoked after the request is completed. It can be null, indicating that no callback function needs to be executed.public Future<UpdateRowResponse> updateRow(UpdateRowRequest request, TableStoreCallback<UpdateRowRequest,UpdateRowResponse> callback)
AsyncClientInterfaceIf the row to be updated does not exist, a new row of data will be written.
The update operation can include writing a new attribute column or deleting one or more versions of an attribute column.
updateRow 在接口中 AsyncClientInterfacerequest - Parameters required for performing the UpdateRow operation.callback - The callback function to be invoked upon request completion, can be null which means no callback is needed.public Future<DeleteRowResponse> deleteRow(DeleteRowRequest request, TableStoreCallback<DeleteRowRequest,DeleteRowResponse> callback)
AsyncClientInterfaceIf the row exists, it will be deleted.
If the row does not exist, this operation will have no effect.
deleteRow 在接口中 AsyncClientInterfacerequest - Parameters required for performing the DeleteRow operation.callback - The callback function to invoke upon request completion, can be null which means no callback is needed.public Future<BatchGetRowResponse> batchGetRow(BatchGetRowRequest request, TableStoreCallback<BatchGetRowRequest,BatchGetRowResponse> callback)
AsyncClientInterfaceThe BatchGetRow operation can be considered as a collection of multiple GetRow operations. Each operation is executed independently, returns results independently, and calculates the service capability unit independently.
Compared to executing a large number of GetRow operations, using the BatchGetRow operation can effectively reduce the response time of requests and improve the data read rate.
However, it should be noted that BatchGetRow only supports setting query conditions at the table level. After the operation is completed, you need to check the status of each sub-request individually and choose to retry for failed rows.
batchGetRow 在接口中 AsyncClientInterfacerequest - Parameters required to perform the BatchGetRow operation.callback - The callback function to invoke after the request is completed, can be null, which means no callback function needs to be executedpublic Future<BatchWriteRowResponse> batchWriteRow(BatchWriteRowRequest request, TableStoreCallback<BatchWriteRowRequest,BatchWriteRowResponse> callback)
AsyncClientInterfaceThe BatchWriteRow operation can be considered as a collection of multiple PutRow, UpdateRow, and DeleteRow operations. Each operation is executed independently, returns results independently, and calculates the capacity unit independently.
After executing the BatchWriteRow operation, you need to check the status of each sub-request one by one to determine the write result and choose to retry for failed rows.
batchWriteRow 在接口中 AsyncClientInterfacerequest - Parameters required for executing the BatchWriteRow operation.callback - The callback function to be invoked upon request completion, can be null if no callback function is needed.public Future<GetRangeResponse> getRange(GetRangeRequest request, TableStoreCallback<GetRangeRequest,GetRangeResponse> callback)
AsyncClientInterfacegetRange 在接口中 AsyncClientInterfacerequest - The parameters required to perform the GetRange operation.callback - The callback function to be invoked upon request completion, can be null if no callback function is needed.public Future<BulkExportResponse> bulkExport(BulkExportRequest request, TableStoreCallback<BulkExportRequest,BulkExportResponse> callback)
AsyncClientInterfacebulkExport 在接口中 AsyncClientInterfacerequest - Parameters required for performing the GetRange operation.callback - The callback function to be called upon request completion, can be null which means no callback function is needed.public Future<BulkImportResponse> bulkImport(BulkImportRequest request, TableStoreCallback<BulkImportRequest,BulkImportResponse> callback)
AsyncClientInterfaceThe BulkImport operation can be regarded as a collection of multiple PutRow, UpdateRow, and DeleteRow operations. Each operation is executed independently, returns results independently, and calculates consumed capacity units independently.
After executing the BulkImport operation, you need to check the status of each sub-request individually to determine the write result and choose whether to retry for failed rows.
bulkImport 在接口中 AsyncClientInterfacerequest - Parameters required to execute the BatchWriteRow operation.callback - The callback function to invoke upon request completion, which can be null if no callback function needs to be executed.public Future<ComputeSplitsBySizeResponse> computeSplitsBySize(ComputeSplitsBySizeRequest request, TableStoreCallback<ComputeSplitsBySizeRequest,ComputeSplitsBySizeResponse> callback)
AsyncClientInterfacecomputeSplitsBySize 在接口中 AsyncClientInterfacerequest - Parameters required to execute the ComputeSplitsBySize operation.callback - The callback function to be called upon completion of the request, can be null which means no callback function needs to be executed.public Future<ListStreamResponse> listStream(ListStreamRequest request, TableStoreCallback<ListStreamRequest,ListStreamResponse> callback)
AsyncClientInterfacelistStream 在接口中 AsyncClientInterfacerequest - Parameters required for executing the ListStream operation.callback - The callback function to be called upon completion of the request, can be null which means no callback function is neededpublic Future<DescribeStreamResponse> describeStream(DescribeStreamRequest request, TableStoreCallback<DescribeStreamRequest,DescribeStreamResponse> callback)
AsyncClientInterfacedescribeStream 在接口中 AsyncClientInterfacerequest - The parameters required for the DescribeStream operation.callback - The callback function to be called upon completion of the request, can be null, which means no callback function is needed.public Future<GetShardIteratorResponse> getShardIterator(GetShardIteratorRequest request, TableStoreCallback<GetShardIteratorRequest,GetShardIteratorResponse> callback)
AsyncClientInterfacegetShardIterator 在接口中 AsyncClientInterfacerequest - Parameters required for the GetShardIterator operation.callback - The callback function to be invoked upon completion of the request, can be null if no callback is needed.public Future<GetStreamRecordResponse> getStreamRecord(GetStreamRecordRequest request, TableStoreCallback<GetStreamRecordRequest,GetStreamRecordResponse> callback)
AsyncClientInterfacegetStreamRecord 在接口中 AsyncClientInterfacerequest - The parameters required to execute the GetStreamRecord operation.callback - The callback function to be invoked upon completion of the request, can be null if no callback is needed.public Future<CreateSearchIndexResponse> createSearchIndex(CreateSearchIndexRequest request, TableStoreCallback<CreateSearchIndexRequest,CreateSearchIndexResponse> callback)
AsyncClientInterfacecreateSearchIndex 在接口中 AsyncClientInterfacerequest - Parameters required for creating a SearchIndex, see CreateSearchIndexRequestcallback - The callback function to be called upon completion of the request, can be null which means no callback function is neededpublic Future<UpdateSearchIndexResponse> updateSearchIndex(UpdateSearchIndexRequest request, TableStoreCallback<UpdateSearchIndexRequest,UpdateSearchIndexResponse> callback)
AsyncClientInterfaceupdateSearchIndex 在接口中 AsyncClientInterfacerequest - Parameters required to update the SearchIndexcallback - The callback function to be called upon completion of the request, can be null which means no callback function needs to be executedpublic Future<ListSearchIndexResponse> listSearchIndex(ListSearchIndexRequest request, TableStoreCallback<ListSearchIndexRequest,ListSearchIndexResponse> callback)
AsyncClientInterfaceThere can be multiple SearchIndex tables under a single table. Through this function, you can retrieve all SearchIndex information for a specific table.
listSearchIndex 在接口中 AsyncClientInterfacerequest - Parameters required to get the SearchIndex list.callback - The callback function to call upon completion of the request, can be null if no callback is needed.public Future<DeleteSearchIndexResponse> deleteSearchIndex(DeleteSearchIndexRequest request, TableStoreCallback<DeleteSearchIndexRequest,DeleteSearchIndexResponse> callback)
AsyncClientInterfaceSpecify the tableName and indexName to delete an index.
Note: It is not allowed to delete a table until all indexes under the table have been deleted.
deleteSearchIndex 在接口中 AsyncClientInterfacerequest - Parameters required for deleting SearchIndexcallback - The callback function to be called upon completion of the request, can be null which means no callback function needs to be executedpublic Future<DescribeSearchIndexResponse> describeSearchIndex(DescribeSearchIndexRequest request, TableStoreCallback<DescribeSearchIndexRequest,DescribeSearchIndexResponse> callback)
AsyncClientInterfacedescribeSearchIndex 在接口中 AsyncClientInterfacerequest - Parameters required to get the SearchIndex (tableName and indexName).callback - The callback function to be called upon completion of the request, can be null which means no callback function is needed.public Future<ComputeSplitsResponse> computeSplits(ComputeSplitsRequest request, TableStoreCallback<ComputeSplitsRequest,ComputeSplitsResponse> callback)
AsyncClientInterfacecomputeSplits 在接口中 AsyncClientInterfacerequest - Parameters required to perform the computeSplits operation.callback - The callback function invoked after the request is completed. It can be null, which means that no callback function is required.public Future<ParallelScanResponse> parallelScan(ParallelScanRequest request, TableStoreCallback<ParallelScanRequest,ParallelScanResponse> callback)
AsyncClientInterfaceparallelScan 在接口中 AsyncClientInterfacerequest - Parameters required to perform the parallelScan operation.callback - The callback function invoked after the request is completed. It can be null, which means that no callback function is required.public Future<SearchResponse> search(SearchRequest request, TableStoreCallback<SearchRequest,SearchResponse> callback)
AsyncClientInterfaceBuild your own SearchRequest, then get the SearchResponse
Example:
SearchQuery searchQuery = new SearchQuery();
TermQuery termQuery = new TermQuery();
termQuery.setFieldName("user_name");
termQuery.setTerm("jay");
searchQuery.setQuery(termQuery);
SearchRequest searchRequest = new SearchRequest(tableName, indexName, searchQuery);
SearchResponse resp = ots.search(searchRequest);
search 在接口中 AsyncClientInterfacerequest - Parameters required for performing the search, see SearchRequest for more detailscallback - The callback function to be called upon completion of the request, can be null which means no callback function is neededSearchResponse for more detailspublic Future<StartLocalTransactionResponse> startLocalTransaction(StartLocalTransactionRequest request, TableStoreCallback<StartLocalTransactionRequest,StartLocalTransactionResponse> callback)
AsyncClientInterfacestartLocalTransaction 在接口中 AsyncClientInterfacerequest - Parameters required for initiating a local transaction operationpublic Future<CommitTransactionResponse> commitTransaction(CommitTransactionRequest request, TableStoreCallback<CommitTransactionRequest,CommitTransactionResponse> callback)
AsyncClientInterfacecommitTransaction 在接口中 AsyncClientInterfacerequest - Parameters required for the commit transaction operationpublic Future<AbortTransactionResponse> abortTransaction(AbortTransactionRequest request, TableStoreCallback<AbortTransactionRequest,AbortTransactionResponse> callback)
AsyncClientInterfaceabortTransaction 在接口中 AsyncClientInterfacerequest - Parameters required for the cancel transaction operationpublic Future<CreateDeliveryTaskResponse> createDeliveryTask(CreateDeliveryTaskRequest request, TableStoreCallback<CreateDeliveryTaskRequest,CreateDeliveryTaskResponse> callback)
AsyncClientInterfacecreateDeliveryTask 在接口中 AsyncClientInterfacerequest - Parameters required to create a delivery taskcallback - The callback function to be called upon completion of the request, can be null which means no callback function is neededpublic Future<DeleteDeliveryTaskResponse> deleteDeliveryTask(DeleteDeliveryTaskRequest request, TableStoreCallback<DeleteDeliveryTaskRequest,DeleteDeliveryTaskResponse> callback)
AsyncClientInterfacedeleteDeliveryTask 在接口中 AsyncClientInterfacerequest - The parameters required to delete the delivery taskpublic Future<DescribeDeliveryTaskResponse> describeDeliveryTask(DescribeDeliveryTaskRequest request, TableStoreCallback<DescribeDeliveryTaskRequest,DescribeDeliveryTaskResponse> callback)
AsyncClientInterfacedescribeDeliveryTask 在接口中 AsyncClientInterfacerequest - Parameters required to describe the delivery taskcallback - The callback function to be called upon completion of the request, can be null which means no callback function is neededpublic Future<ListDeliveryTaskResponse> listDeliveryTask(ListDeliveryTaskRequest request, TableStoreCallback<ListDeliveryTaskRequest,ListDeliveryTaskResponse> callback)
AsyncClientInterfacelistDeliveryTask 在接口中 AsyncClientInterfacerequest - Parameters required to list the delivery task listcallback - The callback function to be called upon completion of the request, can be null which means no callback function is neededpublic SyncClientInterface asSyncClient()
AsyncClientInterfaceasSyncClient 在接口中 AsyncClientInterfacepublic TimeseriesClient asTimeseriesClient()
public AsyncTimeseriesClient asAsyncTimeseriesClient()
public void shutdown()
AsyncClientInterfaceMake 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.
shutdown 在接口中 AsyncClientInterfacepublic void switchCredentialsProvider(CredentialsProvider newCrdsProvider)
AsyncClientInterfaceswitchCredentialsProvider 在接口中 AsyncClientInterfacenewCrdsProvider - new CredentialsProvider, see CredentialsProviderFactory.public Future<SQLQueryResponse> sqlQuery(SQLQueryRequest request, TableStoreCallback<SQLQueryRequest,SQLQueryResponse> callback)
sqlQuery 在接口中 AsyncClientInterfaceCopyright © 2025. All Rights Reserved.