public class Tables extends 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,
String tableName)
Checks if a specified table exists.
|
static void |
waitForTableToBecomeActive(AmazonDynamoDB dynamo,
String tableName)
Waits up to 10 minutes for a specified AWS DynamoDB table to move into
the
ACTIVE state. |
public static boolean doesTableExist(AmazonDynamoDB dynamo, String tableName)
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, 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.Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.