|
seqeron 0.18.0
|
Classes | |
| struct | FrameView |
| One frame off the queue, unwrapped: everything a consumer dispatches on, with the envelope stripped. More... | |
| struct | LifecycleEvent |
| A connection at a producer opening (ConnectionOpened) or closing (ConnectionClosed). More... | |
| struct | SequencedEvent |
| Carries one message from the cluster stream. More... | |
| struct | SnapshotGatewayRow |
| struct | SnapshotGatewayState |
| struct | SnapshotGroup |
| struct | SnapshotHeader |
| The header a façade writes ahead of the application's body: what it derives from frames before the round's cut. More... | |
Enumerations | |
| enum class | Publish { Published , Refused , Declined } |
Functions | |
| std::int64_t | addAppCounter (const std::shared_ptr< aeron::Aeron > &aeron, const std::int32_t typeId, const std::string &label, const std::int32_t memberId, const std::int32_t clientId) |
| Allocates an app counter keyed on {memberId, clientId}. | |
| constexpr std::int32_t | queueStreamId (const std::int32_t groupId) |
| Names the stream of a group's queue. | |
| constexpr std::int32_t | ingressBlockLength (const std::uint16_t systemEventType) |
| Looks up the compiled block length of a submittable system event: §9.2 conditions 8 and 9 in one lookup. | |
| void | readSystemHeader (FrameView &view, sbe::frame::SequencedSystemHeader &header) |
| Copies the identity every system message carries; the two composites are the same 44 bytes. | |
| FrameView | unwrapFrame (const char *const frame, const std::uint64_t length) |
| Reads one fragment into a FrameView, stripping the envelope. | |
| template<typename Decoder > | |
| Decoder | decodeSequenced (const char *payload, const std::uint64_t payloadLength, const std::uint16_t blockLength, const std::uint16_t version) |
| Wraps an application payload held as loose bytes in its decoder, past its own messageHeader. | |
| template<typename Decoder > | |
| Decoder | decodeSystem (const char *message, const std::uint64_t messageLength) |
| Wraps a system frame's message in its decoder. | |
| template<typename Decoder > | |
| Decoder | decodeSystem (const SequencedEvent &event) |
| Wraps a system event's message in its decoder; see decodeSystem(const char*, std::uint64_t). | |
| template<typename Decoder > | |
| Decoder | decodeSequenced (const SequencedEvent &event) |
| Wraps an application event's payload in its decoder. | |
| std::int64_t | frameStartPosition (const aeron::Header &header) |
| Computes the stream position of a frame's first byte; what SequencedEvent::position carries. | |
| template<typename Decoder > | |
| Decoder | decodeSystem (const LifecycleEvent &event) |
| Wraps a lifecycle event's message in its decoder: ConnectionOpened or ConnectionClosed. | |
| SequencedEvent | sequencedEventOf (const FrameView &view, const std::int64_t receiveTimeNs, const std::int64_t position) |
| Fills a SequencedEvent from an unwrapped frame, plus the two stamps that belong to the delivery rather than to the frame. | |
| LifecycleEvent | lifecycleEventOf (const FrameView &view, const std::int64_t receiveTimeNs) |
| Fills a LifecycleEvent from an unwrapped ConnectionOpened/ConnectionClosed. | |
| std::int64_t | nowNs () |
| std::uint32_t | crc32c (const std::uint8_t *data, const std::size_t length, const std::uint32_t crc=0) |
| Computes the CRC-32C of a span of bytes, as SnapshotEnd::crc32c carries it, or continues one: with the CPU's CRC-32C instruction where it has one, through a table where it does not. | |
Variables | |
| constexpr const char * | PROXY_DEFAULT_HOST_NAME = "hosted" |
| constexpr std::uint16_t | PROXY_PROTOCOL_VERSION = 2 |
| constexpr std::uint16_t | PROXY_SCHEMA_ID = 218 |
| constexpr std::int32_t | PROXY_ATTACH_REQUEST_STREAM = 301 |
| constexpr std::int32_t | PROXY_ATTACH_REPLY_STREAM = 302 |
| constexpr std::int32_t | PROXY_EVENTS_STREAM = 303 |
| constexpr std::int32_t | PROXY_COMMANDS_STREAM = 304 |
| constexpr std::int32_t | SEQUENCER_TYPE_ID_MIN = 5000 |
| constexpr std::int32_t | SEQUENCER_TYPE_ID_MAX = 5099 |
| constexpr std::int32_t | SEQUENCER_CLUSTER_SEQ_NO_TYPE_ID = 5000 |
| constexpr std::int32_t | SEQUENCER_QUEUE_BACKPRESSURE_ALERTS_TYPE_ID = 5001 |
| constexpr std::int32_t | SEQUENCER_REJECTED_INGRESS_COUNT_TYPE_ID = 5002 |
| constexpr std::int32_t | SEQUENCER_LEADERSHIP_CHANGE_COUNT_TYPE_ID = 5003 |
| constexpr std::int32_t | SEQUENCER_CURRENT_LEADER_MEMBER_ID_TYPE_ID = 5004 |
| constexpr std::int32_t | SEQUENCER_LAST_CLUSTER_HEARTBEAT_TIMESTAMP_TYPE_ID = 5005 |
| constexpr std::int32_t | SEQUENCER_GATEWAY_PROMOTION_COUNT_TYPE_ID = 5006 |
| constexpr std::int32_t | SEQUENCER_BOOTSTRAP_ACTIVATED_TYPE_ID = 5007 |
| constexpr std::int32_t | SEQUENCER_QUEUE_STALLED_TYPE_ID = 5008 |
| constexpr std::int32_t | SEQUENCER_INGRESS_MESSAGES_TYPE_ID = 5010 |
| constexpr std::int32_t | SEQUENCER_GATEWAY_PROMOTION_FAILED_COUNT_TYPE_ID = 5011 |
| constexpr std::int32_t | REPLAYER_TYPE_ID_MIN = 5100 |
| constexpr std::int32_t | REPLAYER_TYPE_ID_MAX = 5199 |
| constexpr std::int32_t | REPLAYER_READY_TYPE_ID = 5101 |
| constexpr std::int32_t | REPLAYER_ACTIVE_SLOTS_TYPE_ID = 5102 |
| constexpr std::int32_t | REPLAYER_PENDING_REQUESTS_TYPE_ID = 5103 |
| constexpr std::int32_t | REPLAYER_REPLAYS_SERVED_COUNT_TYPE_ID = 5104 |
| constexpr std::int32_t | REPLAYER_CONTROL_REPLIES_DROPPED_COUNT_TYPE_ID = 5107 |
| constexpr std::int32_t | REPLAYER_THROTTLED_REQUESTS_COUNT_TYPE_ID = 5110 |
| constexpr std::int32_t | REPLAYER_ARCHIVE_ERRORS_COUNT_TYPE_ID = 5111 |
| constexpr std::int32_t | APP_TYPE_ID_MIN = 5200 |
| constexpr std::int32_t | APP_TYPE_ID_MAX = 5299 |
| constexpr std::int32_t | APP_RECOVERY_STALLED_TYPE_ID = 5200 |
| constexpr std::int32_t | HOSTED_LAG_TYPE_ID = 5297 |
| constexpr std::int32_t | APP_SNAPSHOT_ROUND_TYPE_ID = 5298 |
| constexpr std::int32_t | GATEWAY_CONNECTIONS_TYPE_ID = 5299 |
| constexpr std::int32_t | PROXY_TYPE_ID_MIN = 5300 |
| constexpr std::int32_t | PROXY_TYPE_ID_MAX = 5399 |
| constexpr std::int32_t | PROXY_CLIENT_HEARTBEAT_TYPE_ID = 5300 |
| constexpr std::int32_t | PROXY_CLIENT_APPLIED_TYPE_ID = 5301 |
| constexpr std::int32_t | PROXY_HEARTBEAT_TYPE_ID = 5302 |
| constexpr std::int32_t | PROXY_RETIRED_TYPE_ID = 5303 |
| constexpr std::int32_t | MIN_TYPE_ID = SEQUENCER_TYPE_ID_MIN |
| constexpr std::int32_t | MAX_TYPE_ID = PROXY_TYPE_ID_MAX |
| constexpr std::size_t | KEY_MEMBER_ID_OFFSET = 0 |
| constexpr std::size_t | KEY_CLIENT_ID_OFFSET = 4 |
| constexpr std::size_t | KEY_LENGTH = 4 |
| constexpr std::size_t | APP_KEY_LENGTH = 8 |
| constexpr const char * | QUEUE_CHANNEL = "aeron:ipc?alias=seqeron-queue" |
| constexpr std::int32_t | MAX_GROUPS = 16 |
| constexpr std::int32_t | QUEUE_STREAM_ID_BASE = 2000 |
| constexpr std::int64_t | CLUSTER_HEARTBEAT_INTERVAL_MS = 1000 |
| constexpr std::int64_t | CLUSTER_HEARTBEAT_INTERVAL_NS = CLUSTER_HEARTBEAT_INTERVAL_MS * 1'000'000 |
| constexpr std::uint16_t | MAX_PAYLOAD_LENGTH = 8874 |
| constexpr std::uint16_t | MIN_INGRESS_LENGTH |
| constexpr std::uint16_t | MAX_INGRESS_LENGTH = MIN_INGRESS_LENGTH + MAX_PAYLOAD_LENGTH |
| constexpr std::uint16_t | CONNECTION_OPENED = sbe::frame::ConnectionOpened::sbeTemplateId() |
| constexpr std::uint16_t | CONNECTION_CLOSED = sbe::frame::ConnectionClosed::sbeTemplateId() |
| constexpr std::uint16_t | LEADERSHIP_CHANGED = 5 |
| constexpr std::uint16_t | CLUSTER_STARTED = sbe::frame::ClusterStarted::sbeTemplateId() |
| constexpr std::uint16_t | CLUSTER_STOPPED = sbe::frame::ClusterStopped::sbeTemplateId() |
| constexpr std::uint16_t | CLUSTER_HEARTBEAT = 16 |
| constexpr std::uint16_t | GATEWAY_REGISTERED = sbe::frame::GatewayRegistered::sbeTemplateId() |
| constexpr std::uint16_t | GATEWAY_ACTIVE = 18 |
| constexpr std::uint16_t | GATEWAY_STARTED = sbe::frame::GatewayStarted::sbeTemplateId() |
| constexpr std::uint16_t | PAYLOAD_ID_REGISTERED = sbe::frame::PayloadIdRegistered::sbeTemplateId() |
| constexpr std::uint16_t | GATEWAY_ACTIVATION_REQUESTED = sbe::frame::GatewayActivationRequested::sbeTemplateId() |
| constexpr std::uint16_t | APPLICATION_REGISTERED = sbe::frame::ApplicationRegistered::sbeTemplateId() |
| constexpr std::uint16_t | SNAPSHOT_REQUESTED = sbe::frame::SnapshotRequested::sbeTemplateId() |
| constexpr std::uint16_t | SNAPSHOT_END = sbe::frame::SnapshotEnd::sbeTemplateId() |
| constexpr std::uint16_t | SNAPSHOT_POLICY_REGISTERED = sbe::frame::SnapshotPolicyRegistered::sbeTemplateId() |
| constexpr std::uint16_t | SNAPSHOT_STARTED = 30 |
| constexpr std::uint16_t | SESSION_CLOSED = 31 |
| constexpr std::uint16_t | GROUPS_REGISTERED = sbe::frame::GroupsRegistered::sbeTemplateId() |
| constexpr std::int32_t | NOT_INGRESS_LEGAL = -1 |
| constexpr std::uint16_t | MAX_SNAPSHOT_RECORD_LENGTH = 65535 |
|
strong |
|
inline |
Allocates an app counter keyed on {memberId, clientId}.
| aeron | the client to allocate it on |
| typeId | the counter's type id (doc/ops.md, "Counter type ids") |
| label | the counter's label |
| memberId | the node the app runs on, the key's first half |
| clientId | the app's client id, the key's second half |
|
inline |
Computes the CRC-32C of a span of bytes, as SnapshotEnd::crc32c carries it, or continues one: with the CPU's CRC-32C instruction where it has one, through a table where it does not.
| data | the bytes |
| length | how many |
| crc | the CRC of the bytes before these, or 0 to start |
| Decoder org::limitless::seqeron::protocol::decodeSequenced | ( | const char * | payload, |
| const std::uint64_t | payloadLength, | ||
| const std::uint16_t | blockLength, | ||
| const std::uint16_t | version | ||
| ) |
Wraps an application payload held as loose bytes in its decoder, past its own messageHeader.
| Decoder | the payload's decoder, matched on (payloadId, templateId) |
| payload | the payload's first byte, its messageHeader included |
| payloadLength | the payload's length |
| blockLength | the block length the payload's messageHeader declares |
| version | the schema version the payload's messageHeader declares |
| Decoder org::limitless::seqeron::protocol::decodeSequenced | ( | const SequencedEvent & | event | ) |
Wraps an application event's payload in its decoder.
The decoder is valid only for the callback, like SequencedEvent::payload.
| Decoder | the decoder the caller matched the event's (payloadId, templateId) against |
| event | the event, valid only during its callback |
| Decoder org::limitless::seqeron::protocol::decodeSystem | ( | const char * | message, |
| const std::uint64_t | messageLength | ||
| ) |
Wraps a system frame's message in its decoder.
The message carries no framing, so block length and version come from this build's decoder (§7, V-3). Serves both a submitted payload and a synthesized template's inline block.
| Decoder | the decoder systemEventType names |
| message | the message's first byte |
| messageLength | the message's length |
| Decoder org::limitless::seqeron::protocol::decodeSystem | ( | const LifecycleEvent & | event | ) |
Wraps a lifecycle event's message in its decoder: ConnectionOpened or ConnectionClosed.
See decodeSystem(const char*, std::uint64_t).
| Decoder | the decoder the event's callback names |
| event | the event, valid only during its callback |
| Decoder org::limitless::seqeron::protocol::decodeSystem | ( | const SequencedEvent & | event | ) |
Wraps a system event's message in its decoder; see decodeSystem(const char*, std::uint64_t).
| Decoder | the decoder the event's systemEventType names |
| event | the event, valid only during its callback |
|
inline |
Computes the stream position of a frame's first byte; what SequencedEvent::position carries.
| header | the Aeron header of the frame's fragment |
|
constexpr |
Looks up the compiled block length of a submittable system event: §9.2 conditions 8 and 9 in one lookup.
The Java twin is SystemFrame.ingressBlockLength.
| systemEventType | the event to look up |
|
inline |
Fills a LifecycleEvent from an unwrapped ConnectionOpened/ConnectionClosed.
| view | the unwrapped frame |
| receiveTimeNs | when this process read it |
|
inline |
|
constexpr |
Names the stream of a group's queue.
| groupId | 1 to MAX_GROUPS |
|
inline |
Copies the identity every system message carries; the two composites are the same 44 bytes.
| [out] | view | the view to fill, marked as a system frame |
| header | the frame's system header, already wrapped |
|
inline |
Fills a SequencedEvent from an unwrapped frame, plus the two stamps that belong to the delivery rather than to the frame.
Both stream clients deliver the same event built from the same view, so the mapping is here rather than once per client.
| view | the unwrapped frame |
| receiveTimeNs | when this process read it |
| position | the stream position of its first byte |
|
inline |
Reads one fragment into a FrameView, stripping the envelope.
Bounds are checked because a short fragment would otherwise be read past its end. It should not happen — the sequencer validates every frame on ingress and the recording is what it wrote — so valid == false here means the recording itself is damaged, and the caller logs and drops.
| frame | the fragment's first byte |
| length | the fragment's length |
valid is false if the fragment is short or not a sequenced frame
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |