类 MolaDbClient


  • public class MolaDbClient
    extends AbstractBceClient

    Represents the MolaDb client to access MolaDb.

    • 构造器详细资料

      • MolaDbClient

        public MolaDbClient​(MolaDbClientConfiguration conf)
        Constructs a new Moladb client using the client configuration to access Moladb.
        参数:
        conf - The Moladb client configuration options controlling how this client connects to Moladb (e.g. proxy settings, retry counts, etc).
    • 方法详细资料

      • setDefaultInstanceName

        public void setDefaultInstanceName​(String instanceName)

        Set the default instance name. Operation on tables and items will be carried on this instance

        参数:
        instanceName - Default instance name to be set

      • getDefaultInstanceName

        public String getDefaultInstanceName()

        Get the default instance name.

        返回:
        Default instance name
      • createInstance

        public CreateInstanceResponse createInstance​(CreateInstanceRequest request)

        Creates a new instance under same account.

        参数:
        request - Container for the necessary parameters to execute the Create instance service method on Moladb.
        返回:
        The responseContent from the Create instance service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • getInstance

        public GetInstanceResponse getInstance​(String instanceName)

        Get instance detail from Moladb

        参数:
        instanceName - Name of the instance to be got from Moladb.
        返回:
        The responseContent from the Get instance service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • getInstance

        public GetInstanceResponse getInstance​(GetInstanceRequest request)

        Get instance detail from Moladb

        参数:
        request - Container for the necessary parameters to execute the Get instance service method on Moladb.
        返回:
        The responseContent from the Get instance service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • deleteInstance

        public DeleteInstanceResponse deleteInstance​(DeleteInstanceRequest request)

        Delete instance from Moladb

        NOTE: There MUST be no table within the instance to be deleted.
        参数:
        request - Container for the necessary parameters to execute the Delete instance service method on Moladb.
        返回:
        The responseContent from the Delete instance service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • deleteInstance

        public DeleteInstanceResponse deleteInstance​(String instanceName)

        Delete instance from Moladb

        NOTE: There MUST be no table within the instance to be deleted.
        参数:
        instanceName - the name of instance to be deleted.
        返回:
        The responseContent from the Delete instance service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • listInstances

        public ListInstancesResponse listInstances()

        Get all instance names created by this account

        返回:
        The responseContent from the List instance service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • listInstances

        public ListInstancesResponse listInstances​(ListInstancesRequest request)

        Get the instance name list created by this account

        参数:
        request - Container for the necessary parameters to execute the list instance service method on Moladb.
        返回:
        The responseContent from the List instance service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • createTable

        public CreateTableResponse createTable​(CreateTableRequest request)

        Create a table in moladb

        参数:
        request - Container for the necessary parameters to execute the create table service method on Moladb.
        返回:
        The responseContent from the Create table service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • deleteTable

        public DeleteTableResponse deleteTable​(String tableName)

        Delete the specified table from moladb

        参数:
        tableName - Name of the table to be deleted from Moladb.
        返回:
        The responseContent from the Delete table service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • deleteTable

        public DeleteTableResponse deleteTable​(DeleteTableRequest request)

        Delete a table from moladb

        参数:
        request - Container for the necessary parameters to execute the delete table service method on Moladb.
        返回:
        The responseContent from the Delete table service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • updateTable

        public UpdateTableResponse updateTable​(UpdateTableRequest request)

        Update a table in moladb

        参数:
        request - Container for the necessary parameters to execute the update table service method on Moladb.
        返回:
        The responseContent from the Update table service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • getTable

        public GetTableResponse getTable​(String tableName)

        Get the table details from moladb

        参数:
        tableName - Name of table to be get from Moladb.
        返回:
        The responseContent from the Get table service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • getTable

        public GetTableResponse getTable​(GetTableRequest request)

        Get the table details from moladb

        参数:
        request - Container for the necessary parameters to execute the GetTable service method on Moladb.
        返回:
        The responseContent from the Get table service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • listTables

        public ListTablesResponse listTables()

        List all table names under the specified instance name from moladb

        返回:
        The responseContent from the list tables service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • listTables

        public ListTablesResponse listTables​(ListTablesRequest request)

        List all table names under the specified instance name from moladb

        参数:
        request - Container for the necessary parameters to execute the ListTables service method on Moladb.
        返回:
        The responseContent from the list tables service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • putItem

        public PutItemResponse putItem​(PutItemRequest request)

        Creates a new item, or replaces an old item with a new item. If an item that has the same primary key as the new item already exists in the specified table, the new item completely replaces the existing item. You can perform a conditional put operation (add a new item if one with the specified primary key doesn't exist), or replace an existing item if it has certain attribute values.

        When you add an item, the primary key attribute(s) are the only required attributes. Attribute values cannot be null. String and Binary type attributes must have lengths greater than zero. Set type attributes cannot be empty.

        参数:
        request - Container for the necessary parameters to execute the PutItem service method on Moladb.
        返回:
        The responseContent from the PutItem service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • getItem

        public GetItemResponse getItem​(GetItemRequest request)
                                throws BceClientException,
                                       BceServiceException

        The GetItem operation returns a set of attributes for the item with the given primary key. If there is no matching item, GetItem does not return any data.

        GetItem provides an eventually consistent read by default. If your application requires a strongly consistent read, set ConsistentRead to true . Although a strongly consistent read might take more time than an eventually consistent read, it always returns the last updated value.

        参数:
        request - Container for the necessary parameters to execute the GetItem request.
        返回:
        The responseContent from the GetItem service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • deleteItem

        public DeleteItemResponse deleteItem​(DeleteItemRequest request)
                                      throws BceClientException,
                                             BceServiceException

        The DeleteItem operation delete the item with the given primary key. If there is no matching item, DeleteItem does not return any data.

        参数:
        request - Container for the necessary parameters to execute the DeleteItem request.
        返回:
        The responseContent from the DeleteItem service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • updateItem

        public UpdateItemResponse updateItem​(UpdateItemRequest request)
                                      throws BceClientException,
                                             BceServiceException

        The UpdateItem operation update the item with the given primary key. If there is no matching item, UpdateItem does not return any data.

        参数:
        request - Container for the necessary parameters to execute the UpdateItem request.
        返回:
        The responseContent from the UpdateItem service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • batchGetItem

        public BatchGetItemResponse batchGetItem​(BatchGetItemRequest request)
                                          throws BceClientException,
                                                 BceServiceException

        The BatchGetItem operation get items with the given primary keys from Moladb. If there is no matching item, BatchGetItem does not return any data.

        The BatchGetItem can get items from multi tables with corresponding keys. These tables MUST under same instance.

        参数:
        request - Container for the necessary parameters to execute the BatchGetItem request.
        返回:
        The responseContent from the BatchGetItem service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • batchWriteItem

        public BatchWriteItemResponse batchWriteItem​(BatchWriteItemRequest request)
                                              throws BceClientException,
                                                     BceServiceException

        The BatchWriteItem operation write items with to Moladb.

        The BatchGetItem can write items within multi tables. These tables MUST under same instance.

        参数:
        request - Container for the necessary parameters to execute the BatchWriteItem request.
        返回:
        The responseContent from the BatchWriteItem service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.
      • query

        public QueryResponse query​(QueryRequest request)
                            throws BceClientException,
                                   BceServiceException

        The Query operation get items from Moladb with Hash Key and an interval of Range Key

        The Query operation is only support on tables whose Primary key type is HashAndRange Key

        参数:
        request - Container for the necessary parameters to execute the Query request.
        返回:
        The responseContent from the Query service method, as returned by Moladb.
        抛出:
        BceClientException - If any internal errors are encountered inside the client while attempting to make the request or handle the responseContent. For example if a network connection is not available.
        BceServiceException - If an error responseContent is returned by Moladb indicating either a problem with the data in the request, or a server side issue.