public class DynamoDBUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DynamoDBUtils.DynamoDBType |
| Modifier and Type | Field and Description |
|---|---|
static String |
ASYNC_CLIENT_PROP |
static String |
AVRO_SERIALIZATION |
static String |
AWS_CREDENTIALS_PROPERTIES
AWS Credential file name.
|
static String |
CLI_TYP_PROP
Parameter to decide what type of Amazon DynamoDB client to use
|
static String |
CONSISTENCY_READS
Parameter to decide how reads will be made i.e.
|
static String |
CONSISTENCY_READS_TRUE |
static String |
DYNAMO_KEY_HASHR |
static String |
DYNAMO_KEY_HASHRANGE |
static String |
DYNAMO_SERIALIZATION |
static String |
ENDPOINT_PROP
Parameter to decide where the data store will make its computations
|
static org.slf4j.Logger |
LOG |
static String |
MAPPING_FILE
The mapping file to create the tables from.
|
static String |
PREF_SCH_NAME
Parameter to decide which schema will be used
|
static String |
SERIALIZATION_TYPE
Parameter to decide how serialization will be made i.e.
|
static long |
SLEEP_DELETE_TIME |
static long |
SLEEP_TIME |
static String |
SYNC_CLIENT_PROP
DynamoDB client types.
|
static long |
WAIT_TIME
Default times to wait while requests are performed.
|
static String |
WS_PROVIDER
Name of the cloud database provider.
|
| Constructor and Description |
|---|
DynamoDBUtils() |
| Modifier and Type | Method and Description |
|---|---|
static com.amazonaws.services.dynamodbv2.model.CreateTableRequest |
buildCreateTableRequest(String tableName,
ArrayList<com.amazonaws.services.dynamodbv2.model.KeySchemaElement> keySchema,
com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput proThrou,
Map<String,String> attrs)
Builds the necessary requests to create tables
|
static void |
executeCreateTableRequest(com.amazonaws.services.dynamodbv2.AmazonDynamoDB awsClient,
String tableName,
ArrayList<com.amazonaws.services.dynamodbv2.model.KeySchemaElement> keySchema,
Map<String,String> attrs,
com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput proThrou)
Executes a create table request using the DynamoDB client and waits the
default time until it's been created.
|
static com.amazonaws.services.dynamodbv2.AmazonDynamoDB |
getClient(String clientType,
com.amazonaws.auth.AWSCredentials credentials)
Method to create the specific client to be used
|
static com.amazonaws.auth.PropertiesCredentials |
getCredentials(Class<?> clazz)
Creates the AWSCredentials object based on the properties file.
|
static void |
waitForTableToBecomeAvailable(com.amazonaws.services.dynamodbv2.AmazonDynamoDB awsClient,
String tableName)
Waits up to 6 minutes to confirm if a table has been created or not
|
public static final String DYNAMO_KEY_HASHRANGE
public static final String DYNAMO_KEY_HASHR
public static final String AWS_CREDENTIALS_PROPERTIES
public static final String WS_PROVIDER
public static final String CLI_TYP_PROP
public static final String ENDPOINT_PROP
public static final String PREF_SCH_NAME
public static final String CONSISTENCY_READS
public static final String CONSISTENCY_READS_TRUE
public static final String SERIALIZATION_TYPE
public static final String DYNAMO_SERIALIZATION
public static final String AVRO_SERIALIZATION
public static final String SYNC_CLIENT_PROP
public static final String ASYNC_CLIENT_PROP
public static final String MAPPING_FILE
public static long WAIT_TIME
public static long SLEEP_TIME
public static long SLEEP_DELETE_TIME
public static final org.slf4j.Logger LOG
public static com.amazonaws.services.dynamodbv2.AmazonDynamoDB getClient(String clientType, com.amazonaws.auth.AWSCredentials credentials)
clientType - credentials - public static com.amazonaws.auth.PropertiesCredentials getCredentials(Class<?> clazz)
clazz - public static void executeCreateTableRequest(com.amazonaws.services.dynamodbv2.AmazonDynamoDB awsClient,
String tableName,
ArrayList<com.amazonaws.services.dynamodbv2.model.KeySchemaElement> keySchema,
Map<String,String> attrs,
com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput proThrou)
awsClient - keySchema - tableName - proThrou - public static com.amazonaws.services.dynamodbv2.model.CreateTableRequest buildCreateTableRequest(String tableName, ArrayList<com.amazonaws.services.dynamodbv2.model.KeySchemaElement> keySchema, com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput proThrou, Map<String,String> attrs)
tableName - keySchema - proThrou - attrs - public static void waitForTableToBecomeAvailable(com.amazonaws.services.dynamodbv2.AmazonDynamoDB awsClient,
String tableName)
awsClient - tableName - Copyright © 2010-2017 The Apache Software Foundation. All Rights Reserved.