orchestrator

package
v0.0.0-...-0611383 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package orchestrator is responsible for instrumenting inbound xDS client requests to the correct aggregated key, forwarding a representative request to the upstream origin server, and managing the lifecycle of downstream and upstream connections and associates streams. It implements go-control-plane's Cache interface in order to receive xDS-based requests, send responses, and handle gRPC streams.

This file manages the bookkeeping of downstream clients by tracking inbound requests to their corresponding response channels. The contents of this file are intended to only be used within the orchestrator module and should not be exported.

Package orchestrator is responsible for instrumenting inbound xDS client requests to the correct aggregated key, forwarding a representative request to the upstream origin server, and managing the lifecycle of downstream and upstream connections and associates streams. It implements go-control-plane's Cache interface in order to receive xDS-based requests, send responses, and handle gRPC streams.

Package orchestrator is responsible for instrumenting inbound xDS client requests to the correct aggregated key, forwarding a representative request to the upstream origin server, and managing the lifecycle of downstream and upstream connections and associates streams. It implements go-control-plane's Cache interface in order to receive xDS-based requests, send responses, and handle gRPC streams.

This file manages the bookkeeping of upstream responses by tracking the aggregated key and its corresponding receiver channel for upstream responses. The contents of this file are intended to only be used within the orchestrator module and should not be exported.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Orchestrator

type Orchestrator interface {
	GetReadOnlyCache() cache.ReadOnlyCache

	GetDownstreamAggregatedKeys() (map[string]bool, error)

	ClearCacheEntries(keys []string) []error

	CreateWatch(transport.Request) (transport.Watch, func())
	// contains filtered or unexported methods
}

Orchestrator has the following responsibilities:

  1. Aggregates similar requests abiding by the aggregated keyer configurations.
  2. Maintains long lived streams with the upstream origin server for each representative discovery request.
  3. Maintains long lived streams with each downstream xDS client using go-control-plane's CreateWatch function.
  4. When new responses are available upstream, orchestrator relays and fans out the response back on the streams associated with the xDS clients.
  5. Updates the xds-relay cache with the latest state of the world.

Orchestrator will be using go-control-plane's gRPC server implementation to maintain the fanout to downstream clients. go-control-plane keeps an open connection with each downstream xDS client. When orchestrator receives an upstream response from the forwarded sample request (via a long lived channel), Orchestrator will cache the response, and fanout to the downstreams by supplying responses to the individual channels corresponding to each downstream connection (watcher). See the CreateWatch function for more details.

func New

func New(
	ctx context.Context,
	logger log.Logger,
	scope tally.Scope,
	mapper mapper.Mapper,
	upstreamClient upstream.Client,
	cacheConfig *bootstrapv1.Cache,
) Orchestrator

New instantiates the mapper, cache, upstream client components necessary for the orchestrator to operate and returns an instance of the instantiated orchestrator.

func NewMock

func NewMock(t *testing.T,
	mapper mapper.Mapper,
	upstreamClient upstream.Client,
	scope tally.Scope) Orchestrator

func NewMockOrchestrator

func NewMockOrchestrator(t *testing.T,
	mapper mapper.Mapper,
	upstreamClient upstream.Client,
	scope tally.Scope,
) Orchestrator

type V2

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

V2 cache wraps a shared cache

func NewV2

func NewV2(o Orchestrator) *V2

NewV2 creates a shared cache for v2 requests

func (*V2) CreateWatch

func (v *V2) CreateWatch(r *gcpv2.Request) (chan gcpv2.Response, func())

CreateWatch is the grpc backed xds handler

func (*V2) Fetch

Fetch implements the polling method of the config cache using a non-empty request.

type V3

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

V3 cache wraps a shared cache

func NewV3

func NewV3(o Orchestrator) *V3

NewV3 creates a shared cache for v2 requests

func (*V3) CreateWatch

func (v *V3) CreateWatch(r *gcpv3.Request) (chan gcpv3.Response, func())

CreateWatch is the grpc backed xds handler

func (*V3) Fetch

Fetch implements the polling method of the config cache using a non-empty request.

Jump to

Keyboard shortcuts

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