Class RefreshingPartitionEndpoint
java.lang.Object
org.j7m.middleware.application.distributed.RefreshingPartitionEndpoint
- All Implemented Interfaces:
AutoCloseable, org.j7m.middleware.distributed.PartitionEndpoint
public final class RefreshingPartitionEndpoint
extends Object
implements org.j7m.middleware.distributed.PartitionEndpoint, AutoCloseable
Exact-call partition route binding over authorized topology and group clients. Binding refresh
never repeats execute/query: MOVED/FROZEN or an IOException mark the route for a subsequent call.
Native group clients retain their documented leader/idempotency protocol. The original request ID,
command, cursor/query bytes and deadline are passed unchanged. UNKNOWN remains UNKNOWN.
-
Constructor Summary
ConstructorsConstructorDescriptionRefreshingPartitionEndpoint(String partition, org.j7m.middleware.distributed.PartitionAdminClient topology, Map<String, org.j7m.middleware.distributed.PartitionEndpoint> groups, org.j7m.middleware.annotations.BindingRefresh refresh, Instant deadline) Reads an initial authoritative route without changing the supplied clients' principals. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Revokes this binding without closing host-owned topology/group clients.org.j7m.middleware.distributed.PartitionReplyorg.j7m.middleware.distributed.PartitionTopology.RouteReturns current cached ownership without a network operation.org.j7m.middleware.distributed.PartitionReplylongReturns completed authoritative route reads, including initial preparation.org.j7m.middleware.distributed.PartitionStateMachine.Statusorg.j7m.middleware.distributed.ExecutionSessionsubscribeExecution(long ignoredEpoch, String prefix, String kind, String owner, long leaseMillis, Instant deadline) org.j7m.middleware.distributed.QueueSessionsubscribeQueue(long ignoredEpoch, String queue, String group, String member, long visibilityMillis, boolean observational, Instant deadline)
-
Constructor Details
-
RefreshingPartitionEndpoint
public RefreshingPartitionEndpoint(String partition, org.j7m.middleware.distributed.PartitionAdminClient topology, Map<String, org.j7m.middleware.distributed.PartitionEndpoint> groups, org.j7m.middleware.annotations.BindingRefresh refresh, Instant deadline) throws IOException Reads an initial authoritative route without changing the supplied clients' principals.- Parameters:
partition- stable partition identitytopology- trusted route-read client with actual configured authorizationgroups- finite authorized owner-group endpoints, at most256refresh- explicit binding modedeadline- initial route-read deadline- Throws:
IOException- for unavailable topology or unauthorized/malformed ownershipIllegalArgumentException- for invalid configuration
-
-
Method Details
-
ownership
public org.j7m.middleware.distributed.PartitionTopology.Route ownership()Returns current cached ownership without a network operation.- Returns:
- immutable last accepted authoritative route
-
refreshes
public long refreshes()Returns completed authoritative route reads, including initial preparation.- Returns:
- aggregate refresh count
-
execute
public org.j7m.middleware.distributed.PartitionReply execute(long ignoredEpoch, String requestId, byte[] command, byte[] query, Instant deadline) throws IOException - Specified by:
executein interfaceorg.j7m.middleware.distributed.PartitionEndpoint- Throws:
IOException
-
query
public org.j7m.middleware.distributed.PartitionReply query(long ignoredEpoch, byte[] query, Instant deadline) throws IOException - Specified by:
queryin interfaceorg.j7m.middleware.distributed.PartitionEndpoint- Throws:
IOException
-
subscribeQueue
public org.j7m.middleware.distributed.QueueSession subscribeQueue(long ignoredEpoch, String queue, String group, String member, long visibilityMillis, boolean observational, Instant deadline) throws IOException - Specified by:
subscribeQueuein interfaceorg.j7m.middleware.distributed.PartitionEndpoint- Throws:
IOException
-
subscribeExecution
public org.j7m.middleware.distributed.ExecutionSession subscribeExecution(long ignoredEpoch, String prefix, String kind, String owner, long leaseMillis, Instant deadline) throws IOException - Specified by:
subscribeExecutionin interfaceorg.j7m.middleware.distributed.PartitionEndpoint- Throws:
IOException
-
status
public org.j7m.middleware.distributed.PartitionStateMachine.Status status(Instant deadline) throws IOException - Specified by:
statusin interfaceorg.j7m.middleware.distributed.PartitionEndpoint- Throws:
IOException
-
close
public void close()Revokes this binding without closing host-owned topology/group clients.- Specified by:
closein interfaceAutoCloseable
-