Package org.apache.iceberg.aws.dynamodb
Class DynamoDbLockManager
java.lang.Object
org.apache.iceberg.util.LockManagers.BaseLockManager
org.apache.iceberg.aws.dynamodb.DynamoDbLockManager
- All Implemented Interfaces:
AutoCloseable,LockManager
DynamoDB implementation for the lock manager.
-
Constructor Summary
ConstructorsConstructorDescriptionconstructor for dynamic initialization,initialize(Map)must be called later.DynamoDbLockManager(software.amazon.awssdk.services.dynamodb.DynamoDbClient dynamo, String lockTableName) constructor used for testing purpose -
Method Summary
Modifier and TypeMethodDescriptionbooleanTry to acquire a lockvoidclose()voidinitialize(Map<String, String> properties) Initialize lock manager from catalog properties.static List<software.amazon.awssdk.services.dynamodb.model.AttributeDefinition>The lock table column definition, for users who whould like to create the table separatelystatic List<software.amazon.awssdk.services.dynamodb.model.KeySchemaElement>The lock table schema, for users who would like to create the table separatelybooleanRelease a lockMethods inherited from class org.apache.iceberg.util.LockManagers.BaseLockManager
acquireIntervalMs, acquireTimeoutMs, heartbeatIntervalMs, heartbeatThreads, heartbeatTimeoutMs, scheduler
-
Constructor Details
-
DynamoDbLockManager
public DynamoDbLockManager()constructor for dynamic initialization,initialize(Map)must be called later. -
DynamoDbLockManager
public DynamoDbLockManager(software.amazon.awssdk.services.dynamodb.DynamoDbClient dynamo, String lockTableName) constructor used for testing purpose- Parameters:
dynamo- dynamo clientlockTableName- lock table name
-
-
Method Details
-
initialize
Description copied from interface:LockManagerInitialize lock manager from catalog properties.- Specified by:
initializein interfaceLockManager- Overrides:
initializein classLockManagers.BaseLockManager- Parameters:
properties- catalog properties
-
acquire
Description copied from interface:LockManagerTry to acquire a lock- Parameters:
entityId- ID of the entity to lockownerId- ID of the owner if the lock- Returns:
- if the lock for the entity is acquired by the owner
-
release
Description copied from interface:LockManagerRelease a lockexception must not be thrown for this method.
- Parameters:
entityId- ID of the entity to lockownerId- ID of the owner if the lock- Returns:
- if the owner held the lock and successfully released it.
-
close
- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classLockManagers.BaseLockManager- Throws:
Exception
-
lockTableSchema
public static List<software.amazon.awssdk.services.dynamodb.model.KeySchemaElement> lockTableSchema()The lock table schema, for users who would like to create the table separately- Returns:
- lock table schema
-
lockTableColDefinitions
public static List<software.amazon.awssdk.services.dynamodb.model.AttributeDefinition> lockTableColDefinitions()The lock table column definition, for users who whould like to create the table separately- Returns:
- lock table column definition
-