api

package
v0.0.0-...-58f80b1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 7 Imported by: 3 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// CurrentConfigurationAnnotation is the annotation we use to store the
	// latest configuration.
	CurrentConfigurationAnnotation = "foundationdb.org/launcher-current-configuration"

	// EnvironmentAnnotation is the annotation we use to store the environment
	// variables.
	EnvironmentAnnotation = "foundationdb.org/launcher-environment"

	// OutdatedConfigMapAnnotation is the annotation we read to get notified of
	// outdated configuration.
	OutdatedConfigMapAnnotation = "foundationdb.org/outdated-config-map-seen"

	// DelayShutdownAnnotation defines how long the FDB Kubernetes monitor process should sleep before shutting itself down.
	// The FDB Kubernetes monitor will always shutdown all fdbserver processes, independent of this setting.
	// The value of this annotation must be a duration like "60s".
	DelayShutdownAnnotation = "foundationdb.org/delay-shutdown"

	// ClusterFileChangeDetectedAnnotation is the annotation that will be updated if the fdb.cluster file is updated.
	ClusterFileChangeDetectedAnnotation = "foundationdb.org/cluster-file-change"

	// IsolateProcessGroupAnnotation is the annotation that defines if the current Pod should be isolated. Isolated
	// process groups will shutdown the fdbserver instance but keep the Pod and other Kubernetes resources running
	// for debugging purpose.
	IsolateProcessGroupAnnotation = "foundationdb.org/isolate-process-group"

	// RunningBinariesAnnotation is the annotation that reports the binary each fdbserver process of the Pod was started
	// from. The value is a JSON object that maps the process number to a RunningBinary. Processes that are not running
	// have no entry, so an empty object means that no fdbserver process is running. The annotation is absent if the
	// monitor doesn't report it.
	RunningBinariesAnnotation = "foundationdb.org/running-binaries"

	// StagedVersionsKey is the key in the environment annotation that lists the versions with a ready fdbserver
	// binary in the shared binary directory as a sorted, comma separated list.
	StagedVersionsKey = "STAGED_VERSIONS"
)
View Source
const (
	// LiteralArgumentType defines an argument with a literal string value.
	LiteralArgumentType ArgumentType = "Literal"

	// ConcatenateArgumentType defines an argument composed of other arguments.
	ConcatenateArgumentType = "Concatenate"

	// EnvironmentArgumentType defines an argument that is pulled from an
	// environment variable.
	EnvironmentArgumentType = "Environment"

	// ProcessNumberArgumentType defines an argument that is calculated using
	// the number of the process in the process list.
	ProcessNumberArgumentType = "ProcessNumber"

	// IPListArgumentType defines an argument that is a comma-separated list of
	// IP addresses, provided through an environment variable.
	IPListArgumentType = "IPList"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	// ArgumentType determines how the value is generated.
	ArgumentType ArgumentType `json:"type,omitempty"`

	// Value provides the value for a Literal type argument.
	Value string `json:"value,omitempty"`

	// Values provides the sub-values for a Concatenate type argument.
	Values []Argument `json:"values,omitempty"`

	// Source provides the name of the environment variable to use for an
	// Environment type argument.
	Source string `json:"source,omitempty"`

	// Multiplier provides a multiplier for the process number for ProcessNumber
	// type arguments.
	Multiplier int `json:"multiplier,omitempty"`

	// Offset provides an offset to add to the process number for ProcessNumber
	// type arguments.
	Offset int `json:"offset,omitempty"`

	// IPFamily provides the family to use for IPList type arguments.
	IPFamily int `json:"ipFamily,omitempty"`
}

Argument defines an argument to the process.

func (Argument) GenerateArgument

func (argument Argument) GenerateArgument(processNumber int, env map[string]string) (string, error)

GenerateArgument processes an argument and generates its string representation.

func (Argument) LookupEnv

func (argument Argument) LookupEnv(env map[string]string) (string, error)

LookupEnv looks up the value for an argument from the environment.

type ArgumentType

type ArgumentType string

ArgumentType defines the types for arguments.

type ProcessConfiguration

type ProcessConfiguration struct {
	// Version provides the version of FoundationDB the process should run.
	Version *Version `json:"version"`

	// RunServers defines whether we should run the server processes.
	// This defaults to true, but you can set it to false to prevent starting
	// new fdbserver processes.
	RunServers *bool `json:"runServers,omitempty"`

	// UseSharedBinary defines whether the monitor must always launch the binary that was staged in the shared binary
	// directory by the sidecar, even if the version is protocol compatible with the version of the main container.
	// This defaults to false, in which case the binary of the main container is used for protocol compatible versions.
	UseSharedBinary *bool `json:"useSharedBinary,omitempty"`

	// BinaryPath provides the path to the binary to launch.
	BinaryPath string `json:"-"`

	// Arguments provides the arguments to the process.
	Arguments []Argument `json:"arguments,omitempty"`
}

ProcessConfiguration models the configuration for starting a FoundationDB process.

func (*ProcessConfiguration) GenerateArguments

func (configuration *ProcessConfiguration) GenerateArguments(processNumber int, env map[string]string) ([]string, error)

GenerateArguments interprets the arguments in the process configuration and generates a command invocation.

func (*ProcessConfiguration) ShouldRunServers

func (configuration *ProcessConfiguration) ShouldRunServers() bool

ShouldRunServers returns true if RunServers is unset or set to true.

func (*ProcessConfiguration) ShouldUseSharedBinary

func (configuration *ProcessConfiguration) ShouldUseSharedBinary() bool

ShouldUseSharedBinary returns true if UseSharedBinary is set to true.

type RunningBinary

type RunningBinary struct {
	// Version is the version of the configuration the process was started from.
	Version string `json:"version"`
	// BinaryPath is the path of the fdbserver binary the process was started from.
	BinaryPath string `json:"binaryPath"`
	// StartTimestamp is the unix timestamp in seconds when the process was started. It changes whenever the process
	// is restarted, even if the binary stays the same.
	StartTimestamp int64 `json:"startTimestamp"`
}

RunningBinary describes the binary a running fdbserver process was started from. It reflects the process as it was started, so it differs from the desired configuration until the process was restarted.

type Version

type Version struct {
	// Major is the major version
	Major int

	// Minor is the minor version
	Minor int

	// Patch is the patch version
	Patch int

	// ReleaseCandidate is the number from the `-rc\d+` suffix version
	// of the version if it exists
	ReleaseCandidate int
}

Version represents a version of FoundationDB.

This provides convenience methods for checking features available in different versions.

func ParseFdbVersion

func ParseFdbVersion(version string) (Version, error)

ParseFdbVersion parses a version from its string representation.

func (Version) Compact

func (version Version) Compact() string

Compact prints the version in the major.minor format.

func (Version) Equal

func (version Version) Equal(other Version) bool

Equal checks if two Version are the same.

func (Version) GetBinaryVersion

func (version Version) GetBinaryVersion() string

GetBinaryVersion Returns a version string compatible with the log implemented in the sidecars

func (Version) IsAtLeast

func (version Version) IsAtLeast(other Version) bool

IsAtLeast determines if a version is greater than or equal to another version.

func (Version) IsProtocolCompatible

func (version Version) IsProtocolCompatible(other Version) bool

IsProtocolCompatible determines whether two versions of FDB are protocol compatible.

func (*Version) MarshalJSON

func (version *Version) MarshalJSON() ([]byte, error)

MarshalJSON custom implementation of MarshalJSON

func (Version) NextMajorVersion

func (version Version) NextMajorVersion() Version

NextMajorVersion returns the next major version of FoundationDB.

func (Version) NextMinorVersion

func (version Version) NextMinorVersion() Version

NextMinorVersion returns the next minor version of FoundationDB.

func (Version) NextPatchVersion

func (version Version) NextPatchVersion() Version

NextPatchVersion returns the next patch version of FoundationDB.

func (Version) String

func (version Version) String() string

String gets the string representation of an FDB version.

func (*Version) UnmarshalJSON

func (version *Version) UnmarshalJSON(data []byte) error

UnmarshalJSON custom implementation of UnmarshalJSON

Jump to

Keyboard shortcuts

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