Documentation
¶
Index ¶
- type Engine
- type Implement
- type TemplateEngine
- func (t *TemplateEngine) CreateVolume() (err error)
- func (t *TemplateEngine) DeleteVolume() (err error)
- func (t *TemplateEngine) ID() string
- func (b *TemplateEngine) Setup(ctx cruntime.ReconcileRequestContext) (ready bool, err error)
- func (t *TemplateEngine) Shutdown() error
- func (t *TemplateEngine) Sync(ctx cruntime.ReconcileRequestContext) (err error)
- type UnderFileSystemService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 Implement ¶
type Implement interface {
UnderFileSystemService
// Is the master ready
CheckMasterReady() (ready bool, err error)
// are the workers ready
CheckWorkersReady() (ready bool, err error)
// IsSetupDone checks the setup is done
IsSetupDone() (done 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
// Destroy the Volume
DeleteVolume() (err error)
}
The real engine should implement
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) 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 ¶
func (t *TemplateEngine) Sync(ctx cruntime.ReconcileRequestContext) (err error)
SyncReplicas syncs the replicas
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.