您可以使用查询表描述信息(DescribeTable )接口查询表的结构信息(TableMeta)、配置信息(TableOptions)和预留读/写吞吐量的情况(ReservedThroughputDetails)。

TableMeta 、 TableOptions 、在建表一节已经有过介绍,ReservedThroughputDetails 除了包含表的预留吞吐量的值外,还包括最近一次上调或者下调的时间。

示例

private static void describeTable(SyncClient client) {
    DescribeTableRequest request = new DescribeTableRequest(TABLE_NAME);
    DescribeTableResponse response = client.describeTable(request);
    TableMeta tableMeta = response.getTableMeta();
    System.out.println("表的名称:" + tableMeta.getTableName());
    System.out.println("表的主键:");
    for (PrimaryKeySchema primaryKeySchema : tableMeta.getPrimaryKeyList()) {
        System.out.println(primaryKeySchema);
    }
    TableOptions tableOptions = response.getTableOptions();
    System.out.println("表的TTL:" + tableOptions.getTimeToLive());
    System.out.println("表的MaxVersions:" + tableOptions.getMaxVersions());
    ReservedThroughputDetails reservedThroughputDetails = response.getReservedThroughputDetails();
    System.out.println("表的预留读吞吐量:"
            + reservedThroughputDetails.getCapacityUnit().getReadCapacityUnit());
    System.out.println("表的预留写吞吐量:"
            + reservedThroughputDetails.getCapacityUnit().getWriteCapacityUnit());
}