Documentation ¶
Index ¶
Constants ¶
View Source
const CUCpuPriceDefault = 3.45e-14
View Source
const CUIOInPriceDefault = 5.67e-06
View Source
const CUIOOutPriceDefault = 6.78e-06
View Source
const CUMemPriceDefault = 4.56e-24
View Source
const CUTrafficPrice0Default = 7.89e-10
View Source
const CUTrafficPrice1Default = 7.89e-10
View Source
const CUTrafficPrice2Default = 7.89e-10
View Source
const CUUnitDefault = 1.002678e-06
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" user_setting:"basic"` //listening ip Host string `toml:"host" user_setting:"basic"` // UnixSocketAddress listening unix domain socket UnixSocketAddress string `toml:"unix-socket" user_setting:"advanced"` //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" user_setting:"advanced"` //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" user_setting:"advanced"` //default is ”. Path of file that contains list of trusted SSL CAs for client TlsCaFile string `toml:"tlsCaFile" user_setting:"advanced"` //default is ”. Path of file that contains X509 certificate in PEM format for client TlsCertFile string `toml:"tlsCertFile" user_setting:"advanced"` //default is ”. Path of file that contains X509 key in PEM format for client TlsKeyFile string `toml:"tlsKeyFile" user_setting:"advanced"` //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" user_setting:"advanced"` // default 24 (h) QueryResultTimeout uint64 `toml:"queryResultTimeout" user_setting:"advanced"` // default 100 (MB) QueryResultMaxsize uint64 `toml:"queryResultMaxsize" user_setting:"advanced"` AutoIncrCacheSize uint64 `toml:"autoIncrCacheSize"` LowerCaseTableNames string `toml:"lowerCaseTableNames" user_setting:"advanced"` 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"` // default sql_mode default value SqlMode string `toml:"sql-mode"` }
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 OBCUConfig ¶ added in v1.1.2
type OBCUConfig struct { // cu unit CUUnit float64 `toml:"cu_unit"` // price CpuPrice float64 `toml:"cpu_price"` MemPrice float64 `toml:"mem_price"` IoInPrice float64 `toml:"io_in_price"` IoOutPrice float64 `toml:"io_out_price"` TrafficPrice0 float64 `toml:"traffic_price_0"` TrafficPrice1 float64 `toml:"traffic_price_1"` TrafficPrice2 float64 `toml:"traffic_price_2"` }
func NewOBCUConfig ¶ added in v1.1.2
func NewOBCUConfig() *OBCUConfig
func (*OBCUConfig) SetDefaultValues ¶ added in v1.1.2
func (c *OBCUConfig) SetDefaultValues()
type OBCollectorConfig ¶ added in v0.8.0
type OBCollectorConfig struct { ShowStatsInterval toml.Duration `toml:"showStatsInterval"` // BufferCnt BufferCnt int32 `toml:"bufferCnt"` BufferSize int64 `toml:"bufferSize"` CollectorCntPercent int `toml:"collector_cnt_percent"` GeneratorCntPercent int `toml:"generator_cnt_percent"` ExporterCntPercent int `toml:"exporter_cnt_percent"` }
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" user_setting:"advanced"` // 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" user_setting:"advanced"` // EnableMetricToProm default is false. if true, metrics can be scraped through host:status/metrics endpoint EnableMetricToProm bool `toml:"enableMetricToProm" user_setting:"advanced"` // DisableMetric default is false. if false, enable metric at booting DisableMetric bool `toml:"disableMetric" user_setting:"advanced"` // DisableTrace default is false. if false, enable trace at booting DisableTrace bool `toml:"disableTrace" user_setting:"advanced"` // 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" user_setting:"advanced"` // 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"` // LabelSelector LabelSelector map[string]string `toml:"labelSelector"` // estimate tcp network packet cost TCPPacket bool `toml:"tcpPacket"` // for cu calculation CU OBCUConfig `toml:"cu"` CUv1 OBCUConfig `toml:"cu_v1"` 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 UdfService udf.Service // HAKeeper client, which is used to get connection ID // from HAKeeper currently. HAKeeperClient logservice.CNHAKeeperClient TaskService taskservice.TaskService }
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
Click to show internal directories.
Click to hide internal directories.