cockroach: Index | Files

package cluster

import ""


Package Files


func TelemetryOptOut Uses

func TelemetryOptOut() bool

TelemetryOptOut is a place for controlling whether to opt out of telemetry or not.

type CPUProfileType Uses

type CPUProfileType int32

CPUProfileType tracks whether a CPU profile is in progress.

const (
    // CPUProfileNone means that no CPU profile is currently taken.
    CPUProfileNone CPUProfileType = iota
    // CPUProfileDefault means that a CPU profile is currently taken, but
    // pprof labels are not enabled.
    // CPUProfileWithLabels means that a CPU profile is currently taken and
    // pprof labels are enabled.

type Settings Uses

type Settings struct {
    SV  settings.Values

    // Manual defaults to false. If set, lets this ClusterSetting's MakeUpdater
    // method return a dummy updater that simply throws away all values. This is
    // for use in tests for which manual control is desired.
    // Also see the Override() method that different types of settings provide for
    // overwriting the default of a single setting.
    Manual atomic.Value // bool

    Tracer        *tracing.Tracer
    ExternalIODir string

    // Version provides the interface through which which callers read/write to
    // the active cluster version, and access this binary's version details.
    // Setting the active cluster version has a very specific, intended usage
    // pattern. Look towards the interface itself for more commentary.
    Version clusterversion.Handle
    // contains filtered or unexported fields

Settings is the collection of cluster settings. For a running CockroachDB node, there is a single instance of Settings which is shared across various components.

var NoSettings *Settings // = nil

NoSettings is used when a func requires a Settings but none is available (for example, a CLI subcommand that does not connect to a cluster).

func MakeClusterSettings Uses

func MakeClusterSettings() *Settings

MakeClusterSettings returns a Settings object that has its binary and minimum supported versions set to this binary's build and it's minimum supported versions respectively. The cluster version setting is not initialized.

func MakeTestingClusterSettings Uses

func MakeTestingClusterSettings() *Settings

MakeTestingClusterSettings returns a Settings object that has its binary and minimum supported versions set to the baked in binary version. It also initializes the cluster version setting to the binary version.

It is typically used for testing or one-off situations in which a Settings object is needed, but cluster settings don't play a crucial role.

func MakeTestingClusterSettingsWithVersions Uses

func MakeTestingClusterSettingsWithVersions(
    binaryVersion, binaryMinSupportedVersion roachpb.Version, initializeVersion bool,
) *Settings

MakeTestingClusterSettingsWithVersions returns a Settings object that has its binary and minimum supported versions set to the provided versions. It also can also initialize the cluster version setting to the specified binaryVersion.

It is typically used in tests that want to override the default binary and minimum supported versions.

func (*Settings) CPUProfileType Uses

func (s *Settings) CPUProfileType() CPUProfileType

CPUProfileType returns the type of CPU profile being recorded, if any. This can be used by moving parts across the system to add profiler labels which are too expensive to be enabled at all times. If no profile is currently being recorded, returns CPUProfileNone.

func (*Settings) MakeUpdater Uses

func (s *Settings) MakeUpdater() settings.Updater

MakeUpdater returns a new Updater, pre-alloced to the registry size. Note that if the Setting has the Manual flag set, this Updater simply ignores all updates.

func (*Settings) SetCPUProfiling Uses

func (s *Settings) SetCPUProfiling(to CPUProfileType) error

SetCPUProfiling is called from the pprofui to inform the system that a CPU profile is being recorded. If an error is returned, a profile was already in progress and the caller must try again later.

Package cluster imports 9 packages (graph) and is imported by 609 packages. Updated 2020-12-31. Refresh now. Tools for package owners.