mode

package
v0.44.2 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComponentMode added in v0.41.0

type ComponentMode uint32

ComponentMode represents basic operation modes for shared components, including READ, READ_WRITE, and DISABLED.

const (
	// ComponentReadWrite is a Mode value for component that is available
	// for read and write operations. Default component mode.
	ComponentReadWrite ComponentMode = 0

	// ComponentReadOnly is a Mode value for component that does not
	// accept write operation but is readable.
	ComponentReadOnly ComponentMode = 0b001

	// ComponentDisabled mode is a mode where a component is disabled.
	ComponentDisabled ComponentMode = math.MaxUint32
)

func ConvertToComponentMode added in v0.41.0

func ConvertToComponentMode(m Mode) ComponentMode

ConvertToComponentMode converts a ShardMode to a corresponding ComponentMode. Ignores the degraded mode of the node. Used in Blobstore.

func ConvertToComponentModeDegraded added in v0.41.0

func ConvertToComponentModeDegraded(m Mode) ComponentMode

ConvertToComponentModeDegraded converts a ShardMode to a corresponding ComponentMode. Disables the component if the node is in degraded mode. Used in Metabase, Writecache, Pilorama.

func (ComponentMode) Disabled added in v0.41.0

func (m ComponentMode) Disabled() bool

func (ComponentMode) ReadOnly added in v0.41.0

func (m ComponentMode) ReadOnly() bool

ReadOnly returns true iff m prohibits modifying operations with shard.

func (ComponentMode) String added in v0.41.0

func (m ComponentMode) String() string

type Mode

type Mode uint32

Mode represents enumeration of Shard work modes.

const (
	// ReadWrite is a Mode value for shard that is available
	// for read and write operations. Default shard mode.
	ReadWrite Mode = 0b000

	// ReadOnly is a Mode value for shard that does not
	// accept write operation but is readable.
	ReadOnly Mode = 0b001

	// Degraded is a Mode value for shard when the metabase is unavailable.
	// It is hard to perform some modifying operations in this mode, thus it can only be set by an administrator.
	Degraded Mode = 0b010

	// Disabled mode is a mode where a shard is disabled.
	// An existing shard can't have this mode, but it can be used in
	// the configuration or control service commands.
	Disabled Mode = math.MaxUint32

	// DegradedReadOnly is a Mode value for shard that is set automatically
	// after a certain number of errors is encountered. It is the same as
	// `mode.Degraded` but also is read-only.
	DegradedReadOnly Mode = Degraded | ReadOnly
)

func (Mode) Disabled

func (m Mode) Disabled() bool

func (Mode) NoMetabase

func (m Mode) NoMetabase() bool

NoMetabase returns true iff m is operating without the metabase.

func (Mode) ReadOnly

func (m Mode) ReadOnly() bool

ReadOnly returns true iff m prohibits modifying operations with shard.

func (Mode) String

func (m Mode) String() string

Jump to

Keyboard shortcuts

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