config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: Apache-2.0 Imports: 12 Imported by: ? modules, 0 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationKeyType added in v0.6.0

type ConfigurationKeyType int
const (
	ParameterUnitKey ConfigurationKeyType = 1
)

type FrontendParameters added in v0.6.0

type FrontendParameters struct {
	MoVersion string

	//port defines which port the mo-server listens on and clients connect to
	Port int64 `toml:"port"`

	//listening ip
	Host string `toml:"host"`

	// UnixSocketAddress listening unix domain socket
	UnixSocketAddress string `toml:"unix-socket"`

	//guest mmu limitation. default: 1 << 40 = 1099511627776
	GuestMmuLimitation int64 `toml:"guestMmuLimitation"`

	//mempool maxsize. default: 1 << 40 = 1099511627776
	MempoolMaxSize int64 `toml:"mempoolMaxSize"`

	//mempool factor. default: 8
	MempoolFactor int64 `toml:"mempoolFactor"`

	//process.Limitation.Size. default: 10 << 32 = 42949672960
	ProcessLimitationSize int64 `toml:"processLimitationSize"`

	//process.Limitation.BatchRows. default: 10 << 32 = 42949672960
	ProcessLimitationBatchRows int64 `toml:"processLimitationBatchRows"`

	//process.Limitation.BatchSize. default: 0
	ProcessLimitationBatchSize int64 `toml:"processLimitationBatchSize"`

	//process.Limitation.PartitionRows. default: 10 << 32 = 42949672960
	ProcessLimitationPartitionRows int64 `toml:"processLimitationPartitionRows"`

	//the root directory of the storage and matrixcube's data. The actual dir is cubeDirPrefix + nodeID
	ServerVersionPrefix string `toml:"serverVersionPrefix"`

	//the length of query printed into console. -1, complete string. 0, empty string. >0 , length of characters at the header of the string.
	LengthOfQueryPrinted int64 `toml:"lengthOfQueryPrinted"`

	//the count of rows in vector of batch in load data
	BatchSizeInLoadData int64 `toml:"batchSizeInLoadData"`

	//default is 4. The count of go routine writing batch into the storage.
	LoadDataConcurrencyCount int64 `toml:"loadDataConcurrencyCount"`

	//default is false. Skip writing batch into the storage
	LoadDataSkipWritingBatch bool `toml:"loadDataSkipWritingBatch"`

	//KB. When the number of bytes in the outbuffer exceeds it,the outbuffer will be flushed.
	MaxBytesInOutbufToFlush int64 `toml:"maxBytesInOutbufToFlush"`

	//default printLog Interval is 10s.
	PrintLogInterVal int64 `toml:"printLogInterVal"`

	//export data to csv file default flush size
	ExportDataDefaultFlushSize int64 `toml:"exportDataDefaultFlushSize"`

	//port defines which port the rpc server listens on
	PortOfRpcServerInComputationEngine int64 `toml:"portOfRpcServerInComputationEngine"`

	//default is false. With true. Server will support tls
	EnableTls bool `toml:"enableTls"`

	//default is ”. Path of file that contains list of trusted SSL CAs for client
	TlsCaFile string `toml:"tlsCaFile"`

	//default is ”. Path of file that contains X509 certificate in PEM format for client
	TlsCertFile string `toml:"tlsCertFile"`

	//default is ”. Path of file that contains X509 key in PEM format for client
	TlsKeyFile string `toml:"tlsKeyFile"`

	//default is 1
	LogShardID uint64 `toml:"logshardid"`

	//default is 1
	TNReplicaID uint64 `toml:"tnreplicalid"`

	EnableDoComQueryInProgress bool `toml:"comQueryInProgress"`

	//timeout of the session. the default is 10minutes
	SessionTimeout toml.Duration `toml:"sessionTimeout"`

	// MaxMessageSize max size for read messages from dn. Default is 10M
	MaxMessageSize uint64 `toml:"max-message-size"`

	// default off
	SaveQueryResult string `toml:"saveQueryResult"`

	// default 24 (h)
	QueryResultTimeout uint64 `toml:"queryResultTimeout"`

	// default 100 (MB)
	QueryResultMaxsize uint64 `toml:"queryResultMaxsize"`

	AutoIncrCacheSize uint64 `toml:"autoIncrCacheSize"`

	LowerCaseTableNames int64 `toml:"lowerCaseTableNames"`

	PrintDebug bool `toml:"printDebug"`

	PrintDebugInterval int `toml:"printDebugInterval"`

	// Interval in seconds
	KillRountinesInterval int `toml:"killRountinesInterval"`

	CleanKillQueueInterval int `toml:"cleanKillQueueInterval"`

	// ProxyEnabled indicates that proxy module is enabled and something extra
	// is needed, such as update the salt.
	ProxyEnabled bool `toml:"proxy-enabled"`

	// SkipCheckPrivilege denotes the privilege check should be passed.
	SkipCheckPrivilege bool `toml:"skipCheckPrivilege"`

	// skip checking the password of the user
	SkipCheckUser bool `toml:"skipCheckUser"`

	// disable select into
	DisableSelectInto bool `toml:"disable-select-into"`
}

FrontendParameters of the frontend

func (*FrontendParameters) GetUnixSocketAddress added in v0.7.0

func (fp *FrontendParameters) GetUnixSocketAddress() string

func (*FrontendParameters) SetDefaultValues added in v0.6.0

func (fp *FrontendParameters) SetDefaultValues()

func (*FrontendParameters) SetLogAndVersion added in v0.6.0

func (fp *FrontendParameters) SetLogAndVersion(log *logutil.LogConfig, version string)

func (*FrontendParameters) SetMaxMessageSize added in v0.6.0

func (fp *FrontendParameters) SetMaxMessageSize(size uint64)

type OBCollectorConfig added in v0.8.0

type OBCollectorConfig struct {
	ShowStatsInterval toml.Duration `toml:"showStatsInterval"`
	// BufferCnt
	BufferCnt  int32 `toml:"bufferCnt"`
	BufferSize int64 `toml:"bufferSize"`
}

func NewOBCollectorConfig added in v1.0.0

func NewOBCollectorConfig() *OBCollectorConfig

func (*OBCollectorConfig) SetDefaultValues added in v0.8.0

func (c *OBCollectorConfig) SetDefaultValues()

type ObservabilityParameters added in v0.6.0

type ObservabilityParameters struct {
	// MoVersion, see SetDefaultValues
	MoVersion string

	// Host listening ip. normally same as FrontendParameters.Host
	Host string `toml:"host"`

	// StatusPort defines which port the mo status server (for metric etc.) listens on and clients connect to
	// Start listen with EnableMetricToProm is true.
	StatusPort int `toml:"statusPort"`

	// EnableMetricToProm default is false. if true, metrics can be scraped through host:status/metrics endpoint
	EnableMetricToProm bool `toml:"enableMetricToProm"`

	// DisableMetric default is false. if false, enable metric at booting
	DisableMetric bool `toml:"disableMetric"`

	// DisableTrace default is false. if false, enable trace at booting
	DisableTrace bool `toml:"disableTrace"`

	// EnableTraceDebug default is false. With true, system will check all the children span is ended, which belong to the closing span.
	EnableTraceDebug bool `toml:"enableTraceDebug"`

	// TraceExportInterval default is 15s.
	TraceExportInterval int `toml:"traceExportInterval"`

	// LongQueryTime default is 0.0 sec. if 0.0f, record every query. Record with exec time longer than LongQueryTime.
	LongQueryTime float64 `toml:"longQueryTime"`

	// MetricExportInterval default is 15 sec.
	MetricExportInterval int `toml:"metric-export-interval"`

	// MetricGatherInterval default is 15 sec.
	MetricGatherInterval int `toml:"metric-gather-interval"`

	// MetricInternalGatherInterval default is 1 min, handle metric.SubSystemMO metric
	MetricInternalGatherInterval toml.Duration `toml:"metric-internal-gather-interval"`

	// MetricStorageUsageUpdateInterval, default: 15 min
	MetricStorageUsageUpdateInterval toml.Duration `toml:"metricStorageUsageUpdateInterval"`

	// MetricStorageUsageCheckNewInterval, default: 1 min
	MetricStorageUsageCheckNewInterval toml.Duration `toml:"metricStorageUsageCheckNewInterval"`

	// MergeCycle default: 300 sec (5 minutes).
	// PS: only used while MO init.
	MergeCycle toml.Duration `toml:"mergeCycle"`

	// DisableSpan default: false. Disable span collection
	DisableSpan bool `toml:"disableSpan"`

	// LongSpanTime default: 500 ms. Only record span, which duration >= LongSpanTime
	LongSpanTime toml.Duration `toml:"longSpanTime"`

	// SkipRunningStmt default: false. Skip status:Running entry while collect statement_info
	SkipRunningStmt bool `toml:"skipRunningStmt"`

	// If disabled, the logs will be written to files stored in s3
	DisableSqlWriter bool `toml:"disableSqlWriter"`

	// DisableStmtAggregation ctrl statement aggregation. If disabled, the statements will not be aggregated.
	// If false, LongQueryTime is NO less than SelectAggrThreshold
	DisableStmtAggregation bool `toml:"disableStmtAggregation"`

	// Seconds to aggregate the statements
	AggregationWindow toml.Duration `toml:"aggregationWindow"`

	// SelectAggrThreshold Duration to filter statements for aggregation
	SelectAggrThreshold toml.Duration `toml:"selectAggrThreshold"`

	// Disable merge statements
	EnableStmtMerge bool `toml:"enableStmtMerge"`

	OBCollectorConfig
}

ObservabilityParameters hold metric/trace switch

func NewObservabilityParameters added in v1.0.0

func NewObservabilityParameters() *ObservabilityParameters

func (*ObservabilityParameters) SetDefaultValues added in v0.6.0

func (op *ObservabilityParameters) SetDefaultValues(version string)

type ParameterUnit

type ParameterUnit struct {
	SV *FrontendParameters

	//Storage Engine
	StorageEngine engine.Engine

	//TxnClient
	TxnClient client.TxnClient

	//Cluster Nodes
	ClusterNodes engine.Nodes

	// FileService
	FileService fileservice.FileService

	// LockService instance
	LockService lockservice.LockService

	// QueryService instance
	QueryService queryservice.QueryService

	// HAKeeper client, which is used to get connection ID
	// from HAKeeper currently.
	HAKeeperClient logservice.CNHAKeeperClient
}

func GetParameterUnit added in v0.6.0

func GetParameterUnit(ctx context.Context) *ParameterUnit

GetParameterUnit gets the configuration from the context.

func NewParameterUnit

func NewParameterUnit(
	sv *FrontendParameters,
	storageEngine engine.Engine,
	txnClient client.TxnClient,
	clusterNodes engine.Nodes,
) *ParameterUnit

Jump to

Keyboard shortcuts

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