model

package
v0.3.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidExternalSeqNo

func IsValidExternalSeqNo(str string) bool

IsValidExternalSeqNo Returns true if the given string is a valid ExternalSeqNo

Types

type EventRequest

type EventRequest struct {
	SubscriptionId int64 // The subscriber who originated the request
	Jobset         int64 // The id of the jobset they want events for
	Sequence       int64 // Only return  events after this sequence number
}

EventRequest represents a request for new Event rows form the database

type EventResponse

type EventResponse struct {
	SubscriptionId int64       // The subscriber who originated the request
	Events         []*EventRow // Returned Events
}

EventResponse represents a response to the EventRequest

type EventRow

type EventRow struct {
	JobSetId int64
	SeqNo    int64
	Event    []byte
}

EventRow represents an Event in the Postgres Database

type EventSubscription

type EventSubscription struct {
	SubscriptionId int64
	Channel        chan []*EventRow
}

EventSubscription represents a single subscription to a stream of events

type ExternalSeqNo

type ExternalSeqNo struct {
	Sequence int64
	Index    int
}

ExternalSeqNo is a sequence number that we pass to end users Sequence is the puslar message sequence Index is the index of the event inside the armadaevents.EventSequence

func ParseExternalSeqNo

func ParseExternalSeqNo(str string) (*ExternalSeqNo, error)

ParseExternalSeqNo Parses an external sequence number which should be of the form "Sequence:Index". The empty string will be interpreted as "-1:-1" whoch is the initial sequence numebr An error will be returned if the sequence number cannot be parsed

func (*ExternalSeqNo) IsAfter

func (e *ExternalSeqNo) IsAfter(other *ExternalSeqNo) bool

func (*ExternalSeqNo) ToString

func (e *ExternalSeqNo) ToString() string

type JobsetRow

type JobsetRow struct {
	JobSetId int64
	Queue    string
	Jobset   string
	Created  time.Time
}

JobsetRow represents a Jobset in the Postgres Database Essentially this is a mapping from (jobsetName, queue) -> int64 which means We can store int64s rather than long strings

type PulsarEventRow

type PulsarEventRow struct {
	MessageId *pulsarutils.ConsumerMessageId
	Event     *EventRow
}

PulsarEventRow represents an Event Row along with information about the originating pulsar message

type SeqNoRow

type SeqNoRow struct {
	JobSetId   int64
	SeqNo      int64
	UpdateTime time.Time
}

SeqNoRow represents a Sequence Number in the Postgres Database This enables us to keep track of the latest available event for each jobset

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL