cn

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FeNotReadyError = errors.New("component fe is not ready")
View Source
var GetFeFeatureInfoError = errors.New("failed to invoke FE /api/v2/feature or FE does not support multi-warehouse feature")
View Source
var SpecMissingError = errors.New("spec.template or spec.starRocksCluster is missing")
View Source
var StarRocksClusterMissingError = errors.New("custom resource StarRocksCluster is missing")
View Source
var StarRocksClusterRunModeError = errors.New("StarRocks Cluster should run in shared_data mode")

Functions

This section is empty.

Types

type CnController

type CnController struct {
	Recorder record.EventRecorder
	// contains filtered or unexported fields
}

func New

func New(k8sClient client.Client, recorderFor subc.GetEventRecorderForFunc) *CnController

func (*CnController) ClearResources

func (cc *CnController) ClearResources(ctx context.Context, src *srapi.StarRocksCluster) error

ClearResources clear the deployed resource about cn. statefulset, services, hpa.

func (*CnController) ClearWarehouse

func (cc *CnController) ClearWarehouse(ctx context.Context, namespace string, name string) error

ClearWarehouse clear the warehouse resource. It is different from ClearResources, which need to clear the CN related resources of StarRocksCluster. ClearWarehouse only has CN related resources, when the warehouse CR is deleted, sub resources of CN will be deleted by k8s.

func (*CnController) GetConfig

func (cc *CnController) GetConfig(ctx context.Context,
	configMapInfo *srapi.ConfigMapInfo, namespace string) (map[string]interface{}, error)

func (*CnController) GetControllerName

func (cc *CnController) GetControllerName() string

func (*CnController) SyncCluster

func (cc *CnController) SyncCluster(ctx context.Context, src *srapi.StarRocksCluster) error

func (*CnController) SyncCnSpec

func (cc *CnController) SyncCnSpec(ctx context.Context, object object.StarRocksObject, cnSpec *srapi.StarRocksCnSpec,
	cnStatus *srapi.StarRocksCnStatus) error

func (*CnController) SyncWarehouse

func (cc *CnController) SyncWarehouse(ctx context.Context, warehouse *srapi.StarRocksWarehouse) error

func (*CnController) UpdateClusterStatus

func (cc *CnController) UpdateClusterStatus(ctx context.Context, src *srapi.StarRocksCluster) error

UpdateClusterStatus update the status of StarRocksCluster.

func (*CnController) UpdateStatus

func (cc *CnController) UpdateStatus(ctx context.Context, object object.StarRocksObject,
	cnSpec *srapi.StarRocksCnSpec, cnStatus *srapi.StarRocksCnStatus) error

func (*CnController) UpdateWarehouseStatus

func (cc *CnController) UpdateWarehouseStatus(ctx context.Context, warehouse *srapi.StarRocksWarehouse) error

UpdateWarehouseStatus updates the status of StarRocksWarehouse.

type SQLExecutor

type SQLExecutor struct {
	RootPassword  string
	FeServiceName string
	FeServicePort string
}

SQLExecutor is used to execute sql statements. Component CN needs to connect to mysql and execute sql statements. E.g.: When StarRocksWarehouse is deleted, the related 'DROP WAREHOUSE <name>' statement needs to be executed.

func NewSQLExecutor

func NewSQLExecutor(ctx context.Context, k8sClient client.Client, namespace, aliasName string) (*SQLExecutor, error)

NewSQLExecutor creates a SQLExecutor instance. It will get the root password, fe service name, and fe service port from the environment variables of the component CN.

func (*SQLExecutor) Execute

func (executor *SQLExecutor) Execute(ctx context.Context, db *sql.DB, statements string) error

Execute sql statements. Every time a SQL statement needs to be executed, a new sql.DB instance will be created. This is because SQL statements are executed infrequently.

Jump to

Keyboard shortcuts

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