当前位置: 首页>>代码示例>>Java>>正文


Java DescribeTableResult.getTable方法代码示例

本文整理汇总了Java中com.amazonaws.services.dynamodbv2.model.DescribeTableResult.getTable方法的典型用法代码示例。如果您正苦于以下问题:Java DescribeTableResult.getTable方法的具体用法?Java DescribeTableResult.getTable怎么用?Java DescribeTableResult.getTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amazonaws.services.dynamodbv2.model.DescribeTableResult的用法示例。


在下文中一共展示了DescribeTableResult.getTable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: describeTable

import com.amazonaws.services.dynamodbv2.model.DescribeTableResult; //导入方法依赖的package包/类
private void describeTable(String tableName) throws IllegalArgumentException {
    try {
        DescribeTableResult describeResult = dynamoDBClient.describeTable(tableName);
        tableDescription = describeResult.getTable();
    } catch (ResourceNotFoundException rnfe) {
        throw new IllegalArgumentException("Error: given table " + tableName + " does not exist in given region.");
    } catch (AmazonServiceException ase) {
        if (ase.getErrorCode().equals("UnrecognizedClientException"))
            throw new IllegalArgumentException("Error: Security token in credential file invalid.");
        else
            throw new IllegalArgumentException(ase.getMessage());
    }
}
 
开发者ID:awslabs,项目名称:dynamodb-online-index-violation-detector,代码行数:14,代码来源:TableHelper.java

示例2: getTableStatus

import com.amazonaws.services.dynamodbv2.model.DescribeTableResult; //导入方法依赖的package包/类
/***
 * Get Table Status
 * @param tableName
 * @return status
 */
public String getTableStatus(final String tableName) throws ResourceNotFoundException{
	final DescribeTableResult description = describeTable(tableName);
	if(description.getTable()!=null){
		return description.getTable().getTableStatus();
	}
	return null;
}
 
开发者ID:shagwood,项目名称:micro-genie,代码行数:13,代码来源:DynamoAdmin.java

示例3: createTable

import com.amazonaws.services.dynamodbv2.model.DescribeTableResult; //导入方法依赖的package包/类
/**
 * Creates DynamoDB table. If the table already exists, it validates the key schema. If the key schemas match, a
 * warning is logged, otherwise an exception is raised.
 *
 * @param dynamoDB
 *            {@link AmazonDynamoDB} used to create the table specified in the request.
 * @param request
 *            Request for creating a table.
 * @return TableDescription of the existing table or newly created table
 */
public static TableDescription createTable(final AmazonDynamoDB dynamoDB, final CreateTableRequest request) {
    try {
        final DescribeTableResult result = dynamoDB.describeTable(request.getTableName());
        if (!request.getKeySchema().equals(result.getTable().getKeySchema())) {
            throw new IllegalStateException("Table " + request.getTableName()
                + " already exists and has an invalid schema");
        }
        LOGGER.warning("Table " + request.getTableName() + " already exists");
        return result.getTable();
    } catch (final ResourceNotFoundException e) {
        return dynamoDB.createTable(request).getTableDescription();
    }
}
 
开发者ID:awslabs,项目名称:aws-dynamodb-mars-json-demo,代码行数:24,代码来源:DynamoDBManager.java


注:本文中的com.amazonaws.services.dynamodbv2.model.DescribeTableResult.getTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。