Class RollingClusterController
java.lang.Object
org.j7m.middleware.cluster.RollingClusterController
- All Implemented Interfaces:
AutoCloseable, ClusterLifecycle
public final class RollingClusterController
extends Object
implements ClusterLifecycle, AutoCloseable
Quorum-persisted, restartable single-flight rolling application controller. Durable progress and
hash-linked audit precede/describe every actual node effect. Lease loss stops progress; a new
controller resumes the persisted phase using node-side reconciliation. No local timer grants
authority. Resource retention capacity must be provisioned; completed operation identities are
retained rather than evicted and accidentally reexecuted.
-
Constructor Summary
ConstructorsConstructorDescriptionRollingClusterController(org.j7m.middleware.distributed.ResourceEndpoint resources, Map<String, ClusterNodeEndpoint> nodes, Map<String, ReleaseDescriptor> catalog) Creates a controller and starts bounded background reconciliation.RollingClusterController(org.j7m.middleware.distributed.ResourceEndpoint resources, Map<String, ClusterNodeEndpoint> nodes, Map<String, ReleaseDescriptor> catalog, org.j7m.middleware.integrations.Observability telemetry) Creates a controller with concrete bounded D15 tracing of actual lifecycle reconciliation. -
Method Summary
Modifier and TypeMethodDescriptionAdmits a rolling hosted-application upgrade; progress continues through its durable workflow.Reads retained hash-linked lifecycle events.voidclose()Stops new requests and waits for admitted invocations on one safe hosting target.Inspects actual authenticated hosts and durable workflow state.operationStatus(String operation, Instant deadline) Reads a durable operation including an earlier lost response.plan(String operationId, long expectedVersion, String releaseId, List<String> nodeIds, Instant deadline) Persists a checked deployment plan without replacing any application.voidAdvances at most one durable phase.longFailed reconciliation attempts; durable progress remains available through operationStatus.rollback(String operationId, long expectedVersion, String releaseId, List<String> nodeIds, Instant deadline) Plans and applies only a schema-compatible rollback release.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ClusterLifecycle
upgrade
-
Constructor Details
-
RollingClusterController
public RollingClusterController(org.j7m.middleware.distributed.ResourceEndpoint resources, Map<String, ClusterNodeEndpoint> nodes, Map<String, ReleaseDescriptor> catalog) Creates a controller and starts bounded background reconciliation.- Parameters:
resources- authorized shared resource scope with healthy time maintenancenodes- explicit authenticated node endpointscatalog- immutable operator-trusted compatibility catalog
-
RollingClusterController
public RollingClusterController(org.j7m.middleware.distributed.ResourceEndpoint resources, Map<String, ClusterNodeEndpoint> nodes, Map<String, ReleaseDescriptor> catalog, org.j7m.middleware.integrations.Observability telemetry) Creates a controller with concrete bounded D15 tracing of actual lifecycle reconciliation.- Parameters:
resources- authorized shared scopenodes- authenticated physical node endpointscatalog- operator-trusted releasestelemetry- optional bounded exporter; collector failure cannot authorize or block effects
-
-
Method Details
-
inspect
Inspects actual authenticated hosts and durable workflow state.- Specified by:
inspectin interfaceClusterLifecycle- Parameters:
deadline- absolute deadline- Returns:
- immutable fleet view
- Throws:
IOException- for unavailable authority
-
plan
public DeploymentPlan plan(String operationId, long expectedVersion, String releaseId, List<String> nodeIds, Instant deadline) throws IOException Persists a checked deployment plan without replacing any application.- Specified by:
planin interfaceClusterLifecycle- Parameters:
operationId- stable planning identityexpectedVersion- optimistic fleet generationreleaseId- trusted server catalog releasenodeIds- ordered hosting targetsdeadline- absolute deadline- Returns:
- immutable plan
- Throws:
IOException- conflict, incompatible release or unavailable authority
-
apply
public OperationStatus apply(String operationId, long expectedVersion, String planId, Instant deadline) throws IOException Admits a rolling hosted-application upgrade; progress continues through its durable workflow.- Specified by:
applyin interfaceClusterLifecycle- Parameters:
operationId- stable deployment identityexpectedVersion- optimistic generation used by the planplanId- immutable plan identitydeadline- absolute deadline- Returns:
- persisted current operation status
- Throws:
IOException- conflict, incompatible plan or unavailable authority
-
rollback
public OperationStatus rollback(String operationId, long expectedVersion, String releaseId, List<String> nodeIds, Instant deadline) throws IOException Plans and applies only a schema-compatible rollback release.- Specified by:
rollbackin interfaceClusterLifecycle- Parameters:
operationId- stable rollback identityexpectedVersion- inspected fleet generationreleaseId- trusted retained releasenodeIds- ordered hosting targetsdeadline- absolute deadline- Returns:
- persisted rollback status
- Throws:
IOException- incompatible downgrade, conflict or unavailable authority
-
drain
public OperationStatus drain(String operationId, long expectedVersion, String nodeId, Instant deadline) throws IOException Stops new requests and waits for admitted invocations on one safe hosting target.- Specified by:
drainin interfaceClusterLifecycle- Parameters:
operationId- stable drain identityexpectedVersion- optimistic fleet generationnodeId- hosting targetdeadline- absolute deadline- Returns:
- durable drain status
- Throws:
IOException- conflict, insufficient capacity or unavailable authority
-
operationStatus
Reads a durable operation including an earlier lost response.- Specified by:
operationStatusin interfaceClusterLifecycle- Parameters:
operation- admitted identitydeadline- absolute deadline- Returns:
- persisted status
- Throws:
IOException- not found or unavailable authority
-
audit
Reads retained hash-linked lifecycle events.- Specified by:
auditin interfaceClusterLifecycle- Parameters:
operation- workflow identitydeadline- absolute deadline- Returns:
- immutable audit sequence
- Throws:
IOException- unavailable authority
-
reconcile
Advances at most one durable phase. Useful for supervised control loops as well as the built-in worker.- Parameters:
deadline- absolute deadline- Throws:
IOException- unavailable authority or physical effect
-
reconciliationFailures
public long reconciliationFailures()Failed reconciliation attempts; durable progress remains available through operationStatus.- Returns:
- monotonic local failure count
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-