public class CommunityExecutionPlanner extends ExecutionPlanner
| Modifier and Type | Class and Description |
|---|---|
static class |
CommunityExecutionPlanner.Builder |
| Constructor and Description |
|---|
CommunityExecutionPlanner(io.flamingock.internal.util.id.RunnerId instanceId,
CommunityLockService lockService,
CommunityAuditReader auditReader,
CoreConfigurable coreConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
static CommunityExecutionPlanner.Builder |
builder() |
ExecutionPlan |
getNextExecution(java.util.List<AbstractLoadedStage> loadedStages)
Gets the next execution plan using a two-phase audit read to prevent race conditions in concurrent executions.
|
public CommunityExecutionPlanner(io.flamingock.internal.util.id.RunnerId instanceId,
CommunityLockService lockService,
CommunityAuditReader auditReader,
CoreConfigurable coreConfiguration)
instanceId - the runner instance identifierlockService - lockService to persist the lockauditReader - audit reader to get current audit statecoreConfiguration - core configuration settingspublic static CommunityExecutionPlanner.Builder builder()
public ExecutionPlan getNextExecution(java.util.List<AbstractLoadedStage> loadedStages) throws LockException
How it works:
Concurrent Execution Handling:
Instance A: Read audit → Get lock → Re-read → Execute → Release Instance B: Read audit → Wait for lock → Get lock → Re-read → Detect already executed → Release
Error Handling: If any exception occurs after acquiring the lock, the lock is released in the catch block to prevent lock leaks.
getNextExecution in class ExecutionPlannerloadedStages - the list of loaded stages containing all defined changesLockException - if unable to acquire the distributed lock within the configured timeout