reviveplanner

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The usage number for DATA,TEMP. Set internally by Vertica.
	UsageIsDataTemp = 3
	// The usage number for DEPOT. Set internally by Vertica.
	UsageIsDepot = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ATPlanner

type ATPlanner struct {
	Database         Database
	CommunalLocation CommunalLocation
	Log              logr.Logger
	ParseComplete    bool
}

func (*ATPlanner) ApplyChanges

func (a *ATPlanner) ApplyChanges(vdb *vapi.VerticaDB) (updated bool, err error)

ApplyChanges will update the input vdb based on things it found during analysis. Return true if the vdb was updated.

func (*ATPlanner) IsCompatible

func (a *ATPlanner) IsCompatible() (string, bool)

IsCompatible will check the vdb and extracted revive info to see if everything is compatible. Returns a failure if an error is detected.

func (*ATPlanner) Parse

func (a *ATPlanner) Parse(op string) error

Parse looks at the op string passed in and spits out Database and CommunalLocation structs.

type CommunalLocation

type CommunalLocation struct {
	CommunalStorageURL string `json:"communal_storage_url"`
	NumShards          string `json:"num_shards"`
	DepotPath          string `json:"depot_path"`
	DepotSize          string `json:"depot_size"`
}

CommunalLocation shows information about the database's communal storage

type Database

type Database struct {
	Nodes                 []Node `json:"nodes"`
	Name                  string `json:"name"`
	Version               int    `json:"version"`
	SpreadVersion         int    `json:"spreadversion"`
	ControlMode           string `json:"controlmode"`
	WillUgrade            bool   `json:"willupgrade"`
	SpreadEncryption      string `json:"spreadEncryption"`
	SpreadEncryptionInUse bool   `json:"spreadEncryptionInUse"`
}

Database is a top-level database struct

type Node

type Node struct {
	Name                    string            `json:"name"`
	OID                     int64             `json:"oid"`
	CatalogPath             string            `json:"catalogpath"`
	StorageLocs             []string          `json:"storagelocs"`
	VStorageLocations       []StorageLocation `json:"_vstorage_locations"`
	CommunalStorageLocation StorageLocation   `json:"_communal_storage_location"`
	Host                    string            `json:"host"`
	Port                    int               `json:"port"`
	ControlNode             int64             `json:"controlnode"`
	Deps                    [][]string        `json:"deps"`
	StartCmd                string            `json:"startcmd"`
	IsPrimary               bool              `json:"isprimary"`
}

Node shows information about a single node

func (*Node) GetDataPaths

func (n *Node) GetDataPaths() []string

GetDataPaths returns the data paths for the node

func (*Node) GetDepotPath

func (n *Node) GetDepotPath() []string

GetDepotPath returns the depot paths for the node

type Planner

type Planner interface {
	// Analyze will look at the given output, from revive --display-only, and
	// parse it into Go structs.
	Parse(op string) error

	// IsCompatible will check if the revive will even work in k8s. A failure
	// message is returned if it isn't compatible.
	IsCompatible() (string, bool)

	// ApplyChanges will update the input vdb based on things it found during
	// analysis. Return true if the vdb was updated.
	ApplyChanges(vdb *vapi.VerticaDB) (bool, error)
}

func MakeATPlanner

func MakeATPlanner(log logr.Logger) Planner

MakeATPlanner is a factory function for the Planner interface. This makes one specific to admintools output.

func MakeATPlannerFromVDB

func MakeATPlannerFromVDB(vdb *vapi.VerticaDB, logger logr.Logger) Planner

MakeATPPlannerFromVDB will make a Planner struct based on the passed in vdb. This is used for tests only.

type StorageLocation

type StorageLocation struct {
	Name        string `json:"name"`
	Label       string `json:"label"`
	OID         int64  `json:"oid"`
	Path        string `json:"path"`
	SharingType int    `json:"sharing_type"`
	Usage       int    `json:"usage"`
	Size        int    `json:"size"`
	Site        int64  `json:"site"`
}

StorageLocation has details about a single storage location

Jump to

Keyboard shortcuts

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