db_config

package
v0.0.0-...-3f388d4 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

-------------------------------------------------------------------------

*
* db_config.go
*    config from DB
*
*
* Copyright (c) 2021, Alibaba Group Holding Limited
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* IDENTIFICATION
*           common/polardb_pg/db_config/db_config.go
*-------------------------------------------------------------------------

Index

Constants

View Source
const (
	PolarMinReleaseDate = int64(20190101)
	MinDBVersion        = -1 // means no limit
	MaxDBVersion        = -1 // means no limit
	CollectMinDBVersion = 90200
	CollectMaxDBVersion = MaxDBVersion
)
View Source
const DATAMODEL = "dbmetrics"
View Source
const DBQueryTimeout = 60
View Source
const SQL_MARK = "/* rds internal mark */ "
View Source
const TABLE_BASE_CONFIG = "meta_base_config"
View Source
const TABLE_COLLECT_SQL_CONFIG = "meta_collect_sql_config"
View Source
const TABLE_CONFIG_VERSION = "meta_config_version"
View Source
const TABLE_DATA_STORE_CONFIG = "meta_data_store_config"
View Source
const TABLE_SNAPSHOT_NO = "meta_snapshots"

Variables

This section is empty.

Functions

This section is empty.

Types

type DBConfig

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

func NewDBConfig

func NewDBConfig() *DBConfig

func (*DBConfig) GetConfigCenterDBConfigVersion

func (d *DBConfig) GetConfigCenterDBConfigVersion() (int64, error)

func (*DBConfig) GetDBConfigVersion

func (d *DBConfig) GetDBConfigVersion() (int64, error)

func (*DBConfig) GetDBSnapshotNo

func (d *DBConfig) GetDBSnapshotNo() (int64, error)

func (*DBConfig) Init

func (d *DBConfig) Init(
	insname string,
	instype string,
	schema string,
	db *sql.DB,
	configcenterdb *sql.DB,
	collectConfigInitContext []interface{},
	logger *log.PluginLogger) error

func (*DBConfig) InitFromDBConfig

func (d *DBConfig) InitFromDBConfig(
	configmap map[string]interface{},
	querymap map[string]QueryCtx, rw bool) error

type QueryCtx

type QueryCtx struct {
	Name               string `json:"name"`
	Query              string `json:"query"`
	DataModel          string `json:"datamodel"`
	MinVersion         int64  `json:"min_version"`
	MaxVersion         int64  `json:"max_version"`
	PolarReleaseDate   int64  `json:"polar_release_date"`
	DBRole             int    `json:"role"`
	Offset             int64  `json:"offset"`
	Cycle              int64  `json:"cycle"`
	Enable             int    `json:"enable"`
	UseSnapshot        int    `json:"use_snapshot"`
	QueryAllDB         bool   `json:"queryalldb"`
	SendToMultiBackend int    `json:"send_to_multibackend"`
	Comment            string `json:"comment"`
	UseTmpTable        bool   `json:"usetmptable"`
	WriteIntoLog       int    `json:"write_into_log"`
	OriginQuery        string
}

Jump to

Keyboard shortcuts

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