Class CpcTenantLifecycleManager
java.lang.Object
io.confluent.kafka.cpc.multitenant.CpcTenantLifecycleManager
Manages the lifecycle of CPC tenants. A tenant's deletion date is the time at which it
should be deleted: a tenant with no deletion date is active, a tenant whose deletion date
is in the future is deactivated (but not yet deleted), and once the deletion date has passed
the manager orchestrates resource cleanup (topics, ACLs, transactions).
State machine:
ACTIVE → DEACTIVATED → DELETE_IN_PROGRESS → DELETED
↑ (deletion date reached)
└── reactivation (deletion date removed)
-
Constructor Summary
ConstructorsConstructorDescriptionCpcTenantLifecycleManager(int deleteBatchSize, org.apache.kafka.common.utils.Time time) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Shuts down the deletion executor and closes the admin client.voidTries to create the admin client via the configured supplier.Returns the set of tenants currently in DEACTIVATED state.Returns the set of tenants currently in DELETE_IN_PROGRESS state.voidRuns one pass of resource cleanup for all tenants currently in DELETE_IN_PROGRESS: aborts transactions, deletes topics, deletes ACLs.Returns the set of tenants currently in DELETED state.booleanisClusterActive(String lcId) Returns true if the given tenant is tracked and in ACTIVE state.voidsetAdminSupplierAndCreateClient(Function<String, org.apache.kafka.clients.admin.Admin> adminClientSupplier) Sets the admin client supplier and attempts to create the admin client.voidupdateTenantState(io.confluent.kafka.cpc.multitenant.CpcLogicalClusterMetadata lcm) Records the lifecycle state transition for a tenant based on its current metadata.
-
Constructor Details
-
CpcTenantLifecycleManager
public CpcTenantLifecycleManager(int deleteBatchSize, org.apache.kafka.common.utils.Time time)
-
-
Method Details
-
setAdminSupplierAndCreateClient
-
createAdminClient
public void createAdminClient()Tries to create the admin client via the configured supplier. No-op if already created; logs and silently fails if the supplier throws — caller is expected to retry. -
updateTenantState
public void updateTenantState(io.confluent.kafka.cpc.multitenant.CpcLogicalClusterMetadata lcm) Records the lifecycle state transition for a tenant based on its current metadata. Active tenants reset to ACTIVE; tenants with a deletion date transition to DEACTIVATED or DELETE_IN_PROGRESS depending on whether that deletion date is still in the future or has passed. -
deleteTenants
public void deleteTenants()Runs one pass of resource cleanup for all tenants currently in DELETE_IN_PROGRESS: aborts transactions, deletes topics, deletes ACLs. Tenants whose topics and ACLs are confirmed gone transition to DELETED. Designed to be called repeatedly on a fixed interval. -
isClusterActive
Returns true if the given tenant is tracked and in ACTIVE state. Unknown tenants return false. -
deactivatedClusters
-
deleteInProgressClusters
-
fullyDeletedClusters
-
close
public void close()Shuts down the deletion executor and closes the admin client. Idempotent.
-