public class DynamoDBMetadataStoreTableManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
E_INCOMPATIBLE_ITEM_VERSION
Error: version mismatch.
|
static String |
E_INCOMPATIBLE_TAG_VERSION
Error: version mismatch.
|
static String |
E_NO_VERSION_MARKER_AND_NOT_EMPTY
Error: version marker not found in table but the table is not empty.
|
static org.slf4j.Logger |
LOG |
static String |
SSE_DEFAULT_MASTER_KEY
The AWS managed CMK for DynamoDB server side encryption.
|
| Constructor and Description |
|---|
DynamoDBMetadataStoreTableManager(com.amazonaws.services.dynamodbv2.document.DynamoDB dynamoDB,
String tableName,
String region,
com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB,
org.apache.hadoop.conf.Configuration conf,
Invoker readOp,
org.apache.hadoop.io.retry.RetryPolicy batchWriteCapacityExceededEvents) |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
static com.amazonaws.SdkBaseException |
extractInnerException(IllegalArgumentException ex)
Take an
IllegalArgumentException raised by a DDB operation
and if it contains an inner SDK exception, unwrap it. |
com.amazonaws.services.dynamodbv2.document.Table |
getTable() |
String |
getTableArn() |
List<com.amazonaws.services.dynamodbv2.model.Tag> |
getTableTagsFromConfig()
Return tags from configuration and the version marker for adding to
dynamo table during creation.
|
protected static com.amazonaws.services.dynamodbv2.document.Item |
getVersionMarkerFromTags(com.amazonaws.services.dynamodbv2.document.Table table,
com.amazonaws.services.dynamodbv2.AmazonDynamoDB addb) |
protected com.amazonaws.services.dynamodbv2.document.Item |
getVersionMarkerItem()
Get the version mark item in the existing DynamoDB table.
|
protected void |
tagTableWithVersionMarker() |
protected void |
verifyVersionCompatibility()
Verify that a table version is compatible with this S3Guard client.
|
public static final org.slf4j.Logger LOG
public static final String E_NO_VERSION_MARKER_AND_NOT_EMPTY
public static final String E_INCOMPATIBLE_TAG_VERSION
public static final String E_INCOMPATIBLE_ITEM_VERSION
public static final String SSE_DEFAULT_MASTER_KEY
public DynamoDBMetadataStoreTableManager(com.amazonaws.services.dynamodbv2.document.DynamoDB dynamoDB,
String tableName,
String region,
com.amazonaws.services.dynamodbv2.AmazonDynamoDB amazonDynamoDB,
org.apache.hadoop.conf.Configuration conf,
Invoker readOp,
org.apache.hadoop.io.retry.RetryPolicy batchWriteCapacityExceededEvents)
protected void tagTableWithVersionMarker()
throws com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBException
com.amazonaws.services.dynamodbv2.model.AmazonDynamoDBExceptionprotected static com.amazonaws.services.dynamodbv2.document.Item getVersionMarkerFromTags(com.amazonaws.services.dynamodbv2.document.Table table,
com.amazonaws.services.dynamodbv2.AmazonDynamoDB addb)
throws IOException
IOException@Retries.OnceRaw public List<com.amazonaws.services.dynamodbv2.model.Tag> getTableTagsFromConfig()
protected void verifyVersionCompatibility()
throws IOException
1. If the table lacks both version markers AND it's empty,
both markers will be added.
If the table is not empty the check throws IOException
2. If there's no version marker ITEM, the compatibility with the TAG
will be checked, and the version marker ITEM will be added if the
TAG version is compatible.
If the TAG version is not compatible, the check throws OException
3. If there's no version marker TAG, the compatibility with the ITEM
version marker will be checked, and the version marker ITEM will be
added if the ITEM version is compatible.
If the ITEM version is not compatible, the check throws IOException
4. If the TAG and ITEM versions are both present then both will be checked
for compatibility. If the ITEM or TAG version marker is not compatible,
the check throws IOException
IOException - on any incompatibilitypublic static com.amazonaws.SdkBaseException extractInnerException(IllegalArgumentException ex)
IllegalArgumentException raised by a DDB operation
and if it contains an inner SDK exception, unwrap it.ex - exception.@Retries.RetryTranslated protected com.amazonaws.services.dynamodbv2.document.Item getVersionMarkerItem() throws IOException
IOException@Retries.RetryTranslated public void destroy() throws IOException
IOExceptionpublic com.amazonaws.services.dynamodbv2.document.Table getTable()
public String getTableArn()
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.