public class Tables
extends java.lang.Object
if (Tables.doesTableExist(dynamoDB, myTableName) == false) { // ... create your table ... Tables.waitForTableToBecomeActive(dynamoDB, myTableName); }
Constructor and Description |
---|
Tables() |
Modifier and Type | Method and Description |
---|---|
static boolean |
doesTableExist(AmazonDynamoDB dynamo,
java.lang.String tableName)
Checks if a specified table exists and is in
ACTIVE state. |
static void |
waitForTableToBecomeActive(AmazonDynamoDB dynamo,
java.lang.String tableName)
Waits up to 10 minutes for a specified AWS DynamoDB table to move into
the
ACTIVE state. |
static void |
waitForTableToBecomeActive(AmazonDynamoDB dynamo,
java.lang.String tableName,
int timeout,
int interval)
Waits up to a specified amount of time for a specified AWS DynamoDB table
to move into the
ACTIVE state. |
public static boolean doesTableExist(AmazonDynamoDB dynamo, java.lang.String tableName)
ACTIVE
state.dynamo
- The AWS DynamoDB client to use to make requests.tableName
- The name of the table being searched for.public static void waitForTableToBecomeActive(AmazonDynamoDB dynamo, java.lang.String tableName)
ACTIVE
state. If the table doesn't transition to the
ACTIVE
state, then an AmazonClientException is thrown.dynamo
- The AWS DynamoDB client to use to make requests.tableName
- The name of the table whose status is being checked.AmazonClientException
- If the specified table does not transition
into the ACTIVE
state before this method times
out and stops polling.public static void waitForTableToBecomeActive(AmazonDynamoDB dynamo, java.lang.String tableName, int timeout, int interval)
ACTIVE
state. If the table doesn't
transition to the ACTIVE
state, then an
AmazonClientException is thrown.dynamo
- The AWS DynamoDB client to use to make requests.tableName
- The name of the table whose status is being checked.timeout
- The maximum number of milliseconds to wait.interval
- The poll interval in milliseconds.AmazonClientException
- If the specified table does not transition
into the ACTIVE
state before this method times
out and stops polling.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.