types

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RouterUnMarshalErrorCode = 599
	RouterTimedOutStatusCode = 1113
)

Variables

View Source
var (
	// ErrContextCancelled is returned when the context is cancelled
	ErrContextCancelled = errors.New("context cancelled")
	// ErrParamsUnmarshal is returned when it is not possible to unmarshal the job parameters
	ErrParamsUnmarshal = errors.New("unmarhall params")
	// ErrJobOrderBlocked is returned when the job is blocked by another job discarded by the router in the same loop
	ErrJobOrderBlocked = errors.New("blocked")
	// ErrWorkerNoSlot is returned when the worker doesn't have an available slot
	ErrWorkerNoSlot = errors.New("no slot")
	// ErrJobBackoff is returned when the job is backoffed
	ErrJobBackoff = errors.New("backoff")
	// ErrDestinationThrottled is returned when the destination is being throttled
	ErrDestinationThrottled = errors.New("throttled")
	// ErrBarrierExists is returned when a job ordering barrier exists for the job's ordering key
	ErrBarrierExists = errors.New("barrier")
)

Functions

This section is empty.

Types

type DestinationJobT

type DestinationJobT struct {
	Message          json.RawMessage            `json:"batchedRequest"`
	JobMetadataArray []JobMetadataT             `json:"metadata"` // multiple jobs may be batched in a single message
	Destination      backendconfig.DestinationT `json:"destination"`
	Batched          bool                       `json:"batched"`
	StatusCode       int                        `json:"statusCode"`
	Error            string                     `json:"error"`
}

DestinationJobT holds the job to be sent to destination and metadata of all the router jobs from which this job is cooked up

func (*DestinationJobT) JobIDs added in v1.0.2

func (dj *DestinationJobT) JobIDs() map[int64]struct{}

JobIDs returns the set of all job ids contained in the message

func (*DestinationJobT) MinJobID added in v1.6.0

func (dj *DestinationJobT) MinJobID() int64

type DestinationJobs added in v1.8.0

type DestinationJobs []DestinationJobT

func (DestinationJobs) Hydrate added in v1.8.0

func (djs DestinationJobs) Hydrate(jobs map[int64]*jobsdb.JobT)

Hydrate jobs in the destination jobs' job metadata array

type EventTypeThrottlingCost added in v1.5.0

type EventTypeThrottlingCost map[string]interface{}

func NewEventTypeThrottlingCost added in v1.5.0

func NewEventTypeThrottlingCost(m map[string]interface{}) (v EventTypeThrottlingCost)

func (*EventTypeThrottlingCost) Cost added in v1.5.0

func (e *EventTypeThrottlingCost) Cost(eventType string) (cost int64)

type JobMetadataT

type JobMetadataT struct {
	UserID             string          `json:"userId"`
	JobID              int64           `json:"jobId"`
	SourceID           string          `json:"sourceId"`
	DestinationID      string          `json:"destinationId"`
	AttemptNum         int             `json:"attemptNum"`
	ReceivedAt         string          `json:"receivedAt"`
	CreatedAt          string          `json:"createdAt"`
	FirstAttemptedAt   string          `json:"firstAttemptedAt"`
	TransformAt        string          `json:"transformAt"`
	WorkspaceID        string          `json:"workspaceId"`
	Secret             json.RawMessage `json:"secret"`
	JobT               *jobsdb.JobT    `json:"jobsT,omitempty"`
	WorkerAssignedTime time.Time       `json:"workerAssignedTime"`
	DestInfo           json.RawMessage `json:"destInfo,omitempty"`
}

JobMetadataT holds the job metadata

type RouterJobT

type RouterJobT struct {
	Message     json.RawMessage            `json:"message"`
	JobMetadata JobMetadataT               `json:"metadata"`
	Destination backendconfig.DestinationT `json:"destination"`
}

RouterJobT holds the router job and its related metadata

type TransformMessageT

type TransformMessageT struct {
	Data     []RouterJobT `json:"input"`
	DestType string       `json:"destType"`
}

TransformMessageT is used to pass message to the transformer workers

func (*TransformMessageT) Dehydrate added in v1.8.0

func (tm *TransformMessageT) Dehydrate() (*TransformMessageT, map[int64]*jobsdb.JobT)

Dehydrate JobT information from RouterJobT.JobMetadata returning the dehydrated message along with the jobs

func (*TransformMessageT) JobIDs added in v1.0.2

func (tm *TransformMessageT) JobIDs() map[int64]struct{}

JobIDs returns the set of all job ids of the jobs in the message

Jump to

Keyboard shortcuts

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