base

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachePath added in v0.5.0

type CachePath struct {
	Path string

	Quota *resource.Quantity
}

type Engine

type Engine interface {
	// ID returns the id
	ID() string

	// Shutdown and clean up the engine
	Shutdown() error

	// Setup the engine
	Setup(ctx cruntime.ReconcileRequestContext) (ready bool, err error)

	// Setup the Volume
	CreateVolume() (err error)

	// Destroy the Volume
	DeleteVolume() (err error)

	// Sync syncs the alluxio runtime
	Sync(ctx cruntime.ReconcileRequestContext) error
}

Engine interface defines the interfaces that should be implemented by a distributed data caching Engine. Thread safety is required from implementations of this interface.

type Fuse added in v0.5.0

type Fuse struct {
	// fuse is deployed in global mode
	Global bool

	NodeSelector map[string]string
}

type Implement

type Implement interface {
	UnderFileSystemService
	// Is the master ready
	CheckMasterReady() (ready bool, err error)
	// are the workers ready
	CheckWorkersReady() (ready bool, err error)
	// ShouldSetupMaster checks if we need setup the master
	ShouldSetupMaster() (should bool, err error)
	// ShouldSetupWorkers checks if we need setup the workers
	ShouldSetupWorkers() (should bool, err error)

	ShouldCheckUFS() (should bool, err error)
	// setup the cache master
	SetupMaster() (err error)
	// setup the cache worker
	SetupWorkers() (err error)
	// check if it's Bound to the dataset
	// IsBoundToDataset() (bound bool, err error)
	// Bind to the dataset
	UpdateDatasetStatus(phase datav1alpha1.DatasetPhase) (err error)
	// Prepare the mounts and metadata if it's not ready
	PrepareUFS() (err error)
	// Shutdown and clean up the engine
	Shutdown() error

	// AssignNodesToCache picks up the nodes for replicas
	AssignNodesToCache(desiredNum int32) (currentNum int32, err error)
	// CheckRuntimeHealthy checks runtime healthy
	CheckRuntimeHealthy() (err error)
	// UpdateCacheOfDataset updates cache of the dataset
	UpdateCacheOfDataset() (err error)
	// CheckAndUpdateRuntimeStatus checks and updates the status
	CheckAndUpdateRuntimeStatus() (ready bool, err error)

	CreateVolume() error

	// SyncReplicas syncs the replicas
	SyncReplicas(ctx cruntime.ReconcileRequestContext) error

	// SyncMetadata syncs all metadata from UFS
	SyncMetadata() (err error)

	// Destroy the Volume
	DeleteVolume() (err error)

	// BindToDataset binds the engine to dataset
	BindToDataset() (err error)
}

The real engine should implement

type Level added in v0.5.0

type Level struct {
	MediumType common.MediumType

	CachePaths []CachePath

	High string

	Low string
}

type RuntimeInfo added in v0.5.0

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

The real Runtime Info should implement

func (*RuntimeInfo) GetCommonLabelname added in v0.5.0

func (info *RuntimeInfo) GetCommonLabelname() string

func (*RuntimeInfo) GetFuseDeployMode added in v0.5.0

func (info *RuntimeInfo) GetFuseDeployMode() (global bool, nodeSelector map[string]string)

GetFuseDeployMode gets the fuse deploy mode

func (*RuntimeInfo) GetName added in v0.5.0

func (info *RuntimeInfo) GetName() string

GetName gets name

func (*RuntimeInfo) GetNamespace added in v0.5.0

func (info *RuntimeInfo) GetNamespace() string

GetNamespace gets namespace

func (*RuntimeInfo) GetRuntimeLabelname added in v0.5.0

func (info *RuntimeInfo) GetRuntimeLabelname() string

func (*RuntimeInfo) GetRuntimeType added in v0.5.0

func (info *RuntimeInfo) GetRuntimeType() string

GetRuntimeType gets runtime type

func (*RuntimeInfo) GetStoragetLabelname added in v0.5.0

func (info *RuntimeInfo) GetStoragetLabelname(read common.ReadType, storage common.StorageType) string

func (*RuntimeInfo) GetTieredstoreInfo added in v0.5.0

func (info *RuntimeInfo) GetTieredstoreInfo() TieredstoreInfo

func (*RuntimeInfo) IsExclusive added in v0.5.0

func (info *RuntimeInfo) IsExclusive() bool

IsExclusive determines if the runtime is exlusive

func (*RuntimeInfo) SetupFuseDeployMode added in v0.5.0

func (info *RuntimeInfo) SetupFuseDeployMode(global bool, nodeSelector map[string]string)

SetupFuseDeployMode setups the fuse deploy mode

func (*RuntimeInfo) SetupWithDataset added in v0.5.0

func (info *RuntimeInfo) SetupWithDataset(dataset *datav1alpha1.Dataset)

SetupWithDataset determines if need to setup with the info of dataset

type RuntimeInfoInterface added in v0.5.0

type RuntimeInfoInterface interface {
	GetTieredstoreInfo() TieredstoreInfo

	GetName() string

	GetNamespace() string

	GetRuntimeType() string

	GetStoragetLabelname(read common.ReadType, storage common.StorageType) string

	GetCommonLabelname() string

	GetRuntimeLabelname() string

	IsExclusive() bool

	SetupFuseDeployMode(global bool, nodeSelector map[string]string)

	SetupWithDataset(dataset *datav1alpha1.Dataset)

	GetFuseDeployMode() (global bool, nodeSelector map[string]string)
}

Runtime Information interface defines the interfaces that should be implemented by Alluxio Runtime or other implementation . Thread safety is required from implementations of this interface.

func BuildRuntimeInfo added in v0.5.0

func BuildRuntimeInfo(name string,
	namespace string,
	runtimeType string,
	tieredstore datav1alpha1.Tieredstore) (runtime RuntimeInfoInterface, err error)

type TemplateEngine

type TemplateEngine struct {
	Implement
	Id string
	client.Client
	Log     logr.Logger
	Context cruntime.ReconcileRequestContext
}

func NewTemplateEngine

func NewTemplateEngine(impl Implement,
	id string,

	context cruntime.ReconcileRequestContext) *TemplateEngine

NewTemplateEngine creates template engine

func (*TemplateEngine) CreateVolume

func (t *TemplateEngine) CreateVolume() (err error)

Setup the CSI

func (*TemplateEngine) DeleteVolume

func (t *TemplateEngine) DeleteVolume() (err error)

Setup the CSI

func (*TemplateEngine) ID

func (t *TemplateEngine) ID() string

ID returns the id of the engine

func (*TemplateEngine) Setup

func (b *TemplateEngine) Setup(ctx cruntime.ReconcileRequestContext) (ready bool, err error)

Setup the ddc engine

func (*TemplateEngine) Shutdown

func (t *TemplateEngine) Shutdown() error

Shutdown and clean up the engine

func (*TemplateEngine) Sync

SyncReplicas syncs the replicas

type TieredstoreInfo added in v0.5.0

type TieredstoreInfo struct {
	Levels []Level
}

type UnderFileSystemService

type UnderFileSystemService interface {
	UsedStorageBytes() (int64, error)

	FreeStorageBytes() (int64, error)

	TotalStorageBytes() (int64, error)

	TotalFileNums() (int64, error)
}

UnderFileSystemService interface defines the interfaces that should be implemented by a underlayer fileSystem service for the data. The implementation is the underlayer file system connector. It is responsible for checking ufs and preload the data. Thread safety is required from implementations of this interface.

Directories

Path Synopsis
Package base is a generated GoMock package.
Package base is a generated GoMock package.

Jump to

Keyboard shortcuts

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