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(PipelineRun pipelineRun)
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(PipelineRun pipelineRun) 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 ExecutionPlannerpipelineRun - the in-flight run aggregate; this implementation reads the loaded
stages from it (pipelineRun.getLoadedStages()) and does not
yet consult per-stage state (deferred to a later phase)LockException - if unable to acquire the distributed lock within the configured timeout