config

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

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

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

	// MetricUpdateStorageUsageInterval, default: 30 min
	MetricUpdateStorageUsageInterval toml.Duration `toml:"metricUpdateStorageUsageInterval"`

	// MergeCycle default: 14400 sec (4 hours).
	// 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"`
}

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

	// GetClusterDetails
	GetClusterDetails engine.GetClusterDetailsFunc
}

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,
	getClusterDetails engine.GetClusterDetailsFunc,
) *ParameterUnit

Jump to

Keyboard shortcuts

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