Package org.limitless.seqeron.app
Class Application.Builder
java.lang.Object
org.limitless.seqeron.app.Application.Builder
- Enclosing class:
Application
Everything one replica needs to join its deployment.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddressedGroups(String... addressedGroups) The names of the groups this application publishes to besides its own; one the log's group table lacks fences it withClusterError.GROUP_UNKNOWN.build()clientId(int clientId) This replica's client id, its counters' label — required, and unique among the clients on its node: two sharing one share their counters' series.egressChannel(String egressChannel) This client's own egress endpoint; two media drivers on one host cannot both bind a port.idleStrategy(org.agrona.concurrent.IdleStrategy idleStrategy) What a call that blocks waits on between attempts: apublishthat spins through an election, up to 10 s, and the cluster connect instart.ingressEndpoints(String ingressEndpoints) The members to reach when this node is not leading,PortLayout.ingressEndpoints()by default.ipcConnectTimeoutMs(long ipcConnectTimeoutMs) How long to wait for IPC ingress to the local member while it leads before using UDP, 500L ms by default.listener(Application.Listener listener) memberId(int memberId) The node this replica runs on: whose queue it follows, and whose leadership opens its gate.offCluster(boolean offCluster) Whether this node is a gateway host, running no member, rather than a member: the gate then opens whoever leads, and ingress is UDP alone.outstandingWork(OutstandingWork<?, ?> outstandingWork) The tracker of this application's leader-only work.snapshots(SnapshotListener snapshotListener, Path snapshotDirectory) Takes this replica into snapshot rounds; without it it takes part in none, whatever its topology row says, and recovers fromclusterSeqNo1.sourceId(int sourceId) This application'ssourceId, the one its<applications>row declares — required, because spec §5 is one id space, and never −1, which ingress refuses.The stall and capacity policy,Tuning.DEFAULTby default.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
sourceId
This application'ssourceId, the one its<applications>row declares — required, because spec §5 is one id space, and never −1, which ingress refuses. -
addressedGroups
The names of the groups this application publishes to besides its own; one the log's group table lacks fences it withClusterError.GROUP_UNKNOWN. -
clientId
This replica's client id, its counters' label — required, and unique among the clients on its node: two sharing one share their counters' series. -
memberId
The node this replica runs on: whose queue it follows, and whose leadership opens its gate. -
egressChannel
This client's own egress endpoint; two media drivers on one host cannot both bind a port. An ephemeral port on localhost,aeron:udp?endpoint=localhost:0, by default. -
ingressEndpoints
The members to reach when this node is not leading,PortLayout.ingressEndpoints()by default. -
listener
-
outstandingWork
The tracker of this application's leader-only work. The façade calls itsOutstandingWork.onNotLeader()whenever the gate closes, beforeApplication.Listener.onLeadershipChanged(boolean), so the listener need not. Optional: without one the listener does it. -
snapshots
Takes this replica into snapshot rounds; without it it takes part in none, whatever its topology row says, and recovers fromclusterSeqNo1.- Parameters:
snapshotListener- serializes this application's state for a round and restores it on startsnapshotDirectory- where this replica keeps its snapshots, one file per round. Its own: no other instance may write it. A restart restores from what it holds, so it must outlive the process.
-
tuning
The stall and capacity policy,Tuning.DEFAULTby default. -
idleStrategy
What a call that blocks waits on between attempts: apublishthat spins through an election, up to 10 s, and the cluster connect instart. A yielding spin and Aeron's own connect wait by default. One that also does the caller's periodic work, such as writing a heartbeat, keeps it going while the call blocks. -
offCluster
Whether this node is a gateway host, running no member, rather than a member: the gate then opens whoever leads, and ingress is UDP alone. Run one instance, as nothing elects between two. Not with anipcConnectTimeoutMs, which has no IPC ingress to time. -
ipcConnectTimeoutMs
How long to wait for IPC ingress to the local member while it leads before using UDP, 500L ms by default. Not withoffCluster. -
build
-