object

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RisingWaveManager

type RisingWaveManager struct {
	RisingWaveReader
	// contains filtered or unexported fields
}

RisingWaveManager is a struct to help manipulate the RisingWave object in memory. It is concurrent-safe.

func NewRisingWaveManager

func NewRisingWaveManager(client client.Client, risingwave *risingwavev1alpha1.RisingWave, openkruiseAvailable bool) *RisingWaveManager

NewRisingWaveManager creates a new RisingWaveManager with given arguments.

func (*RisingWaveManager) IsOpenKruiseAvailable added in v0.2.4

func (mgr *RisingWaveManager) IsOpenKruiseAvailable() bool

IsOpenKruiseAvailable returns true when the OpenKruise is available.

func (*RisingWaveManager) IsOpenKruiseEnabled added in v0.2.4

func (mgr *RisingWaveManager) IsOpenKruiseEnabled() bool

IsOpenKruiseEnabled returns true when the OpenKruise is available and enabled on the target RisingWave.

func (*RisingWaveManager) KeepLock added in v0.2.4

func (mgr *RisingWaveManager) KeepLock(aliveScaleView []risingwavev1alpha1.RisingWaveScaleViewLock)

KeepLock resets the current scale views record in the status with the given array.

func (*RisingWaveManager) RemoveCondition

func (mgr *RisingWaveManager) RemoveCondition(conditionType risingwavev1alpha1.RisingWaveConditionType)

RemoveCondition removes the condition if the condition type matches.

func (*RisingWaveManager) RisingWaveAfterImage

func (mgr *RisingWaveManager) RisingWaveAfterImage() *risingwavev1alpha1.RisingWave

RisingWaveAfterImage returns a copy of the mutable RisingWave.

func (*RisingWaveManager) SyncObservedGeneration

func (mgr *RisingWaveManager) SyncObservedGeneration()

SyncObservedGeneration updates the observed generation to the current generation.

func (*RisingWaveManager) UpdateCondition

func (mgr *RisingWaveManager) UpdateCondition(condition risingwavev1alpha1.RisingWaveCondition)

UpdateCondition updates the conditions in the mutable copy and sets the last transition time automatically according to the latest conditions from the original status. It will append a new condition status when there's no such condition before.

func (*RisingWaveManager) UpdateRemoteRisingWaveStatus

func (mgr *RisingWaveManager) UpdateRemoteRisingWaveStatus(ctx context.Context) error

UpdateRemoteRisingWaveStatus updates the remote RisingWave object with the mutable copy.

func (*RisingWaveManager) UpdateStatus

func (mgr *RisingWaveManager) UpdateStatus(f func(*risingwavev1alpha1.RisingWaveStatus))

UpdateStatus receives a function to mutate the RisingWaveStatus and runs it within a lock.

type RisingWaveReader

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

RisingWaveReader is a reader for RisingWave object.

func NewRisingWaveReader

func NewRisingWaveReader(risingwave *risingwavev1alpha1.RisingWave) *RisingWaveReader

NewRisingWaveReader creates a RisingWaveReader.

func (*RisingWaveReader) DoesConditionExistAndEqual

func (r *RisingWaveReader) DoesConditionExistAndEqual(conditionType risingwavev1alpha1.RisingWaveConditionType, value bool) bool

DoesConditionExistAndEqual returns true if the condition is found and its value equals to the given one.

func (*RisingWaveReader) GetCondition

GetCondition gets the condition object by the given type. It returns nil when not found.

func (*RisingWaveReader) GetNodeGroup added in v0.4.0

func (r *RisingWaveReader) GetNodeGroup(component, group string) *risingwavev1alpha1.RisingWaveNodeGroup

GetNodeGroup gets the node groups of the given component and group. It panics when the component is unknown and returns nil when the node group isn't found.

func (*RisingWaveReader) GetNodeGroups added in v0.4.0

func (r *RisingWaveReader) GetNodeGroups(component string) []risingwavev1alpha1.RisingWaveNodeGroup

GetNodeGroups gets the node groups of the given component. It panics when the component is unknown.

func (*RisingWaveReader) IsObservedGenerationOutdated

func (r *RisingWaveReader) IsObservedGenerationOutdated() bool

IsObservedGenerationOutdated tells whether the observed generation is outdated.

func (*RisingWaveReader) IsStandaloneModeEnabled added in v0.5.4

func (r *RisingWaveReader) IsStandaloneModeEnabled() bool

IsStandaloneModeEnabled returns true when the standalone mode is enabled.

func (*RisingWaveReader) RisingWave

RisingWave returns the RisingWave immutable reference.

type ScaleViewLockManager added in v0.2.2

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

ScaleViewLockManager is a struct to help manage the in memory lock records under RisingWave status.

func NewScaleViewLockManager added in v0.2.2

func NewScaleViewLockManager(risingwave *risingwavev1alpha1.RisingWave) *ScaleViewLockManager

NewScaleViewLockManager creates a new ScaleViewLockManager with the given target.

func (*ScaleViewLockManager) GetScaleViewLock added in v0.2.2

GetScaleViewLock gets the scale view lock record from the RisingWave for the specified RisingWaveScaleView. It returns nil when not found.

func (*ScaleViewLockManager) GrabOrUpdateScaleViewLockFor added in v0.2.2

func (svl *ScaleViewLockManager) GrabOrUpdateScaleViewLockFor(sv *risingwavev1alpha1.RisingWaveScaleView) (bool, error)

GrabOrUpdateScaleViewLockFor creates or updates the scale view record in the RisingWave object for the specified RisingWaveScaleView. It returns true when the lock is grabbed or updated. If nothing happens, it should return false, nil.

func (*ScaleViewLockManager) GrabScaleViewLockFor added in v0.2.2

func (svl *ScaleViewLockManager) GrabScaleViewLockFor(sv *risingwavev1alpha1.RisingWaveScaleView) error

GrabScaleViewLockFor grabs the lock for the specified RisingWaveScaleView by creating a new scale view record in the RisingWave status. It will return error when fails to grab the lock, e.g., it's already locked or there are conflicts.

func (*ScaleViewLockManager) IsScaleViewLocked added in v0.2.2

IsScaleViewLocked checks if the RisingWaveScaleView locks the target RisingWave.

func (*ScaleViewLockManager) ReleaseLockFor added in v0.2.2

ReleaseLockFor releases the lock for the specified RisingWaveScaleView in memory, by removing the scale view record from the status field of the RisingWave object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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