domain

package
v0.0.0-...-693d502 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FsIdGenerator

func FsIdGenerator(cluster *SharedStorageCluster) (string, error)

func GetParamValue

func GetParamValue(paramItems map[string]*commondomain.ParamItem, paramName string) (*commondomain.ParamItem, error)

Types

type ILocalStorageClusterRepository

type ILocalStorageClusterRepository interface {

	/**
	 * @Description: 获得所有LocalStorageCluster元数据
	 * @return []domain.LocalStorageCluster
	 * @return error
	 */
	GetAll() ([]*LocalStorageCluster, error)

	/**
	 * @Description: 根据名称获取LocalStorageCluster元数据
	 * @param name
	 * @param namespace
	 * @return *domain.LocalStorageCluster
	 */
	GetByName(name, namespace string) (*LocalStorageCluster, error)

	/**
	 * @Description: 根据视图模型获取LocalStorageCluster元数据
	 * @param data
	 * @return *domain.LocalStorageCluster
	 */
	GetByData(data interface{}, useModifyClass bool, useUpgradeVersion bool) *LocalStorageCluster

	/**
	 * @Description: 创建LocalStorageCluster
	 * @param *domain.LocalStorageCluster
	 * @return error
	 */
	Create(*LocalStorageCluster) error

	/**
	 * @Description: 更新LocalStorageCluster
	 * @param *domain.LocalStorageCluster
	 * @return error
	 */
	Update(*LocalStorageCluster) error

	/**
	 * @Description: 将LocalStorageCluster状态设置为Running
	 * @param name
	 * @param namespace
	 * @return error
	 */
	UpdateRunningStatus(name, namespace string) error
}

*

  • @Description: LocalStorageCluster元数据存储

type ISharedStorageClusterRepository

type ISharedStorageClusterRepository interface {

	/**
	 * @Description: 获得所有SharedStorageCluster元数据
	 * @return []domain.SharedStorageCluster
	 * @return error
	 */
	GetAll() ([]*SharedStorageCluster, error)

	/**
	 * @Description: 根据名称获取SharedStorageCluster元数据
	 * @param name
	 * @param namespace
	 * @return *domain.SharedStorageCluster
	 */
	GetByName(name, namespace string) (*SharedStorageCluster, error)

	/**
	 * @Description: 根据视图模型获取SharedStorageCluster元数据
	 * @param data
	 * @return *domain.SharedStorageCluster
	 */
	GetByData(data interface{}, useModifyClass bool, useUpgradeVersion bool) *SharedStorageCluster

	/**
	 * @Description: 创建SharedStorageCluster
	 * @param *domain.SharedStorageCluster
	 * @return error
	 */
	Create(*SharedStorageCluster) error

	/**
	 * @Description: 更新SharedStorageCluster
	 * @param *domain.SharedStorageCluster
	 * @return error
	 */
	Update(*SharedStorageCluster) error

	/**
	 * @Description: 将SharedStorageCluster状态设置为Running
	 * @param name
	 * @param namespace
	 * @return error
	 */
	UpdateRunningStatus(name, namespace string) error

	/**
	 * @Description: 更新引擎状态
	 * @param name
	 * @param namespace
	 * @return error
	 */
	UpdateInsStatus(*SharedStorageCluster) error
}

*

  • @Description: SharedStorageCluster元数据存储

type LocalStorageCluster

type LocalStorageCluster struct {
	commondomain.DbClusterBase
	RoReplicas int
	Port       int

	Ins         *commondomain.DbIns
	FollowerIns []*commondomain.DbIns
	// contains filtered or unexported fields
}

func (*LocalStorageCluster) Init

func (cluster *LocalStorageCluster) Init(
	podManager commondomain.IEnginePodManager,
	idGeneragor commondomain.IIdGenerator,
	portGenerator commondomain.IPortGenerator,
	managerClient commondomain.IManagerClient,
	logger logr.Logger,
)

func (*LocalStorageCluster) InitDbInsMeta

func (cluster *LocalStorageCluster) InitDbInsMeta() error

type SharedStorageCluster

type SharedStorageCluster struct {
	commondomain.SharedStorageDbClusterBase
	RoReplicas  int
	Port        int
	RwIns       *commondomain.DbIns
	RoInses     map[string]*commondomain.DbIns
	TempRoInses map[string]*commondomain.DbIns
	TempRoIds   map[string]string
	// contains filtered or unexported fields
}

func (*SharedStorageCluster) AddInsToClusterManager

func (cluster *SharedStorageCluster) AddInsToClusterManager(ctx context.Context, rwInsId string, roInsIds ...string) error

func (*SharedStorageCluster) ConvertTempRoForRwToRo

func (cluster *SharedStorageCluster) ConvertTempRoForRwToRo() string

func (*SharedStorageCluster) DeleteOldIns

func (cluster *SharedStorageCluster) DeleteOldIns(ctx context.Context, physicalId string, newInsId string, deleteOldInsMeta, minusRoReplicas bool) error

func (*SharedStorageCluster) EnsureInsTypeMeta

func (cluster *SharedStorageCluster) EnsureInsTypeMeta(ctx context.Context) error

func (*SharedStorageCluster) FlushClusterParams

func (cluster *SharedStorageCluster) FlushClusterParams(ctx context.Context) (needRestart bool, err error)

*

  • @Description: 执行刷参
  • @receiver ins
  • @return error

func (*SharedStorageCluster) FlushParamsIfNecessary

func (cluster *SharedStorageCluster) FlushParamsIfNecessary(ctx context.Context) error

func (*SharedStorageCluster) GenerateTempRoIds

func (cluster *SharedStorageCluster) GenerateTempRoIds(ctx context.Context, physicalInsIds ...string) error

func (*SharedStorageCluster) GrowStorage

func (cluster *SharedStorageCluster) GrowStorage(ctx context.Context) error

func (*SharedStorageCluster) Init

func (*SharedStorageCluster) InitDbInsMeta

func (cluster *SharedStorageCluster) InitDbInsMeta() error

func (*SharedStorageCluster) InitMeta

func (cluster *SharedStorageCluster) InitMeta() (err error)

func (*SharedStorageCluster) InitTempRoInsMeta

func (cluster *SharedStorageCluster) InitTempRoInsMeta(ctx context.Context) error

func (*SharedStorageCluster) RemoveInsFromClusterManager

func (cluster *SharedStorageCluster) RemoveInsFromClusterManager(ctx context.Context, insIds ...string) error

func (*SharedStorageCluster) RestartCluster

func (cluster *SharedStorageCluster) RestartCluster(ctx context.Context) error

func (*SharedStorageCluster) RestartIns

func (cluster *SharedStorageCluster) RestartIns(ctx context.Context, insId string) error

func (*SharedStorageCluster) SetInsState

func (cluster *SharedStorageCluster) SetInsState(ctx context.Context, clientEndpoint, state, startAt, reason string) (bool, error)

func (*SharedStorageCluster) SetRw

func (cluster *SharedStorageCluster) SetRw(ctx context.Context, newRwEndpoint string) (bool, error)

func (*SharedStorageCluster) SwitchNewRoToRw

func (cluster *SharedStorageCluster) SwitchNewRoToRw(ctx context.Context) (newRwId string, err error)

func (*SharedStorageCluster) Switchover

func (cluster *SharedStorageCluster) Switchover(ctx context.Context, newRwInsId string) error

func (*SharedStorageCluster) SyncInsStateFromClusterManager

func (cluster *SharedStorageCluster) SyncInsStateFromClusterManager(ctx context.Context) (bool, error)

func (*SharedStorageCluster) WaitForEngineReady

func (cluster *SharedStorageCluster) WaitForEngineReady(ctx context.Context, resourceName string) error

Jump to

Keyboard shortcuts

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