forwarder

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultXgressCloseCheckInterval    = 5 * time.Second
	DefaultXgressDialDwellTime         = 0
	DefaultFaultTxInterval             = 15 * time.Second
	DefaultIdleTxInterval              = 60 * time.Second
	DefaultIdleCircuitTimeout          = 60 * time.Second
	DefaultXgressDialWorkerQueueLength = 1000
	MinXgressDialWorkerQueueLength     = 1
	MaxXgressDialWorkerQueueLength     = 10000
	DefaultXgressDialWorkerCount       = 128
	MinXgressDialWorkerCount           = 1
	MaxXgressDialWorkerCount           = 10000

	DefaultLinkDialQueueLength   = 1000
	MinLinkDialWorkerQueueLength = 1
	MaxLinkDialWorkerQueueLength = 10000
	DefaultLinkDialWorkerCount   = 32
	MinLinkDialWorkerCount       = 1
	MaxLinkDialWorkerCount       = 10000

	DefaultRateLimiterQueueLength   = 5000
	MinRateLimiterWorkerQueueLength = 1
	MaxRateLimiterWorkerQueueLength = 50000
	DefaultRateLimiterWorkerCount   = 15
	MinRateLimiterWorkerCount       = 1
	MaxRateLimiterWorkerCount       = 10000

	DefaultUnresponsiveLinkTimeout = time.Minute
	MinUnresponsiveLinkTimeout     = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Destination

type Destination interface {
	SendPayload(payload *xgress.Payload) error
	SendAcknowledgement(acknowledgement *xgress.Acknowledgement) error
	SendControl(control *xgress.Control) error
	InspectCircuit(detail *inspect.CircuitInspectDetail)
}

type FaultReceiver added in v0.31.4

type FaultReceiver interface {
	Report(circuitId string, ctrlId string)
	NotifyInvalidLink(linkId string)
}

type Faulter

type Faulter struct {
	// contains filtered or unexported fields
}

func NewFaulter

func NewFaulter(ctrls env.NetworkControllers, interval time.Duration, closeNotify chan struct{}) *Faulter
func (self *Faulter) NotifyInvalidLink(linkId string)

func (*Faulter) Report added in v0.31.4

func (self *Faulter) Report(circuitId string, ctrlId string)

type Forwarder

type Forwarder struct {
	Options     *Options
	CloseNotify <-chan struct{}
	// contains filtered or unexported fields
}

func NewForwarder

func NewForwarder(metricsRegistry metrics.UsageRegistry, faulter FaultReceiver, options *Options, closeNotify <-chan struct{}) *Forwarder

func (*Forwarder) Debug

func (forwarder *Forwarder) Debug() string

func (*Forwarder) EndCircuit

func (forwarder *Forwarder) EndCircuit(circuitId string)

func (*Forwarder) ForwardAcknowledgement

func (forwarder *Forwarder) ForwardAcknowledgement(srcAddr xgress.Address, acknowledgement *xgress.Acknowledgement) error

func (*Forwarder) ForwardControl

func (forwarder *Forwarder) ForwardControl(srcAddr xgress.Address, control *xgress.Control) error

func (*Forwarder) ForwardPayload

func (forwarder *Forwarder) ForwardPayload(srcAddr xgress.Address, payload *xgress.Payload) error

func (*Forwarder) HasDestination

func (forwarder *Forwarder) HasDestination(address xgress.Address) bool

func (*Forwarder) InspectCircuit

func (forwarder *Forwarder) InspectCircuit(circuitId string, getRelatedGoroutines bool) *inspect.CircuitInspectDetail

func (*Forwarder) MetricsRegistry

func (forwarder *Forwarder) MetricsRegistry() metrics.UsageRegistry

func (*Forwarder) RegisterDestination

func (forwarder *Forwarder) RegisterDestination(circuitId string, address xgress.Address, destination Destination)
func (forwarder *Forwarder) RegisterLink(link xlink.LinkDestination) error

func (*Forwarder) ReportForwardingFault

func (forwarder *Forwarder) ReportForwardingFault(circuitId string, ctrlId string)

func (*Forwarder) RetransmitPayload

func (forwarder *Forwarder) RetransmitPayload(srcAddr xgress.Address, payload *xgress.Payload) error

func (*Forwarder) Route

func (forwarder *Forwarder) Route(ctrlId string, route *ctrl_pb.Route) error

func (*Forwarder) StartScanner added in v0.31.4

func (forwarder *Forwarder) StartScanner(ctrls env.NetworkControllers)

func (*Forwarder) TraceController

func (forwarder *Forwarder) TraceController() trace.Controller

func (*Forwarder) UnregisterDestinations

func (forwarder *Forwarder) UnregisterDestinations(circuitId string)
func (forwarder *Forwarder) UnregisterLink(link xlink.LinkDestination)

func (*Forwarder) Unroute

func (forwarder *Forwarder) Unroute(circuitId string, now bool)

type Options

type Options struct {
	FaultTxInterval          time.Duration
	IdleCircuitTimeout       time.Duration
	IdleTxInterval           time.Duration
	LinkDial                 WorkerPoolOptions
	RateLimiter              WorkerPoolOptions
	UnresponsiveLinkTimeout  time.Duration
	XgressCloseCheckInterval time.Duration
	XgressDial               WorkerPoolOptions
	XgressDialDwellTime      time.Duration
}

func DefaultOptions

func DefaultOptions() *Options

func LoadOptions

func LoadOptions(src map[interface{}]interface{}) (*Options, error)

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

type WorkerPoolOptions

type WorkerPoolOptions struct {
	QueueLength uint16
	WorkerCount uint16
}

type XgressDestination

type XgressDestination interface {
	Destination
	Unrouted()
	Start()
	IsTerminator() bool
	Label() string
	GetTimeOfLastRxFromLink() int64
}

Jump to

Keyboard shortcuts

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