public class DynamoDBLeaseTableDao extends Object implements EntityDAO
EntityDAO that performs a parallel scan of the lease table
and groups all entities by their EntityType.
Delegates deserialization to the appropriate existing DAO:
LeaseSerializer.fromDynamoRecord(Map)CoordinatorStateDAODelegate.fromDynamoRecord(Map)TableSchemaRecords without an entityType attribute are treated as EntityType.LEASE.
Uses a parallel scan pattern similar to
DynamoDBLeaseRefresher.listLeasesParallely for throughput.
EntityDAO.Entity, EntityDAO.EntityScanList| Constructor and Description |
|---|
DynamoDBLeaseTableDao(software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient dynamoDbAsyncClient,
String tableName,
LeaseSerializer leaseSerializer,
CoordinatorStateDAODelegate coordinatorStateDAODelegate,
ExecutorService executorService,
int leaseTableScanTotalSegments) |
| Modifier and Type | Method and Description |
|---|---|
Map<EntityType,EntityDAO.EntityScanList> |
scanAllEntities()
Scan all entities from the lease table and group them by their
EntityType. |
Map<EntityType,EntityDAO.EntityScanList> |
scanEntities(EntityType... entityTypes)
Scan entities from the lease table filtered to only the specified entity types.
|
void |
shutdown()
Shuts down any resources held by this DAO, such as thread pools used for parallel scans.
|
public DynamoDBLeaseTableDao(software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient dynamoDbAsyncClient,
String tableName,
LeaseSerializer leaseSerializer,
CoordinatorStateDAODelegate coordinatorStateDAODelegate,
ExecutorService executorService,
int leaseTableScanTotalSegments)
public Map<EntityType,EntityDAO.EntityScanList> scanAllEntities() throws DependencyException, InvalidStateException, ProvisionedThroughputException
EntityDAOEntityType.
Records without an entityType attribute are treated as EntityType.LEASE.scanAllEntities in interface EntityDAOEntityDAO.EntityScanList containing entities and deserialization failuresDependencyException - if DynamoDB scan fails in an unexpected wayInvalidStateException - if the table does not existProvisionedThroughputException - if DynamoDB scan fails due to lack of capacitypublic Map<EntityType,EntityDAO.EntityScanList> scanEntities(EntityType... entityTypes) throws DependencyException, InvalidStateException, ProvisionedThroughputException
EntityDAOscanEntities in interface EntityDAOentityTypes - the set of entity types to include in the resultEntityDAO.EntityScanList containing entities and
deserialization failures per typeDependencyException - if DynamoDB scan fails in an unexpected wayInvalidStateException - if the table does not existProvisionedThroughputException - if DynamoDB scan fails due to lack of capacityCopyright © 2026. All rights reserved.