vdbgen

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Queries = map[QueryType]string{
	ShardCountKey:          "SELECT COUNT(*) FROM SHARDS WHERE SHARD_TYPE != 'Replica'",
	DBCfgKey:               "SHOW DATABASE DEFAULT ALL",
	StorageLocationKey:     "SELECT NODE_NAME, LOCATION_PATH FROM STORAGE_LOCATIONS WHERE LOCATION_USAGE = ?",
	DiskStorageLocationKey: "SELECT NODE_NAME, STORAGE_PATH FROM DISK_STORAGE WHERE STORAGE_USAGE = ?",
	NodeCountQueryKey:      "SELECT COUNT(*) FROM NODES",
	SubclusterQueryKey:     "SELECT SUBCLUSTER_NAME, IS_PRIMARY FROM SUBCLUSTERS ORDER BY NODE_NAME",
	KSafetyQueryKey:        "SELECT GET_DESIGN_KSAFE()",
	DepotSizeQueryKey:      "SELECT MAX(DISK_SPACE_USED_MB+DISK_SPACE_FREE_MB) FROM DISK_STORAGE WHERE STORAGE_USAGE = 'DEPOT'",
	CatalogSizeQueryKey: "SELECT MAX(DISK_SPACE_USED_MB+DISK_SPACE_FREE_MB) " +
		"FROM DISK_STORAGE WHERE STORAGE_USAGE in ('CATALOG','DATA,TEMP')",
	VersionQueryKey: "SELECT VERSION()",
}

Functions

func Generate

func Generate(wr io.Writer, cr VDBCreator) error

Generate will construct the VerticaDB and print it to wr

Types

type DBGenerator

type DBGenerator struct {
	Conn           *sql.DB
	Opts           *Options
	Objs           KObjs
	LicenseData    []byte
	DBCfg          map[string]string // Contents extracted from 'SHOW DATABASE DEFAULT ALL'
	CAFileData     []byte
	HadoopConfData map[string]string
	Krb5ConfData   []byte
	Krb5KeytabData []byte
}

func (*DBGenerator) Create

func (d *DBGenerator) Create() (*KObjs, error)

Create will generate a VerticaDB based the specifics gathered from a live database

type KObjs

type KObjs struct {
	Vdb                     vapi.VerticaDB
	CredSecret              corev1.Secret
	HasLicense              bool
	LicenseSecret           corev1.Secret
	SuperuserPasswordSecret corev1.Secret
	HasPassword             bool
	HasCAFile               bool
	CAFile                  corev1.Secret
	HasHadoopConfig         bool
	HadoopConfig            corev1.ConfigMap
	HasKerberosSecret       bool
	KerberosSecret          corev1.Secret
}

type Options

type Options struct {
	User               string
	Password           string
	TLSMode            string
	VdbName            string
	Host               string
	Port               int
	DBName             string
	IgnoreClusterLease bool
	Image              string
	LicenseFile        string
	CAFile             string
	HadoopConfigDir    string
	AzureAccountName   string
	CACertName         string
	Krb5Conf           string
	Krb5Keytab         string
	DepotVolume        string
}

Options contain the command line options and positional arguments

type QueryType

type QueryType string
const (
	ShardCountKey          QueryType = "shardCount"
	DBCfgKey               QueryType = "dbCfg"
	StorageLocationKey     QueryType = "storageLocation"
	DiskStorageLocationKey QueryType = "diskStorage"
	NodeCountQueryKey      QueryType = "nodeCount"
	SubclusterQueryKey     QueryType = "subcluster"
	KSafetyQueryKey        QueryType = "ksafety"
	LocalDataSizeQueryKey  QueryType = "storageLocationSize"
	DepotSizeQueryKey      QueryType = "depotSize"
	CatalogSizeQueryKey    QueryType = "catalogSize"
	VersionQueryKey        QueryType = "version"

	SecretAPIVersion = "v1"
	SecretKindName   = "Secret"

	ConfigAPIVersion = "v1"
	ConfigKindName   = "ConfigMap"
)

type VDBCreator

type VDBCreator interface {
	Create() (*KObjs, error)
}

Jump to

Keyboard shortcuts

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