seqeron 0.18.0
Loading...
Searching...
No Matches
Org.Limitless.Seqeron.Protocol.PortLayout Class Reference

The cluster port-layout formula: the C# mirror of PortLayout.java, PortLayout.hpp and ports.sh; change all four together. Cluster member ports only (doc/ops.md, "Ports"). More...

Static Public Member Functions

static string AeronDir (int nodeId)
 A node's Aeron directory when none is configured, which a member and every client sharing its driver must agree on: seqeron-seq-aeron-<nodeId> under /dev/shm where the host has one, so the driver's log buffers are in memory, else under the temp directory.
 
static bool IsClusterPort (int port)
 Whether a port falls inside core's reservation, for a product checking its own bases.
 
static int MemberPortBase (int memberId)
 First port of one member's stride; the five below sit at fixed offsets from it.
 
static int ArchivePort (int memberId)
 That member's Aeron Archive control port.
 
static int IngressPort (int memberId)
 That member's cluster-ingress port, where a producer submits over UDP.
 
static int ConsensusPort (int memberId)
 That member's consensus port, which the cluster's members use among themselves.
 
static int LogPort (int memberId)
 That member's log port, where it replicates the Raft log.
 
static int TransferPort (int memberId)
 That member's log-transfer port, used to catch a member up.
 
static string IngressEndpoint (int memberId)
 A member's cluster-ingress endpoint, "host:port".
 
static IReadOnlyList< string > ParseHosts (string csv)
 Parses a cluster's host list, "h0,h1,h2": member i runs on entry i.
 
static string IngressEndpoints (int nodeCount)
 The ingress endpoint set of a nodeCount -member cluster on DefaultHost, "0=host:9302,1=host:9312,…": the form AeronCluster and clusterctl take, and the mirror of ports.sh's ingress_endpoints_string.
 
static string IngressEndpoints (IReadOnlyList< string > hosts)
 The ingress endpoint set of a cluster whose member i runs on hosts[i].
 
static string IngressEndpoints ()
 The default endpoint set: the members Hosts names, else a DefaultMemberCount-member cluster on DefaultHost.
 

Static Public Attributes

const string DefaultHost = "localhost"
 Every default endpoint below is on one host; a real deployment overrides them wholesale.
 
const int DefaultMemberCount = 3
 Members of the default cluster on DefaultHost, what the default endpoint sets name.
 
const string EnvPortBase = "SEQERON_PORT_BASE"
 Deployment-wide port-base override, read by every mirror. Set it identically for every seqeron process: a disagreement shows as a connection that never completes, not as an error.
 
const string EnvHosts = "SEQERON_HOSTS"
 Deployment-wide host list, "h0,h1,h2": member i runs on entry i. It names the members wherever a default would otherwise say DefaultHost.
 
const int DefaultClusterPortBase = 9300
 The base when EnvPortBase is unset: core's registered block.
 
const int ClusterPortStride = 10
 Ports one member takes, so member m's block starts at base + m * stride.
 
const int ClusterMemberCount = 7
 Members a cluster is bounded at, since the reserved block is this many strides wide: Raft's 3, 5 or 7.
 
static readonly int ClusterPortBase
 The base this process runs on, EnvPortBase's value or DefaultClusterPortBase.
 
static readonly IReadOnlyList< string > Hosts = ResolveHosts(Environment.GetEnvironmentVariable(EnvHosts))
 The members' hosts from EnvHosts, empty when it is unset.
 
static readonly int ClusterPortBlockFirst = ClusterPortBase
 First port of core's reserved block (doc/ops.md, "Ports"): seven members wide, one stride each, wider than the base+1..base+65 seven members bind.
 
static readonly int ClusterPortBlockLast = ClusterPortBase + ClusterPortBlockWidth - 1
 Last port of core's reserved block.
 
const string ArchiveControlChannel = "aeron:ipc?alias=seqeron-archive"
 How a process reaches the archive in its own Aeron directory: no endpoint, so no port to allocate.
 
const int ArchiveControlStreamId = 100
 Control stream of that link. The archive's own local control and every archive client must name the same id, so it is stated here once rather than per process.
 

Detailed Description

The cluster port-layout formula: the C# mirror of PortLayout.java, PortLayout.hpp and ports.sh; change all four together. Cluster member ports only (doc/ops.md, "Ports").

Member Function Documentation

◆ AeronDir()

static string Org.Limitless.Seqeron.Protocol.PortLayout.AeronDir ( int  nodeId)
inlinestatic

A node's Aeron directory when none is configured, which a member and every client sharing its driver must agree on: seqeron-seq-aeron-<nodeId> under /dev/shm where the host has one, so the driver's log buffers are in memory, else under the temp directory.

Parameters
nodeIdA member's id, or a gateway host's node id.

◆ ArchivePort()

static int Org.Limitless.Seqeron.Protocol.PortLayout.ArchivePort ( int  memberId)
inlinestatic

That member's Aeron Archive control port.

Parameters
memberIdthe member

◆ ConsensusPort()

static int Org.Limitless.Seqeron.Protocol.PortLayout.ConsensusPort ( int  memberId)
inlinestatic

That member's consensus port, which the cluster's members use among themselves.

Parameters
memberIdthe member

◆ IngressEndpoint()

static string Org.Limitless.Seqeron.Protocol.PortLayout.IngressEndpoint ( int  memberId)
inlinestatic

A member's cluster-ingress endpoint, "host:port".

Parameters
memberIdthe member

◆ IngressEndpoints() [1/3]

static string Org.Limitless.Seqeron.Protocol.PortLayout.IngressEndpoints ( )
inlinestatic

The default endpoint set: the members Hosts names, else a DefaultMemberCount-member cluster on DefaultHost.

◆ IngressEndpoints() [2/3]

static string Org.Limitless.Seqeron.Protocol.PortLayout.IngressEndpoints ( int  nodeCount)
inlinestatic

The ingress endpoint set of a nodeCount -member cluster on DefaultHost, "0=host:9302,1=host:9312,…": the form AeronCluster and clusterctl take, and the mirror of ports.sh's ingress_endpoints_string.

Parameters
nodeCountmembers in the cluster

◆ IngressEndpoints() [3/3]

static string Org.Limitless.Seqeron.Protocol.PortLayout.IngressEndpoints ( IReadOnlyList< string >  hosts)
inlinestatic

The ingress endpoint set of a cluster whose member i runs on hosts[i].

Parameters
hoststhe members' host names, as ParseHosts returns them

◆ IngressPort()

static int Org.Limitless.Seqeron.Protocol.PortLayout.IngressPort ( int  memberId)
inlinestatic

That member's cluster-ingress port, where a producer submits over UDP.

Parameters
memberIdthe member

◆ IsClusterPort()

static bool Org.Limitless.Seqeron.Protocol.PortLayout.IsClusterPort ( int  port)
inlinestatic

Whether a port falls inside core's reservation, for a product checking its own bases.

Parameters
portthe port to check

◆ LogPort()

static int Org.Limitless.Seqeron.Protocol.PortLayout.LogPort ( int  memberId)
inlinestatic

That member's log port, where it replicates the Raft log.

Parameters
memberIdthe member

◆ MemberPortBase()

static int Org.Limitless.Seqeron.Protocol.PortLayout.MemberPortBase ( int  memberId)
inlinestatic

First port of one member's stride; the five below sit at fixed offsets from it.

Parameters
memberIdthe member

◆ ParseHosts()

static IReadOnlyList< string > Org.Limitless.Seqeron.Protocol.PortLayout.ParseHosts ( string  csv)
inlinestatic

Parses a cluster's host list, "h0,h1,h2": member i runs on entry i.

Parameters
csvthe members' host names, comma-separated
Returns
the host names, trimmed
Exceptions
ArgumentExceptionif an entry is blank, or the list names more than ClusterMemberCount members

◆ TransferPort()

static int Org.Limitless.Seqeron.Protocol.PortLayout.TransferPort ( int  memberId)
inlinestatic

That member's log-transfer port, used to catch a member up.

Parameters
memberIdthe member

Member Data Documentation

◆ ArchiveControlChannel

const string Org.Limitless.Seqeron.Protocol.PortLayout.ArchiveControlChannel = "aeron:ipc?alias=seqeron-archive"
static

How a process reaches the archive in its own Aeron directory: no endpoint, so no port to allocate.

◆ ArchiveControlStreamId

const int Org.Limitless.Seqeron.Protocol.PortLayout.ArchiveControlStreamId = 100
static

Control stream of that link. The archive's own local control and every archive client must name the same id, so it is stated here once rather than per process.

◆ ClusterMemberCount

const int Org.Limitless.Seqeron.Protocol.PortLayout.ClusterMemberCount = 7
static

Members a cluster is bounded at, since the reserved block is this many strides wide: Raft's 3, 5 or 7.

◆ ClusterPortBase

readonly int Org.Limitless.Seqeron.Protocol.PortLayout.ClusterPortBase
static
Initial value:
=
ResolveClusterPortBase(Environment.GetEnvironmentVariable(EnvPortBase))
const string EnvPortBase
Deployment-wide port-base override, read by every mirror. Set it identically for every seqeron proces...
Definition PortLayout.cs:27

The base this process runs on, EnvPortBase's value or DefaultClusterPortBase.

◆ ClusterPortBlockFirst

readonly int Org.Limitless.Seqeron.Protocol.PortLayout.ClusterPortBlockFirst = ClusterPortBase
static

First port of core's reserved block (doc/ops.md, "Ports"): seven members wide, one stride each, wider than the base+1..base+65 seven members bind.

◆ ClusterPortBlockLast

readonly int Org.Limitless.Seqeron.Protocol.PortLayout.ClusterPortBlockLast = ClusterPortBase + ClusterPortBlockWidth - 1
static

Last port of core's reserved block.

◆ ClusterPortStride

const int Org.Limitless.Seqeron.Protocol.PortLayout.ClusterPortStride = 10
static

Ports one member takes, so member m's block starts at base + m * stride.

◆ DefaultClusterPortBase

const int Org.Limitless.Seqeron.Protocol.PortLayout.DefaultClusterPortBase = 9300
static

The base when EnvPortBase is unset: core's registered block.

◆ DefaultHost

const string Org.Limitless.Seqeron.Protocol.PortLayout.DefaultHost = "localhost"
static

Every default endpoint below is on one host; a real deployment overrides them wholesale.

◆ DefaultMemberCount

const int Org.Limitless.Seqeron.Protocol.PortLayout.DefaultMemberCount = 3
static

Members of the default cluster on DefaultHost, what the default endpoint sets name.

◆ EnvHosts

const string Org.Limitless.Seqeron.Protocol.PortLayout.EnvHosts = "SEQERON_HOSTS"
static

Deployment-wide host list, "h0,h1,h2": member i runs on entry i. It names the members wherever a default would otherwise say DefaultHost.

◆ EnvPortBase

const string Org.Limitless.Seqeron.Protocol.PortLayout.EnvPortBase = "SEQERON_PORT_BASE"
static

Deployment-wide port-base override, read by every mirror. Set it identically for every seqeron process: a disagreement shows as a connection that never completes, not as an error.

◆ Hosts

readonly IReadOnlyList<string> Org.Limitless.Seqeron.Protocol.PortLayout.Hosts = ResolveHosts(Environment.GetEnvironmentVariable(EnvHosts))
static

The members' hosts from EnvHosts, empty when it is unset.


The documentation for this class was generated from the following file: