Class DynamoDbLockManager

java.lang.Object
org.apache.iceberg.util.LockManagers.BaseLockManager
org.apache.iceberg.aws.dynamodb.DynamoDbLockManager
All Implemented Interfaces:
AutoCloseable, org.apache.iceberg.LockManager

public class DynamoDbLockManager extends org.apache.iceberg.util.LockManagers.BaseLockManager
DynamoDB implementation for the lock manager.
  • Constructor Summary

    Constructors
    Constructor
    Description
    constructor 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 Type
    Method
    Description
    boolean
    acquire(String entityId, String ownerId)
     
    void
     
    void
    initialize(Map<String,String> properties)
     
    static List<software.amazon.awssdk.services.dynamodb.model.AttributeDefinition>
    The lock table column definition, for users who whould like to create the table separately
    static List<software.amazon.awssdk.services.dynamodb.model.KeySchemaElement>
    The lock table schema, for users who would like to create the table separately
    boolean
    release(String entityId, String ownerId)
     

    Methods inherited from class org.apache.iceberg.util.LockManagers.BaseLockManager

    acquireIntervalMs, acquireTimeoutMs, heartbeatIntervalMs, heartbeatThreads, heartbeatTimeoutMs, scheduler

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 client
      lockTableName - lock table name
  • Method Details

    • initialize

      public void initialize(Map<String,String> properties)
      Specified by:
      initialize in interface org.apache.iceberg.LockManager
      Overrides:
      initialize in class org.apache.iceberg.util.LockManagers.BaseLockManager
    • acquire

      public boolean acquire(String entityId, String ownerId)
    • release

      public boolean release(String entityId, String ownerId)
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class org.apache.iceberg.util.LockManagers.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