config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: Apache-2.0 Imports: 11 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

	//root name
	RootName string `toml:"rootname"`

	//root password
	RootPassword string `toml:"rootpassword"`

	DumpUser string `toml:"dumpuser"`

	DumpPassword string `toml:"dumppassword"`

	//dump database
	DumpDatabase string `toml:"dumpdatabase"`

	//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
	StorePath string `toml:"storePath"`

	//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. false : one txn for an independent batch true : only one txn during loading data
	DisableOneTxnPerBatchDuringLoad bool `toml:"DisableOneTxnPerBatchDuringLoad"`

	//default is 'debug'. the level of log.
	LogLevel string `toml:"logLevel"`

	//default is 'json'. the format of log.
	LogFormat string `toml:"logFormat"`

	//default is ”. the file
	LogFilename string `toml:"logFilename"`

	//default is 512MB. the maximum of log file size
	LogMaxSize int64 `toml:"logMaxSize"`

	//default is 0. the maximum days of log file to be kept
	LogMaxDays int64 `toml:"logMaxDays"`

	//default is 0. the maximum numbers of log file to be retained
	LogMaxBackups int64 `toml:"logMaxBackups"`

	//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
	DNReplicaID uint64 `toml:"dnreplicalid"`

	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"`

	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"`
}

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 (*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 int64 `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 FileService. if InternalExecutor, use internal sql executor, FileService will implement soon.
	BatchProcessor string `toml:"batchProcessor"`

	// 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"`

	// MetricMultiTable default is false. With true, save all metric data in one table.
	MetricMultiTable bool `toml:"metricMultiTable"`

	// MetricExportInterval default is 15 sec.
	MetricExportInterval int `toml:"metricExportInterval"`

	// MetricGatherInterval default is 15 sec.
	MetricGatherInterval int `toml:"metricGatherInterval"`

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

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

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

	// MergeMaxFileSize default: 128 (MB)
	MergeMaxFileSize int `toml:"mergeMaxFileSize"`

	// PathBuilder default: DBTable. Support val in [DBTable, AccountDate]
	PathBuilder string `toml:"pathBuilder"`

	// LogsExtension default: tae. Support val in [csv, tae]
	LogsExtension string `toml:"logsExtension"`

	// MergedExtension default: tae. Support val in [csv, tae]
	MergedExtension string `toml:"mergedExtension"`

	// 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"`

	// If disabled, the statements will not be aggregated
	DisableStmtAggregation bool `toml:"disableStmtAggregation"`

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

	// 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 (*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

	// 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