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 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 maintenance
      nodes - explicit authenticated node endpoints
      catalog - 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 scope
      nodes - authenticated physical node endpoints
      catalog - operator-trusted releases
      telemetry - optional bounded exporter; collector failure cannot authorize or block effects
  • Method Details

    • inspect

      public ClusterView inspect(Instant deadline) throws IOException
      Inspects actual authenticated hosts and durable workflow state.
      Specified by:
      inspect in interface ClusterLifecycle
      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:
      plan in interface ClusterLifecycle
      Parameters:
      operationId - stable planning identity
      expectedVersion - optimistic fleet generation
      releaseId - trusted server catalog release
      nodeIds - ordered hosting targets
      deadline - 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:
      apply in interface ClusterLifecycle
      Parameters:
      operationId - stable deployment identity
      expectedVersion - optimistic generation used by the plan
      planId - immutable plan identity
      deadline - 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:
      rollback in interface ClusterLifecycle
      Parameters:
      operationId - stable rollback identity
      expectedVersion - inspected fleet generation
      releaseId - trusted retained release
      nodeIds - ordered hosting targets
      deadline - 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:
      drain in interface ClusterLifecycle
      Parameters:
      operationId - stable drain identity
      expectedVersion - optimistic fleet generation
      nodeId - hosting target
      deadline - absolute deadline
      Returns:
      durable drain status
      Throws:
      IOException - conflict, insufficient capacity or unavailable authority
    • operationStatus

      public OperationStatus operationStatus(String operation, Instant deadline) throws IOException
      Reads a durable operation including an earlier lost response.
      Specified by:
      operationStatus in interface ClusterLifecycle
      Parameters:
      operation - admitted identity
      deadline - absolute deadline
      Returns:
      persisted status
      Throws:
      IOException - not found or unavailable authority
    • audit

      public List<AuditEvent> audit(String operation, Instant deadline) throws IOException
      Reads retained hash-linked lifecycle events.
      Specified by:
      audit in interface ClusterLifecycle
      Parameters:
      operation - workflow identity
      deadline - absolute deadline
      Returns:
      immutable audit sequence
      Throws:
      IOException - unavailable authority
    • reconcile

      public void reconcile(Instant deadline) throws IOException
      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:
      close in interface AutoCloseable