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

    Constructors
    Constructor
    Description
    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)
    Reads an initial authoritative route without changing the supplied clients' principals.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Revokes this binding without closing host-owned topology/group clients.
    org.j7m.middleware.distributed.PartitionReply
    execute(long ignoredEpoch, String requestId, byte[] command, byte[] query, Instant deadline)
    org.j7m.middleware.distributed.PartitionTopology.Route
    Returns current cached ownership without a network operation.
    org.j7m.middleware.distributed.PartitionReply
    query(long ignoredEpoch, byte[] query, Instant deadline)
    long
    Returns completed authoritative route reads, including initial preparation.
    org.j7m.middleware.distributed.PartitionStateMachine.Status
    status(Instant deadline)
    org.j7m.middleware.distributed.ExecutionSession
    subscribeExecution(long ignoredEpoch, String prefix, String kind, String owner, long leaseMillis, Instant deadline)
    org.j7m.middleware.distributed.QueueSession
    subscribeQueue(long ignoredEpoch, String queue, String group, String member, long visibilityMillis, boolean observational, Instant deadline)

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 identity
      topology - trusted route-read client with actual configured authorization
      groups - finite authorized owner-group endpoints, at most256
      refresh - explicit binding mode
      deadline - initial route-read deadline
      Throws:
      IOException - for unavailable topology or unauthorized/malformed ownership
      IllegalArgumentException - 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:
      execute in interface org.j7m.middleware.distributed.PartitionEndpoint
      Throws:
      IOException
    • query

      public org.j7m.middleware.distributed.PartitionReply query(long ignoredEpoch, byte[] query, Instant deadline) throws IOException
      Specified by:
      query in interface org.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:
      subscribeQueue in interface org.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:
      subscribeExecution in interface org.j7m.middleware.distributed.PartitionEndpoint
      Throws:
      IOException
    • status

      public org.j7m.middleware.distributed.PartitionStateMachine.Status status(Instant deadline) throws IOException
      Specified by:
      status in interface org.j7m.middleware.distributed.PartitionEndpoint
      Throws:
      IOException
    • close

      public void close()
      Revokes this binding without closing host-owned topology/group clients.
      Specified by:
      close in interface AutoCloseable