Class ClusterNodeAgent
java.lang.Object
org.j7m.middleware.cluster.ClusterNodeAgent
- All Implemented Interfaces:
AutoCloseable, ClusterNodeEndpoint, ManagedInvocation
Durable, serialized physical effect admission. Highest fence, intent and schema watermark are
fsynced before runtime mutation. An incomplete intent is reconciled from actual host state; an
unprovable replacement reports UNKNOWN instead of blindly replaying a potentially destructive
action. A newer controller cannot overlap a still executing old action in the same node agent.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ClusterNodeEndpoint
ClusterNodeEndpoint.Status -
Constructor Summary
ConstructorsConstructorDescriptionClusterNodeAgent(HostingSupervisor host, org.j7m.middleware.distributed.ResourceEndpoint authority, Supplier<org.j7m.middleware.consensus.NetworkConsensusStatus> consensus, Map<String, ReleaseDescriptor> catalog, Path journal, int initialSchema) Opens one agent's durable journal. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()byte[]Invokes a configured service contract; callers cannot select classes or methods.byte[]invokeRevision(String release, String requestId, String contract, byte[] payload, Instant deadline) Invokes only when the admission gate still hosts the selected revision.Reads actual node state.step(String operation, String phase, String release, String owner, long fence, long epoch, Instant deadline) Executes one locally journaled fenced physical step, reconciling exact retries.
-
Constructor Details
-
ClusterNodeAgent
public ClusterNodeAgent(HostingSupervisor host, org.j7m.middleware.distributed.ResourceEndpoint authority, Supplier<org.j7m.middleware.consensus.NetworkConsensusStatus> consensus, Map<String, ReleaseDescriptor> catalog, Path journal, int initialSchema) throws IOException Opens one agent's durable journal.- Parameters:
host- real hosting supervisorauthority- quorum-authoritative lifecycle scopeconsensus- actual local consensus status sourcecatalog- trusted release catalogjournal- private durable agent journalinitialSchema- known initial persisted schema- Throws:
IOException- corrupt or unavailable journal
-
-
Method Details
-
status
Reads actual node state.- Specified by:
statusin interfaceClusterNodeEndpoint- Parameters:
deadline- absolute deadline- Returns:
- local hosting and fresh consensus status
- Throws:
IOException- unavailable
-
step
public NodeView step(String operation, String phase, String release, String owner, long fence, long epoch, Instant deadline) throws IOException Executes one locally journaled fenced physical step, reconciling exact retries.- Specified by:
stepin interfaceClusterNodeEndpoint- Parameters:
operation- durable operation identityphase- DRAIN or REPLACErelease- server catalog identityowner- lease ownerfence- current fenceepoch- current leadership epochdeadline- absolute deadline- Returns:
- actual post-effect hosting view
- Throws:
IOException- stale authority or uncertain completion
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-
invoke
public byte[] invoke(String requestId, String contract, byte[] payload, Instant deadline) throws IOException Invokes a configured service contract; callers cannot select classes or methods.- Specified by:
invokein interfaceManagedInvocation- Parameters:
requestId- stable business request identitycontract- server-configured contract aliaspayload- bounded opaque application bytesdeadline- absolute deadline- Returns:
- independent application result bytes
- Throws:
IOException- unavailable, drained or unknown completion
-
invokeRevision
public byte[] invokeRevision(String release, String requestId, String contract, byte[] payload, Instant deadline) throws IOException Invokes only when the admission gate still hosts the selected revision.- Specified by:
invokeRevisionin interfaceManagedInvocation- Parameters:
release- selected revisionrequestId- stable identitycontract- configured aliaspayload- application bytesdeadline- absolute deadline- Returns:
- application response
- Throws:
IOException- when revision pinning is unsupported or admission fails
-