public interface SyncClientInterface
Alibaba Cloud Table Store (TableStore) is a massive data storage and real-time query service built on top of Alibaba Cloud's large-scale distributed computing system.
| 限定符和类型 | 方法和说明 |
|---|---|
AbortTransactionResponse |
abortTransaction(AbortTransactionRequest request)
Cancel a transaction
|
AddDefinedColumnResponse |
addDefinedColumn(AddDefinedColumnRequest addDefinedColumnRequest)
Add a predefined column to a table.
|
AsyncClientInterface |
asAsyncClient()
Convert to the asynchronous interface Client.
|
BatchGetRowResponse |
batchGetRow(BatchGetRowRequest batchGetRowRequest)
Read multiple rows of data from multiple tables.
|
BatchWriteRowResponse |
batchWriteRow(BatchWriteRowRequest batchWriteRowRequest)
Perform update or delete operations on multiple rows across multiple tables.
|
BulkExportResponse |
bulkExport(BulkExportRequest bulkExportRequest)
Query multiple rows of data within a range from the table, offline service interface.
|
BulkImportResponse |
bulkImport(BulkImportRequest bulkImportRequest)
Perform update or delete operations on multiple rows in a single table, offline service interface.
|
CommitTransactionResponse |
commitTransaction(CommitTransactionRequest request)
Commit a transaction
|
ComputeSplitsResponse |
computeSplits(ComputeSplitsRequest request)
Get the partition information of the data.
|
ComputeSplitsBySizeResponse |
computeSplitsBySize(ComputeSplitsBySizeRequest computeSplitsBySizeRequest)
Splits the data of a table into chunks based on a certain data size, and returns the split information for use by the data retrieval interface.
|
Iterator<Row> |
createBulkExportIterator(RangeIteratorParameter rangeIteratorParameter) |
CreateDeliveryTaskResponse |
createDeliveryTask(CreateDeliveryTaskRequest request)
Create a data delivery task
|
CreateIndexResponse |
createIndex(CreateIndexRequest createIndexRequest)
Create an index table under a specified table as indicated by the user.
|
RowIterator |
createParallelScanIterator(ParallelScanRequest request)
Get the Iterator for ParallelScan.
|
Iterator<Row> |
createRangeIterator(RangeIteratorParameter rangeIteratorParameter)
Encapsulates the
getRange(GetRangeRequest) interface in iterator form. |
CreateSearchIndexResponse |
createSearchIndex(CreateSearchIndexRequest request)
Create SearchIndex
|
RowIterator |
createSearchIterator(SearchRequest request)
Get the Iterator for Search.
|
CreateTableResponse |
createTable(CreateTableRequest createTableRequest)
Create a new table under the user's instance.
|
WideColumnIterator |
createWideColumnIterator(GetRowRequest getRowRequest) |
DeleteDefinedColumnResponse |
deleteDefinedColumn(DeleteDefinedColumnRequest deleteDefinedColumnRequest)
Delete a predefined column for a table
|
DeleteDeliveryTaskResponse |
deleteDeliveryTask(DeleteDeliveryTaskRequest request)
Delete the delivery task
|
DeleteIndexResponse |
deleteIndex(DeleteIndexRequest deleteIndexRequest)
Delete a specific index table under a specified table.
|
DeleteRowResponse |
deleteRow(DeleteRowRequest deleteRowRequest)
Delete a row of data from the table.
|
DeleteSearchIndexResponse |
deleteSearchIndex(DeleteSearchIndexRequest request)
Delete SearchIndex
Specify the tableName and indexName to delete an index
Note: It is not allowed to delete a table before all indexes under the table are deleted
|
DeleteTableResponse |
deleteTable(DeleteTableRequest deleteTableRequest)
Delete a table under a specified instance for the user.
|
DescribeDeliveryTaskResponse |
describeDeliveryTask(DescribeDeliveryTaskRequest request)
Delivery task description function
|
DescribeSearchIndexResponse |
describeSearchIndex(DescribeSearchIndexRequest request)
Get the information of a SearchIndex.
|
DescribeStreamResponse |
describeStream(DescribeStreamRequest describeStreamRequest)
Get the detailed information of the specified Stream.
|
DescribeTableResponse |
describeTable(DescribeTableRequest describeTableRequest)
Get the detailed information of a table, which includes:
The structure of the table (
TableMeta)
The reserved throughput of the table (ReservedThroughputDetails)
The configuration parameters of the table (TableOptions)
|
GetRangeResponse |
getRange(GetRangeRequest getRangeRequest)
Query multiple rows of data within a range from the table.
|
GetRowResponse |
getRow(GetRowRequest getRowRequest)
Read a single row of data from the table.
|
GetShardIteratorResponse |
getShardIterator(GetShardIteratorRequest getShardIteratorRequest)
Get the ShardIterator, which can be used to read data from a Shard.
|
GetStreamRecordResponse |
getStreamRecord(GetStreamRecordRequest getStreamRecordRequest)
Read data from a Shard using a ShardIterator.
|
ListDeliveryTaskResponse |
listDeliveryTask(ListDeliveryTaskRequest request)
List all delivery tasks under the user table
|
ListSearchIndexResponse |
listSearchIndex(ListSearchIndexRequest request)
Get the SearchIndex list under a table.
|
ListStreamResponse |
listStream(ListStreamRequest listStreamRequest)
Get the entire Stream list under the user's current instance or the Stream of a specific table.
|
ListTableResponse |
listTable()
Returns the list of all tables under the user's current instance.
|
ParallelScanResponse |
parallelScan(ParallelScanRequest request)
Scan data form SearchIndex.
|
PutRowResponse |
putRow(PutRowRequest putRowRequest)
Insert or overwrite a row of data in the table.
|
SearchResponse |
search(SearchRequest request)
Search functionality
Build your own SearchRequest, then obtain 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);
|
void |
shutdown()
Release resources.
|
SQLQueryResponse |
sqlQuery(SQLQueryRequest request)
SQL query request
|
StartLocalTransactionResponse |
startLocalTransaction(StartLocalTransactionRequest request)
Start a local transaction
|
void |
switchCredentialsProvider(CredentialsProvider newCrdsProvider)
Switch CredentialsProvider.
|
UpdateRowResponse |
updateRow(UpdateRowRequest updateRowRequest)
Updates a row of data in the table.
|
UpdateSearchIndexResponse |
updateSearchIndex(UpdateSearchIndexRequest request)
Update SearchIndex (for user index exchange, or setting index query weight)
|
UpdateTableResponse |
updateTable(UpdateTableRequest updateTableRequest)
Dynamically change the configuration or reserved throughput of a table after it has been created.
|
CreateTableResponse createTable(CreateTableRequest createTableRequest) throws TableStoreException, ClientException
The table cannot be read from or written to immediately after creation; you need to wait a few seconds.
createTableRequest - Parameters required for executing CreateTableTableStoreException - Exception returned by the TableStore serviceClientException - Invalid request return result, or network exception encounteredUpdateTableResponse updateTable(UpdateTableRequest updateTableRequest) throws TableStoreException, ClientException
For example, if a user wants to adjust the table's TTL, MaxVersions, etc., or if the user finds that the current reserved throughput is too low and needs to be increased.
The UpdateTable operation cannot be used to change the table's TableMeta. The adjustable configurations are:
ReservedThroughput):
A table's reserved throughput can be dynamically changed; read or write throughput can be adjusted separately. The minimum time interval for adjusting each table's read/write throughput is 1 minute. If this UpdateTable operation occurs less than 1 minute after the last 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.
updateTableRequest - Parameters required to execute UpdateTableTableStoreException - Exception returned by the TableStore serviceClientException - Invalid response from the request, or network exception encounteredDescribeTableResponse describeTable(DescribeTableRequest describeTableRequest) throws TableStoreException, ClientException
Get the detailed information of a table, which includes:
TableMeta)ReservedThroughputDetails)TableOptions)describeTableRequest - Parameters required to execute DescribeTableTableStoreException - Exception returned by the TableStore serviceClientException - Invalid response from the request or network exception encounteredListTableResponse listTable() throws TableStoreException, ClientException
TableStoreException - Exception returned by the TableStore serviceClientException - Invalid request response or network exception encounteredDeleteTableResponse deleteTable(DeleteTableRequest deleteTableRequest) throws TableStoreException, ClientException
Caution: After the table is successfully deleted, all data under the table will be cleared and cannot be recovered. Please operate with caution!
deleteTableRequest - Parameters required to execute DeleteTableTableStoreException - Exception returned by the TableStore serviceClientException - Invalid return result of the request or network exception encounteredCreateIndexResponse createIndex(CreateIndexRequest createIndexRequest) throws TableStoreException, ClientException
createIndexRequest - TableStoreException - Exception returned by the TableStore serviceClientException - The returned result is invalid, or a network exception was encounteredDeleteIndexResponse deleteIndex(DeleteIndexRequest deleteIndexRequest) throws TableStoreException, ClientException
Caution: After the index table is successfully deleted, all data under that index table will be cleared and cannot be recovered. Please operate with caution!
deleteIndexRequest - Parameters required to execute DeleteIndexTableStoreException - Exception returned by the TableStore serviceClientException - Invalid return result of the request or network exception encounteredAddDefinedColumnResponse addDefinedColumn(AddDefinedColumnRequest addDefinedColumnRequest) throws TableStoreException, ClientException
addDefinedColumnRequest - Parameters required for executing AddDefinedColumn.TableStoreException - An exception returned by the TableStore service.ClientException - The returned result of the request is invalid, or a network exception occurred.DeleteDefinedColumnResponse deleteDefinedColumn(DeleteDefinedColumnRequest deleteDefinedColumnRequest) throws TableStoreException, ClientException
deleteDefinedColumnRequest - Parameters required to execute DeleteDefinedColumnTableStoreException - Exception returned by the TableStore serviceClientException - Invalid request return or network exception encounteredGetRowResponse getRow(GetRowRequest getRowRequest) throws TableStoreException, ClientException
getRowRequest - Parameters required to perform the GetRow operation.TableStoreException - Exception returned by the TableStore service.ClientException - Invalid request response or network exception encountered.PutRowResponse putRow(PutRowRequest putRowRequest) throws TableStoreException, ClientException
If the row to be written already exists, the old row will be deleted and a new one will be written.
If the row to be written does not exist, a new row will be directly written.
putRowRequest - Parameters required for performing the PutRow operation.TableStoreException - Exception returned by the TableStore service.ClientException - Invalid response from the request or network exception encountered.UpdateRowResponse updateRow(UpdateRowRequest updateRowRequest) throws TableStoreException, ClientException
If the row to be updated does not exist, a new row of data is written.
The update operation can include writing a new attribute column or deleting one or more versions of an attribute column.
updateRowRequest - Parameters required for the UpdateRow operation.TableStoreException - Exception returned by the TableStore service.ClientException - The returned result of the request is invalid, or a network exception was encountered.DeleteRowResponse deleteRow(DeleteRowRequest deleteRowRequest) throws TableStoreException, ClientException
If the row exists, it will be deleted.
If the row does not exist, this operation will have no effect.
deleteRowRequest - Parameters required for performing the DeleteRow operation.TableStoreException - Exception returned by the TableStore service.ClientException - Invalid response or network exception encountered during the request.BatchGetRowResponse batchGetRow(BatchGetRowRequest batchGetRowRequest) throws TableStoreException, ClientException
The BatchGetRow operation can be regarded as a collection of multiple GetRow operations. Each operation is executed independently, returns results independently, and calculates service capability units independently.
Compared to executing a large number of GetRow operations, using the BatchGetRow operation can effectively reduce the response time of requests and increase the data read rate.
However, note that BatchGetRow only supports setting query conditions at the table level. After the operation is completed, the status of each sub-request needs to be checked individually, and retries can be attempted for failed rows.
batchGetRowRequest - Parameters required to execute the BatchGetRow operation.TableStoreException - Exception returned by the TableStore service.ClientException - Invalid request return result or network exception encountered.BatchWriteRowResponse batchWriteRow(BatchWriteRowRequest batchWriteRowRequest) throws TableStoreException, ClientException
The 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 service capability units independently.
After executing the BatchWriteRow operation, it is necessary to check the status of each sub-request individually to determine the write result and choose to retry for failed rows.
batchWriteRowRequest - Parameters required to execute the BatchWriteRow operation.TableStoreException - Exception returned by the TableStore service.ClientException - Invalid response or network exception encountered during the request.BulkImportResponse bulkImport(BulkImportRequest bulkImportRequest) throws TableStoreException, ClientException
The BulkImport operation can be regarded as a collection of multiple PutRow, UpdateRow, DeleteRow operations. Each operation is executed independently, returns results independently, and consumes units independently.
After executing the BulkImport operation, it is necessary to check the status of each sub-request individually to determine the write result and choose to retry the failed rows.
bulkImportRequest - Parameters required to execute the BatchWriteRow operation.TableStoreException - Exception returned by the TableStore serviceClientException - Invalid request return result, or network exception encounteredGetRangeResponse getRange(GetRangeRequest getRangeRequest) throws TableStoreException, ClientException
getRangeRequest - Parameters required for performing the GetRange operation.TableStoreException - Exception returned by the TableStore serviceClientException - Invalid request return or network exception encounteredBulkExportResponse bulkExport(BulkExportRequest bulkExportRequest) throws TableStoreException, ClientException
bulkExportRequest - Parameters required to execute the GetRange operation.TableStoreException - Exception returned by the TableStore service.ClientException - Invalid request return or network exception encountered.ComputeSplitsBySizeResponse computeSplitsBySize(ComputeSplitsBySizeRequest computeSplitsBySizeRequest) throws TableStoreException, ClientException
computeSplitsBySizeRequest - Parameters required to execute the ComputeSplitsBySize operation.TableStoreException - Exception returned by the TableStore serviceClientException - Invalid request response or network exception encounteredIterator<Row> createRangeIterator(RangeIteratorParameter rangeIteratorParameter) throws TableStoreException, ClientException
getRange(GetRangeRequest) interface in iterator form.rangeIteratorParameter - The parameters required to execute the createRangeIterator operation.TableStoreException - Exception returned by the TableStore serviceClientException - Invalid request response or network exception encounteredIterator<Row> createBulkExportIterator(RangeIteratorParameter rangeIteratorParameter) throws TableStoreException, ClientException
WideColumnIterator createWideColumnIterator(GetRowRequest getRowRequest) throws TableStoreException, ClientException
ListStreamResponse listStream(ListStreamRequest listStreamRequest) throws TableStoreException, ClientException
listStreamRequest - Parameters required for performing the ListStream operation.TableStoreException - Exception returned by the TableStore service.ClientException - Invalid request response or network exception encountered.DescribeStreamResponse describeStream(DescribeStreamRequest describeStreamRequest) throws TableStoreException, ClientException
describeStreamRequest - Parameters required for the DescribeStream operation.TableStoreException - Exception returned by the TableStore service.ClientException - Invalid request return or network exception encountered.GetShardIteratorResponse getShardIterator(GetShardIteratorRequest getShardIteratorRequest) throws TableStoreException, ClientException
getShardIteratorRequest - Parameters required to execute the GetShardIterator operation.TableStoreException - Exception returned by the TableStore service.ClientException - Invalid request response or network exception encountered.GetStreamRecordResponse getStreamRecord(GetStreamRecordRequest getStreamRecordRequest) throws TableStoreException, ClientException
getStreamRecordRequest - Parameters required to perform the GetStreamRecord operation.TableStoreException - Exception returned by the TableStore service.ClientException - Invalid request response or network exception encountered.CreateSearchIndexResponse createSearchIndex(CreateSearchIndexRequest request) throws TableStoreException, ClientException
request - Parameters required for creating a SearchIndex, see CreateSearchIndexRequestTableStoreException - Exception returned by the TableStore serviceClientException - Invalid response from the request or network exception encounteredUpdateSearchIndexResponse updateSearchIndex(UpdateSearchIndexRequest request) throws TableStoreException, ClientException
request - Parameters required for updating the SearchIndex, see UpdateSearchIndexRequestTableStoreException - Exception returned by the TableStore serviceClientException - Invalid request response or network exception encounteredListSearchIndexResponse listSearchIndex(ListSearchIndexRequest request) throws TableStoreException, ClientException
There can be multiple SearchIndex tables under a single table. Through this function, you can retrieve all SearchIndex information under a table.
request - Parameters required to get the SearchIndex list.TableStoreException - Exception returned by the TableStore service.ClientException - Invalid response result or network exception encountered during the request.DeleteSearchIndexResponse deleteSearchIndex(DeleteSearchIndexRequest request) throws TableStoreException, ClientException
Specify the tableName and indexName to delete an index
Note: It is not allowed to delete a table before all indexes under the table are deleted
request - Parameters required for deleting SearchIndexTableStoreException - Exception returned by the TableStore serviceClientException - Invalid request return or network exception encounteredDescribeSearchIndexResponse describeSearchIndex(DescribeSearchIndexRequest request) throws TableStoreException, ClientException
request - The parameters required to get the SearchIndex (tableName and indexName).TableStoreException - Exception returned by the TableStore service.ClientException - Invalid response from the request or a network exception encountered.ComputeSplitsResponse computeSplits(ComputeSplitsRequest request) throws TableStoreException, ClientException
request - Parameters required to perform the computeSplits operation.TableStoreException - Exception returned by Tablestore service.ClientException - The return result of the request is invalid or a network exception was encountered.ParallelScanResponse parallelScan(ParallelScanRequest request) throws TableStoreException, ClientException
request - Parameters required to perform the parallelScan operation.TableStoreException - Exception returned by Tablestore service.ClientException - The return result of the request is invalid or a network exception was encountered.RowIterator createParallelScanIterator(ParallelScanRequest request) throws TableStoreException, ClientException
request - Parameters required to perform ParallelScan operation.TableStoreException - Exception returned by Tablestore service.ClientException - The return result of the request is invalid or a network exception was encountered.RowIterator createSearchIterator(SearchRequest request) throws TableStoreException, ClientException
Note: If your searchIndex has a nested field and you want to search data, please specify the Sort.
request - Parameters required to perform searchRequest operation.TableStoreException - Exception returned by Tablestore service.ClientException - The return result of the request is invalid or a network exception was encountered.SearchResponse search(SearchRequest request) throws TableStoreException, ClientException
Build your own SearchRequest, then obtain 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);
request - Parameters required for performing a search, see SearchRequest for detailsSearchResponse for detailsTableStoreException - Exception returned by the TableStore serviceClientException - Invalid response from the request or network exception encounteredStartLocalTransactionResponse startLocalTransaction(StartLocalTransactionRequest request) throws TableStoreException, ClientException
request - Parameters required for initiating a local transaction operationTableStoreException - Exception returned by the TableStore serviceClientException - The response is invalid or a network exception occursCommitTransactionResponse commitTransaction(CommitTransactionRequest request) throws TableStoreException, ClientException
request - Parameters required for the commit transaction operationTableStoreException - Exception returned by the TableStore serviceClientException - Invalid request response or network exception encounteredAbortTransactionResponse abortTransaction(AbortTransactionRequest request) throws TableStoreException, ClientException
request - Parameters required for the cancel transaction operationTableStoreException - Exception returned by the TableStore serviceClientException - Invalid request response or network exception encounteredAsyncClientInterface asAsyncClient()
void shutdown()
Make 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.
void switchCredentialsProvider(CredentialsProvider newCrdsProvider)
newCrdsProvider - new CredentialsProvider, see CredentialsProviderFactory.CreateDeliveryTaskResponse createDeliveryTask(CreateDeliveryTaskRequest request) throws TableStoreException, ClientException
request - Parameters required to create the delivery taskTableStoreException - Exception returned by the TableStore serviceClientException - Invalid response from the request or network exception encounteredDeleteDeliveryTaskResponse deleteDeliveryTask(DeleteDeliveryTaskRequest request) throws TableStoreException, ClientException
request - Parameters required for deleting the delivery taskTableStoreException - Exception returned by the Tablestore serviceClientException - The request results are invalid, or a network exception is encounteredDescribeDeliveryTaskResponse describeDeliveryTask(DescribeDeliveryTaskRequest request) throws TableStoreException, ClientException
request - Parameters required to describe the delivery taskTableStoreException - Exception returned by the Tablestore serviceClientException - The request result is invalid or a network exception is encounteredListDeliveryTaskResponse listDeliveryTask(ListDeliveryTaskRequest request) throws TableStoreException, ClientException
request - Parameters required to get the list of delivery tasksTableStoreException - Exception returned by the Tablestore serviceClientException - The result of the request is invalid, or a network exception was encounteredSQLQueryResponse sqlQuery(SQLQueryRequest request) throws TableStoreException, ClientException
request - Parameters for SQL queryTableStoreException - Exception returned by the Tablestore serviceClientException - Request result is invalid or a network exception is encounteredCopyright © 2025. All Rights Reserved.