paramtable

package
v0.0.2-0...-90de37e Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: Apache-2.0 Imports: 31 Imported by: 29

Documentation

Index

Constants

View Source
const (
	FloatVectorDefaultMetricType       = metric.COSINE
	SparseFloatVectorDefaultMetricType = metric.IP
	BinaryVectorDefaultMetricType      = metric.HAMMING
)
View Source
const (
	DefaultGlogConf             = "glog.conf"
	DefaultMinioHost            = "localhost"
	DefaultMinioPort            = "9000"
	DefaultMinioAccessKey       = "minioadmin"
	DefaultMinioSecretAccessKey = "minioadmin"
	DefaultMinioUseSSL          = "false"
	DefaultMinioBucketName      = "a-bucket"
	DefaultMinioUseIAM          = "false"
	DefaultMinioCloudProvider   = "aws"
	DefaultMinioIAMEndpoint     = ""
	DefaultEtcdEndpoints        = "localhost:2379"

	DefaultLogFormat                                     = "text"
	DefaultLogLevelForBase                               = "debug"
	DefaultRootPath                                      = ""
	DefaultMinioLogLevel                                 = "fatal"
	DefaultKnowhereThreadPoolNumRatioInBuild             = 1
	DefaultKnowhereThreadPoolNumRatioInBuildOfStandalone = 0.75
	DefaultMinioRegion                                   = ""
	DefaultMinioUseVirtualHost                           = "false"
	DefaultMinioRequestTimeout                           = "10000"
)
View Source
const (
	// DefaultIndexSliceSize defines the default slice size of index file when serializing.
	DefaultIndexSliceSize                      = 16
	DefaultGracefulTime                        = 5000 // ms
	DefaultGracefulStopTimeout                 = 1800 // s, for node
	DefaultProxyGracefulStopTimeout            = 30   // s,for proxy
	DefaultCoordGracefulStopTimeout            = 5    // s,for coord
	DefaultHighPriorityThreadCoreCoefficient   = 10
	DefaultMiddlePriorityThreadCoreCoefficient = 5
	DefaultLowPriorityThreadCoreCoefficient    = 1

	DefaultSessionTTL        = 30 // s
	DefaultSessionRetryTimes = 30

	DefaultMaxDegree                = 56
	DefaultSearchListSize           = 100
	DefaultPQCodeBudgetGBRatio      = 0.125
	DefaultBuildNumThreadsRatio     = 1.0
	DefaultSearchCacheBudgetGBRatio = 0.10
	DefaultLoadNumThreadRatio       = 8.0
	DefaultBeamWidthRatio           = 4.0
)
View Source
const (
	// DefaultServerMaxSendSize defines the maximum size of data per grpc request can send by server side.
	DefaultServerMaxSendSize = 512 * 1024 * 1024

	// DefaultServerMaxRecvSize defines the maximum size of data per grpc request can receive by server side.
	DefaultServerMaxRecvSize = 256 * 1024 * 1024

	// DefaultClientMaxSendSize defines the maximum size of data per grpc request can send by client side.
	DefaultClientMaxSendSize = 256 * 1024 * 1024

	// DefaultClientMaxRecvSize defines the maximum size of data per grpc request can receive by client side.
	DefaultClientMaxRecvSize = 512 * 1024 * 1024

	// DefaultLogLevel defines the log level of grpc
	DefaultLogLevel = "WARNING"

	// Grpc Timeout related configs
	DefaultDialTimeout      = 200
	DefaultKeepAliveTime    = 10000
	DefaultKeepAliveTimeout = 20000

	// Grpc retry policy
	DefaultMaxAttempts                = 10
	DefaultInitialBackoff     float64 = 0.2
	DefaultMaxBackoff         float64 = 10
	DefaultCompressionEnabled bool    = false

	ProxyInternalPort = 19529
	ProxyExternalPort = 19530
)
View Source
const (
	BuildStage  = "build"
	LoadStage   = "load"
	SearchStage = "search"
)
View Source
const (
	BuildDramBudgetKey = "build_dram_budget_gb"
	NumBuildThreadKey  = "num_build_thread"
	VecFieldSizeKey    = "vec_field_size_gb"
)
View Source
const (
	KafkaProducerConfigPrefix = "kafka.producer."
	KafkaConsumerConfigPrefix = "kafka.consumer."
)
View Source
const (
	DefaultBitmapCardinalityLimit = 100
)
View Source
const (

	// MBSize used to convert megabytes and bytes.
	MBSize = 1024.0 * 1024.0
)

Variables

This section is empty.

Functions

func GetCreateTime

func GetCreateTime() time.Time

func GetHookParams

func GetHookParams() *hookConfig

func GetKeyFromSlice

func GetKeyFromSlice(indexParams []*commonpb.KeyValuePair, key string) string

func GetRole

func GetRole() string

func GetStringNodeID

func GetStringNodeID() string

func GetUpdateTime

func GetUpdateTime() time.Time

func Init

func Init()

func InitWithBaseTable

func InitWithBaseTable(baseTable *BaseTable)

func ParseAsStings

func ParseAsStings(v string) []string

func SetCreateTime

func SetCreateTime(d time.Time)

func SetDefaultMetricTypeIfNotExist

func SetDefaultMetricTypeIfNotExist(dType schemapb.DataType, params map[string]string)

func SetNodeID

func SetNodeID(newID UniqueID)

func SetRole

func SetRole(role string)

func SetUpdateTime

func SetUpdateTime(d time.Time)

Types

type AccessLogConfig

type AccessLogConfig struct {
	Enable        ParamItem  `refreshable:"true"`
	MinioEnable   ParamItem  `refreshable:"false"`
	LocalPath     ParamItem  `refreshable:"false"`
	Filename      ParamItem  `refreshable:"false"`
	MaxSize       ParamItem  `refreshable:"false"`
	RotatedTime   ParamItem  `refreshable:"false"`
	MaxBackups    ParamItem  `refreshable:"false"`
	RemotePath    ParamItem  `refreshable:"false"`
	RemoteMaxTime ParamItem  `refreshable:"false"`
	Formatter     ParamGroup `refreshable:"false"`

	CacheSize          ParamItem `refreshable:"false"`
	CacheFlushInterval ParamItem `refreshable:"false"`
}

///////////////////////////////////////////////////////////////////////////// --- proxy ---

type AutoIndexConfig

type AutoIndexConfig struct {
	Enable                 ParamItem `refreshable:"true"`
	EnableOptimize         ParamItem `refreshable:"true"`
	EnableResultLimitCheck ParamItem `refreshable:"true"`

	IndexParams           ParamItem  `refreshable:"true"`
	SparseIndexParams     ParamItem  `refreshable:"true"`
	BinaryIndexParams     ParamItem  `refreshable:"true"`
	PrepareParams         ParamItem  `refreshable:"true"`
	LoadAdaptParams       ParamItem  `refreshable:"true"`
	ExtraParams           ParamItem  `refreshable:"true"`
	IndexType             ParamItem  `refreshable:"true"`
	AutoIndexTypeName     ParamItem  `refreshable:"true"`
	AutoIndexSearchConfig ParamItem  `refreshable:"true"`
	AutoIndexTuningConfig ParamGroup `refreshable:"true"`

	ScalarAutoIndexEnable  ParamItem `refreshable:"true"`
	ScalarAutoIndexParams  ParamItem `refreshable:"true"`
	ScalarNumericIndexType ParamItem `refreshable:"true"`
	ScalarIntIndexType     ParamItem `refreshable:"true"`
	ScalarVarcharIndexType ParamItem `refreshable:"true"`
	ScalarBoolIndexType    ParamItem `refreshable:"true"`
	ScalarFloatIndexType   ParamItem `refreshable:"true"`

	BitmapCardinalityLimit ParamItem `refreshable:"true"`
}

///////////////////////////////////////////////////////////////////////////// --- common ---

func (*AutoIndexConfig) SetDefaultMetricType

func (p *AutoIndexConfig) SetDefaultMetricType(mgr *config.Manager)

SetDefaultMetricType The config check logic has been moved to internal package; only set defulat metric here

func (*AutoIndexConfig) SetDefaultMetricTypeHelper

func (p *AutoIndexConfig) SetDefaultMetricTypeHelper(key string, m map[string]string, dtype schemapb.DataType, mgr *config.Manager)

type BaseTable

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

BaseTable the basics of paramtable

func GetBaseTable

func GetBaseTable() *BaseTable

func NewBaseTable

func NewBaseTable(opts ...Option) *BaseTable

func NewBaseTableFromYamlOnly

func NewBaseTableFromYamlOnly(yaml string) *BaseTable

NewBaseTableFromYamlOnly only used in migration tool. Maybe we shouldn't limit the configDir internally.

func (*BaseTable) FileConfigs

func (bt *BaseTable) FileConfigs() map[string]string

func (*BaseTable) Get

func (bt *BaseTable) Get(key string) string

func (*BaseTable) GetConfigDir

func (bt *BaseTable) GetConfigDir() string

GetConfigDir returns the config directory

func (*BaseTable) GetWithDefault

func (bt *BaseTable) GetWithDefault(key, defaultValue string) string

GetWithDefault loads an object with @key. If the object does not exist, @defaultValue will be returned.

func (*BaseTable) Load

func (bt *BaseTable) Load(key string) (string, error)

Load loads an object with @key.

func (*BaseTable) Remove

func (bt *BaseTable) Remove(key string) error

Remove Config by key

func (*BaseTable) Reset

func (bt *BaseTable) Reset(key string) error

Reset Config to default value

func (*BaseTable) Save

func (bt *BaseTable) Save(key, value string) error

Update Config

func (*BaseTable) SaveGroup

func (bt *BaseTable) SaveGroup(group map[string]string) error

func (*BaseTable) UpdateSourceOptions

func (bt *BaseTable) UpdateSourceOptions(opts ...config.Option)

type ComponentParam

type ComponentParam struct {
	ServiceParam

	CommonCfg       commonConfig
	QuotaConfig     quotaConfig
	AutoIndexConfig AutoIndexConfig
	GpuConfig       gpuConfig
	TraceCfg        traceConfig

	RootCoordCfg   rootCoordConfig
	ProxyCfg       proxyConfig
	QueryCoordCfg  queryCoordConfig
	QueryNodeCfg   queryNodeConfig
	DataCoordCfg   dataCoordConfig
	DataNodeCfg    dataNodeConfig
	IndexNodeCfg   indexNodeConfig
	KnowhereConfig knowhereConfig
	HTTPCfg        httpConfig
	LogCfg         logConfig
	RoleCfg        roleConfig
	RbacConfig     rbacConfig
	StreamingCfg   streamingConfig

	InternalTLSCfg InternalTLSConfig

	RootCoordGrpcServerCfg     GrpcServerConfig
	ProxyGrpcServerCfg         GrpcServerConfig
	QueryCoordGrpcServerCfg    GrpcServerConfig
	QueryNodeGrpcServerCfg     GrpcServerConfig
	DataCoordGrpcServerCfg     GrpcServerConfig
	DataNodeGrpcServerCfg      GrpcServerConfig
	IndexNodeGrpcServerCfg     GrpcServerConfig
	StreamingNodeGrpcServerCfg GrpcServerConfig

	RootCoordGrpcClientCfg      GrpcClientConfig
	ProxyGrpcClientCfg          GrpcClientConfig
	QueryCoordGrpcClientCfg     GrpcClientConfig
	QueryNodeGrpcClientCfg      GrpcClientConfig
	DataCoordGrpcClientCfg      GrpcClientConfig
	DataNodeGrpcClientCfg       GrpcClientConfig
	IndexNodeGrpcClientCfg      GrpcClientConfig
	StreamingCoordGrpcClientCfg GrpcClientConfig
	StreamingNodeGrpcClientCfg  GrpcClientConfig
	IntegrationTestCfg          integrationTestConfig

	RuntimeConfig runtimeConfig
	// contains filtered or unexported fields
}

ComponentParam is used to quickly and easily access all components' configurations.

func Get

func Get() *ComponentParam

func (*ComponentParam) CleanEvent

func (p *ComponentParam) CleanEvent()

clean all config event in dispatcher

func (*ComponentParam) GetAll

func (p *ComponentParam) GetAll() map[string]string

func (*ComponentParam) GetComponentConfigurations

func (p *ComponentParam) GetComponentConfigurations(componentName string, sub string) map[string]string

func (*ComponentParam) GetWithDefault

func (params *ComponentParam) GetWithDefault(key string, dft string) string

func (*ComponentParam) Init

func (p *ComponentParam) Init(bt *BaseTable)

Init initialize once

func (*ComponentParam) Remove

func (params *ComponentParam) Remove(key string) error

func (*ComponentParam) Reset

func (params *ComponentParam) Reset(key string) error

func (*ComponentParam) Save

func (params *ComponentParam) Save(key string, value string) error

func (*ComponentParam) SaveGroup

func (params *ComponentParam) SaveGroup(group map[string]string) error

func (*ComponentParam) Unwatch

func (p *ComponentParam) Unwatch(key string, watcher config.EventHandler)

func (*ComponentParam) Watch

func (p *ComponentParam) Watch(key string, watcher config.EventHandler)

func (*ComponentParam) WatchKeyPrefix

func (p *ComponentParam) WatchKeyPrefix(keyPrefix string, watcher config.EventHandler)

type CompositeParamItem

type CompositeParamItem struct {
	Items  []*ParamItem
	Format func(map[string]string) string
}

func (*CompositeParamItem) GetValue

func (cpi *CompositeParamItem) GetValue() string

type EtcdConfig

type EtcdConfig struct {
	// --- ETCD ---
	Endpoints         ParamItem          `refreshable:"false"`
	RootPath          ParamItem          `refreshable:"false"`
	MetaSubPath       ParamItem          `refreshable:"false"`
	KvSubPath         ParamItem          `refreshable:"false"`
	MetaRootPath      CompositeParamItem `refreshable:"false"`
	KvRootPath        CompositeParamItem `refreshable:"false"`
	EtcdLogLevel      ParamItem          `refreshable:"false"`
	EtcdLogPath       ParamItem          `refreshable:"false"`
	EtcdUseSSL        ParamItem          `refreshable:"false"`
	EtcdTLSCert       ParamItem          `refreshable:"false"`
	EtcdTLSKey        ParamItem          `refreshable:"false"`
	EtcdTLSCACert     ParamItem          `refreshable:"false"`
	EtcdTLSMinVersion ParamItem          `refreshable:"false"`
	RequestTimeout    ParamItem          `refreshable:"false"`

	// --- Embed ETCD ---
	UseEmbedEtcd ParamItem `refreshable:"false"`
	ConfigPath   ParamItem `refreshable:"false"`
	DataDir      ParamItem `refreshable:"false"`

	// --- ETCD Authentication ---
	EtcdEnableAuth   ParamItem `refreshable:"false"`
	EtcdAuthUserName ParamItem `refreshable:"false"`
	EtcdAuthPassword ParamItem `refreshable:"false"`
}

///////////////////////////////////////////////////////////////////////////// --- etcd ---

func (*EtcdConfig) Init

func (p *EtcdConfig) Init(base *BaseTable)

type GrpcClientConfig

type GrpcClientConfig struct {
	CompressionEnabled ParamItem `refreshable:"false"`

	ClientMaxSendSize ParamItem `refreshable:"false"`
	ClientMaxRecvSize ParamItem `refreshable:"false"`

	DialTimeout      ParamItem `refreshable:"false"`
	KeepAliveTime    ParamItem `refreshable:"false"`
	KeepAliveTimeout ParamItem `refreshable:"false"`

	MaxAttempts             ParamItem `refreshable:"false"`
	InitialBackoff          ParamItem `refreshable:"false"`
	MaxBackoff              ParamItem `refreshable:"false"`
	BackoffMultiplier       ParamItem `refreshable:"false"`
	MinResetInterval        ParamItem `refreshable:"false"`
	MaxCancelError          ParamItem `refreshable:"false"`
	MinSessionCheckInterval ParamItem `refreshable:"false"`
	// contains filtered or unexported fields
}

GrpcClientConfig is configuration for grpc client.

func (*GrpcClientConfig) GetAddress

func (p *GrpcClientConfig) GetAddress() string

GetAddress return grpc address

func (*GrpcClientConfig) GetDefaultRetryPolicy

func (p *GrpcClientConfig) GetDefaultRetryPolicy() map[string]interface{}

GetDefaultRetryPolicy returns default grpc retry policy.

func (*GrpcClientConfig) GetDialOptionsFromConfig

func (p *GrpcClientConfig) GetDialOptionsFromConfig() []grpc.DialOption

GetDialOptionsFromConfig returns grpc dial options from config.

func (*GrpcClientConfig) GetInternalAddress

func (p *GrpcClientConfig) GetInternalAddress() string

func (*GrpcClientConfig) Init

func (p *GrpcClientConfig) Init(domain string, base *BaseTable)

type GrpcServerConfig

type GrpcServerConfig struct {
	ServerMaxSendSize ParamItem `refreshable:"false"`
	ServerMaxRecvSize ParamItem `refreshable:"false"`

	GracefulStopTimeout ParamItem `refreshable:"true"`
	// contains filtered or unexported fields
}

GrpcServerConfig is configuration for grpc server.

func (*GrpcServerConfig) GetAddress

func (p *GrpcServerConfig) GetAddress() string

GetAddress return grpc address

func (*GrpcServerConfig) GetInternalAddress

func (p *GrpcServerConfig) GetInternalAddress() string

func (*GrpcServerConfig) Init

func (p *GrpcServerConfig) Init(domain string, base *BaseTable)

type InternalTLSConfig

type InternalTLSConfig struct {
	InternalTLSEnabled       ParamItem `refreshable:"false"`
	InternalTLSServerPemPath ParamItem `refreshable:"false"`
	InternalTLSServerKeyPath ParamItem `refreshable:"false"`
	InternalTLSCaPemPath     ParamItem `refreshable:"false"`
	InternalTLSSNI           ParamItem `refreshable:"false"`
}

func (*InternalTLSConfig) Init

func (p *InternalTLSConfig) Init(base *BaseTable)

type KafkaConfig

type KafkaConfig struct {
	Address             ParamItem  `refreshable:"false"`
	SaslUsername        ParamItem  `refreshable:"false"`
	SaslPassword        ParamItem  `refreshable:"false"`
	SaslMechanisms      ParamItem  `refreshable:"false"`
	SecurityProtocol    ParamItem  `refreshable:"false"`
	KafkaUseSSL         ParamItem  `refreshable:"false"`
	KafkaTLSCert        ParamItem  `refreshable:"false"`
	KafkaTLSKey         ParamItem  `refreshable:"false"`
	KafkaTLSCACert      ParamItem  `refreshable:"false"`
	KafkaTLSKeyPassword ParamItem  `refreshable:"false"`
	ConsumerExtraConfig ParamGroup `refreshable:"false"`
	ProducerExtraConfig ParamGroup `refreshable:"false"`
	ReadTimeout         ParamItem  `refreshable:"true"`
}

--- kafka ---

func (*KafkaConfig) Init

func (k *KafkaConfig) Init(base *BaseTable)

type LocalStorageConfig

type LocalStorageConfig struct {
	Path ParamItem `refreshable:"false"`
}

func (*LocalStorageConfig) Init

func (p *LocalStorageConfig) Init(base *BaseTable)

type MQConfig

type MQConfig struct {
	Type              ParamItem `refreshable:"false"`
	EnablePursuitMode ParamItem `refreshable:"true"`
	PursuitLag        ParamItem `refreshable:"true"`
	PursuitBufferSize ParamItem `refreshable:"true"`
	PursuitBufferTime ParamItem `refreshable:"true"`

	MQBufSize         ParamItem `refreshable:"false"`
	ReceiveBufSize    ParamItem `refreshable:"false"`
	IgnoreBadPosition ParamItem `refreshable:"true"`

	// msgdispatcher
	MergeCheckInterval ParamItem `refreshable:"false"`
	TargetBufSize      ParamItem `refreshable:"false"`
	MaxTolerantLag     ParamItem `refreshable:"true"`
}

MQConfig represents the configuration settings for the message queue.

func (*MQConfig) Init

func (p *MQConfig) Init(base *BaseTable)

Init initializes the MQConfig object with a BaseTable.

type MetaStoreConfig

type MetaStoreConfig struct {
	MetaStoreType              ParamItem `refreshable:"false"`
	SnapshotTTLSeconds         ParamItem `refreshable:"true"`
	SnapshotReserveTimeSeconds ParamItem `refreshable:"true"`
	PaginationSize             ParamItem `refreshable:"true"`
}

func (*MetaStoreConfig) Init

func (p *MetaStoreConfig) Init(base *BaseTable)

type MinioConfig

type MinioConfig struct {
	Address            ParamItem `refreshable:"false"`
	Port               ParamItem `refreshable:"false"`
	AccessKeyID        ParamItem `refreshable:"false"`
	SecretAccessKey    ParamItem `refreshable:"false"`
	UseSSL             ParamItem `refreshable:"false"`
	SslCACert          ParamItem `refreshable:"false"`
	BucketName         ParamItem `refreshable:"false"`
	RootPath           ParamItem `refreshable:"false"`
	UseIAM             ParamItem `refreshable:"false"`
	CloudProvider      ParamItem `refreshable:"false"`
	GcpCredentialJSON  ParamItem `refreshable:"false"`
	IAMEndpoint        ParamItem `refreshable:"false"`
	LogLevel           ParamItem `refreshable:"false"`
	Region             ParamItem `refreshable:"false"`
	UseVirtualHost     ParamItem `refreshable:"false"`
	RequestTimeoutMs   ParamItem `refreshable:"false"`
	ListObjectsMaxKeys ParamItem `refreshable:"true"`
}

///////////////////////////////////////////////////////////////////////////// --- minio ---

func (*MinioConfig) Init

func (p *MinioConfig) Init(base *BaseTable)

type NatsmqConfig

type NatsmqConfig struct {
	ServerPort                ParamItem `refreshable:"false"`
	ServerStoreDir            ParamItem `refreshable:"false"`
	ServerMaxFileStore        ParamItem `refreshable:"false"`
	ServerMaxPayload          ParamItem `refreshable:"false"`
	ServerMaxPending          ParamItem `refreshable:"false"`
	ServerInitializeTimeout   ParamItem `refreshable:"false"`
	ServerMonitorTrace        ParamItem `refreshable:"false"`
	ServerMonitorDebug        ParamItem `refreshable:"false"`
	ServerMonitorLogTime      ParamItem `refreshable:"false"`
	ServerMonitorLogFile      ParamItem `refreshable:"false"`
	ServerMonitorLogSizeLimit ParamItem `refreshable:"false"`
	ServerRetentionMaxAge     ParamItem `refreshable:"true"`
	ServerRetentionMaxBytes   ParamItem `refreshable:"true"`
	ServerRetentionMaxMsgs    ParamItem `refreshable:"true"`
}

NatsmqConfig describes the configuration options for the Nats message queue

func (*NatsmqConfig) Init

func (r *NatsmqConfig) Init(base *BaseTable)

Init sets up a new NatsmqConfig instance using the provided BaseTable

type Option

type Option func(*baseTableConfig)

func Files

func Files(files []string) Option

func Interval

func Interval(interval int) Option

func SkipEnv

func SkipEnv(skip bool) Option

func SkipRemote

func SkipRemote(skip bool) Option

type ParamGroup

type ParamGroup struct {
	KeyPrefix string // which should be named as "A.B."
	Version   string
	Doc       string
	Export    bool

	GetFunc func() map[string]string
	DocFunc func(string) string
	// contains filtered or unexported fields
}

func (*ParamGroup) GetDoc

func (pg *ParamGroup) GetDoc(key string) string

func (*ParamGroup) GetValue

func (pg *ParamGroup) GetValue() map[string]string

func (*ParamGroup) Init

func (pg *ParamGroup) Init(manager *config.Manager)

type ParamItem

type ParamItem struct {
	Key          string // which should be named as "A.B.C"
	Version      string
	Doc          string
	DefaultValue string
	FallbackKeys []string
	PanicIfEmpty bool
	Export       bool

	Formatter func(originValue string) string
	Forbidden bool
	// contains filtered or unexported fields
}

func (*ParamItem) GetAsBool

func (pi *ParamItem) GetAsBool() bool

func (*ParamItem) GetAsDuration

func (pi *ParamItem) GetAsDuration(unit time.Duration) time.Duration

func (*ParamItem) GetAsDurationByParse

func (pi *ParamItem) GetAsDurationByParse() time.Duration

func (*ParamItem) GetAsFloat

func (pi *ParamItem) GetAsFloat() float64

func (*ParamItem) GetAsInt

func (pi *ParamItem) GetAsInt() int

func (*ParamItem) GetAsInt32

func (pi *ParamItem) GetAsInt32() int32

func (*ParamItem) GetAsInt64

func (pi *ParamItem) GetAsInt64() int64

func (*ParamItem) GetAsJSONMap

func (pi *ParamItem) GetAsJSONMap() map[string]string

func (*ParamItem) GetAsRoleDetails

func (pi *ParamItem) GetAsRoleDetails() map[string](map[string]([](map[string]string)))

func (*ParamItem) GetAsSize

func (pi *ParamItem) GetAsSize() int64

func (*ParamItem) GetAsStrings

func (pi *ParamItem) GetAsStrings() []string

func (*ParamItem) GetAsUint

func (pi *ParamItem) GetAsUint() uint

func (*ParamItem) GetAsUint16

func (pi *ParamItem) GetAsUint16() uint16

func (*ParamItem) GetAsUint32

func (pi *ParamItem) GetAsUint32() uint32

func (*ParamItem) GetAsUint64

func (pi *ParamItem) GetAsUint64() uint64

func (*ParamItem) GetValue

func (pi *ParamItem) GetValue() string

func (*ParamItem) Init

func (pi *ParamItem) Init(manager *config.Manager)

func (*ParamItem) SwapTempValue

func (pi *ParamItem) SwapTempValue(s string) *string

SetTempValue set the value for this ParamItem, Once value set, ParamItem will use the value instead of underlying config manager. Usage: should only use for unittest, swap empty string will remove the value.

type PulsarConfig

type PulsarConfig struct {
	Address        ParamItem `refreshable:"false"`
	Port           ParamItem `refreshable:"false"`
	WebAddress     ParamItem `refreshable:"false"`
	WebPort        ParamItem `refreshable:"false"`
	MaxMessageSize ParamItem `refreshable:"true"`

	// support auth
	AuthPlugin ParamItem `refreshable:"false"`
	AuthParams ParamItem `refreshable:"false"`

	// support tenant
	Tenant    ParamItem `refreshable:"false"`
	Namespace ParamItem `refreshable:"false"`

	// Global request timeout
	RequestTimeout ParamItem `refreshable:"false"`

	// Enable Client side metrics
	EnableClientMetrics ParamItem `refreshable:"false"`
}

///////////////////////////////////////////////////////////////////////////// --- pulsar ---

func (*PulsarConfig) Init

func (p *PulsarConfig) Init(base *BaseTable)

type RocksmqConfig

type RocksmqConfig struct {
	Path          ParamItem `refreshable:"false"`
	LRUCacheRatio ParamItem `refreshable:"false"`
	PageSize      ParamItem `refreshable:"false"`
	// RetentionTimeInMinutes is the time of retention
	RetentionTimeInMinutes ParamItem `refreshable:"false"`
	// RetentionSizeInMB is the size of retention
	RetentionSizeInMB ParamItem `refreshable:"false"`
	// CompactionInterval is the Interval we trigger compaction,
	CompactionInterval ParamItem `refreshable:"false"`
	// TickerTimeInSeconds is the time of expired check, default 10 minutes
	TickerTimeInSeconds ParamItem `refreshable:"false"`
	// CompressionTypes is compression type of each level
	// len of CompressionTypes means num of rocksdb level.
	// only support {0,7}, 0 means no compress, 7 means zstd
	// default [0,7].
	CompressionTypes ParamItem `refreshable:"false"`
}

///////////////////////////////////////////////////////////////////////////// --- rocksmq ---

func (*RocksmqConfig) Init

func (r *RocksmqConfig) Init(base *BaseTable)

type RuntimeParamItem

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

func (*RuntimeParamItem) GetAsInt64

func (rpi *RuntimeParamItem) GetAsInt64() int64

func (*RuntimeParamItem) GetAsString

func (rpi *RuntimeParamItem) GetAsString() string

func (*RuntimeParamItem) GetAsTime

func (rpi *RuntimeParamItem) GetAsTime() time.Time

func (*RuntimeParamItem) GetValue

func (rpi *RuntimeParamItem) GetValue() any

func (*RuntimeParamItem) SetValue

func (rpi *RuntimeParamItem) SetValue(value any)

type ServiceParam

type ServiceParam struct {
	LocalStorageCfg LocalStorageConfig
	MetaStoreCfg    MetaStoreConfig
	EtcdCfg         EtcdConfig
	TiKVCfg         TiKVConfig
	MQCfg           MQConfig
	PulsarCfg       PulsarConfig
	KafkaCfg        KafkaConfig
	RocksmqCfg      RocksmqConfig
	NatsmqCfg       NatsmqConfig
	MinioCfg        MinioConfig
}

ServiceParam is used to quickly and easily access all basic service configurations.

func (*ServiceParam) KafkaEnable

func (p *ServiceParam) KafkaEnable() bool

func (*ServiceParam) NatsmqEnable

func (p *ServiceParam) NatsmqEnable() bool

NatsmqEnable checks if NATS messaging queue is enabled.

func (*ServiceParam) PulsarEnable

func (p *ServiceParam) PulsarEnable() bool

func (*ServiceParam) RocksmqEnable

func (p *ServiceParam) RocksmqEnable() bool

type TiKVConfig

type TiKVConfig struct {
	Endpoints        ParamItem          `refreshable:"false"`
	RootPath         ParamItem          `refreshable:"false"`
	MetaSubPath      ParamItem          `refreshable:"false"`
	KvSubPath        ParamItem          `refreshable:"false"`
	MetaRootPath     CompositeParamItem `refreshable:"false"`
	KvRootPath       CompositeParamItem `refreshable:"false"`
	RequestTimeout   ParamItem          `refreshable:"false"`
	SnapshotScanSize ParamItem          `refreshable:"true"`
	TiKVUseSSL       ParamItem          `refreshable:"false"`
	TiKVTLSCert      ParamItem          `refreshable:"false"`
	TiKVTLSKey       ParamItem          `refreshable:"false"`
	TiKVTLSCACert    ParamItem          `refreshable:"false"`
}

///////////////////////////////////////////////////////////////////////////// --- tikv ---

func (*TiKVConfig) Init

func (p *TiKVConfig) Init(base *BaseTable)

type UniqueID

type UniqueID = typeutil.UniqueID

UniqueID is type alias of typeutil.UniqueID

func GetNodeID

func GetNodeID() UniqueID

Jump to

Keyboard shortcuts

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