dbconfig

package
v0.1.0-alpha.24 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	AccessKeyIDSecretKey     = "access-key-id"
	SecretAccessKeySecretKey = "secret-access-key"
)
View Source
const (
	TOMLMappingFieldTag = "tomlmapping"
)

Variables

This section is empty.

Functions

func FromCluster

func FromCluster(cluster *v1alpha1.GreptimeDBCluster, componentKind v1alpha1.ComponentKind) ([]byte, error)

FromCluster creates config data from the cluster CRD.

func FromStandalone

func FromStandalone(standalone *v1alpha1.GreptimeDBStandalone) ([]byte, error)

FromStandalone creates config data from the standalone CRD.

func Marshal

func Marshal(config Config) ([]byte, error)

Marshal marshals the input config to toml.

Types

type Config

type Config interface {
	// Kind returns the component kind of the config.
	Kind() v1alpha1.ComponentKind

	// ConfigureByCluster configures the config by the given cluster.
	ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error

	// ConfigureByStandalone configures the config by the given standalone.
	ConfigureByStandalone(standalone *v1alpha1.GreptimeDBStandalone) error

	// GetInputConfig returns the input config.
	GetInputConfig() string

	// SetInputConfig sets the input config.
	SetInputConfig(input string) error
}

Config is the interface for the config of greptimedb.

func NewFromComponentKind

func NewFromComponentKind(kind v1alpha1.ComponentKind) (Config, error)

NewFromComponentKind creates config from the component kind.

type DatanodeConfig

type DatanodeConfig struct {
	NodeID      *uint64 `tomlmapping:"node_id"`
	RPCAddr     *string `tomlmapping:"rpc_addr"`
	RPCHostName *string `tomlmapping:"rpc_hostname"`

	// Storage options.
	StorageType            *string `tomlmapping:"storage.type"`
	StorageDataHome        *string `tomlmapping:"storage.data_home"`
	StorageAccessKeyID     *string `tomlmapping:"storage.access_key_id"`
	StorageSecretAccessKey *string `tomlmapping:"storage.secret_access_key"`
	StorageAccessKeySecret *string `tomlmapping:"storage.access_key_secret"`
	StorageBucket          *string `tomlmapping:"storage.bucket"`
	StorageRoot            *string `tomlmapping:"storage.root"`
	StorageRegion          *string `tomlmapping:"storage.region"`
	StorageEndpoint        *string `tomlmapping:"storage.endpoint"`

	// The wal file directory.
	WalDir *string `tomlmapping:"wal.dir"`

	// The wal provider.
	WalProvider *string `tomlmapping:"wal.provider"`

	// The kafka broker endpoints.
	WalBrokerEndpoints []string `tomlmapping:"wal.broker_endpoints"`

	// InputConfig is from config field of cluster spec.
	InputConfig string
}

DatanodeConfig is the configuration for the datanode.

func (*DatanodeConfig) ConfigureByCluster

func (c *DatanodeConfig) ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error

ConfigureByCluster configures the datanode config by the given cluster.

func (*DatanodeConfig) ConfigureByStandalone

func (c *DatanodeConfig) ConfigureByStandalone(_ *v1alpha1.GreptimeDBStandalone) error

ConfigureByStandalone is not need to implement in cluster mode.

func (*DatanodeConfig) GetInputConfig

func (c *DatanodeConfig) GetInputConfig() string

GetInputConfig returns the input config.

func (*DatanodeConfig) Kind

Kind returns the component kind of the datanode.

func (*DatanodeConfig) SetInputConfig

func (c *DatanodeConfig) SetInputConfig(input string) error

SetInputConfig sets the input config.

type FrontendConfig

type FrontendConfig struct {
	// InputConfig is from config field of cluster spec.
	InputConfig string
}

FrontendConfig is the configuration for the frontend.

func (*FrontendConfig) ConfigureByCluster

func (c *FrontendConfig) ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error

ConfigureByCluster configures the frontend configuration by the given cluster.

func (*FrontendConfig) ConfigureByStandalone

func (c *FrontendConfig) ConfigureByStandalone(_ *v1alpha1.GreptimeDBStandalone) error

ConfigureByStandalone is not need to implement in cluster mode.

func (*FrontendConfig) GetInputConfig

func (c *FrontendConfig) GetInputConfig() string

GetInputConfig returns the input config of the frontend.

func (*FrontendConfig) Kind

Kind returns the component kind of the frontend.

func (*FrontendConfig) SetInputConfig

func (c *FrontendConfig) SetInputConfig(inputConfig string) error

SetInputConfig sets the input config of the frontend.

type MetasrvConfig

type MetasrvConfig struct {
	// Enable region failover.
	EnableRegionFailover *bool `tomlmapping:"enable_region_failover"`

	// If it's not empty, the metasrv will store all data with this key prefix.
	StoreKeyPrefix *string `tomlmapping:"store_key_prefix"`

	// The wal provider.
	WalProvider *string `tomlmapping:"wal.provider"`

	// The kafka broker endpoints.
	WalBrokerEndpoints []string `tomlmapping:"wal.broker_endpoints"`

	// InputConfig is from config field of cluster spec.
	InputConfig string
}

MetasrvConfig is the configuration for the metasrv.

func (*MetasrvConfig) ConfigureByCluster

func (c *MetasrvConfig) ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error

ConfigureByCluster configures the metasrv config by the given cluster.

func (*MetasrvConfig) ConfigureByStandalone

func (c *MetasrvConfig) ConfigureByStandalone(_ *v1alpha1.GreptimeDBStandalone) error

ConfigureByStandalone is not need to implement in cluster mode.

func (*MetasrvConfig) GetInputConfig

func (c *MetasrvConfig) GetInputConfig() string

GetInputConfig returns the input config of the metasrv.

func (*MetasrvConfig) Kind

Kind returns the component kind of the metasrv.

func (*MetasrvConfig) SetInputConfig

func (c *MetasrvConfig) SetInputConfig(inputConfig string) error

SetInputConfig sets the input config of the metasrv.

type StandaloneConfig

type StandaloneConfig struct {
	// Storage options.
	StorageType            *string `tomlmapping:"storage.type"`
	StorageDataHome        *string `tomlmapping:"storage.data_home"`
	StorageAccessKeyID     *string `tomlmapping:"storage.access_key_id"`
	StorageSecretAccessKey *string `tomlmapping:"storage.secret_access_key"`
	StorageAccessKeySecret *string `tomlmapping:"storage.access_key_secret"`
	StorageBucket          *string `tomlmapping:"storage.bucket"`
	StorageRoot            *string `tomlmapping:"storage.root"`
	StorageRegion          *string `tomlmapping:"storage.region"`
	StorageEndpoint        *string `tomlmapping:"storage.endpoint"`

	WalDir *string `tomlmapping:"wal.dir"`

	// InputConfig is from config field of cluster spec.
	InputConfig string
}

StandaloneConfig is the configuration for the frontend.

func (*StandaloneConfig) ConfigureByCluster

func (c *StandaloneConfig) ConfigureByCluster(cluster *v1alpha1.GreptimeDBCluster) error

ConfigureByCluster is not need to implement in standalone mode.

func (*StandaloneConfig) ConfigureByStandalone

func (c *StandaloneConfig) ConfigureByStandalone(standalone *v1alpha1.GreptimeDBStandalone) error

ConfigureByStandalone is not need to implement in cluster mode.

func (*StandaloneConfig) GetInputConfig

func (c *StandaloneConfig) GetInputConfig() string

GetInputConfig returns the input config of the standalone.

func (*StandaloneConfig) Kind

Kind returns the component kind of the standalone.

func (*StandaloneConfig) SetInputConfig

func (c *StandaloneConfig) SetInputConfig(inputConfig string) error

SetInputConfig sets the input config of the standalone.

Jump to

Keyboard shortcuts

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