Documentation ¶
Index ¶
- type RisingWaveManager
- func (mgr *RisingWaveManager) IsOpenKruiseAvailable() bool
- func (mgr *RisingWaveManager) IsOpenKruiseEnabled() bool
- func (mgr *RisingWaveManager) KeepLock(aliveScaleView []risingwavev1alpha1.RisingWaveScaleViewLock)
- func (mgr *RisingWaveManager) RemoveCondition(conditionType risingwavev1alpha1.RisingWaveConditionType)
- func (mgr *RisingWaveManager) RisingWaveAfterImage() *risingwavev1alpha1.RisingWave
- func (mgr *RisingWaveManager) SyncObservedGeneration()
- func (mgr *RisingWaveManager) UpdateCondition(condition risingwavev1alpha1.RisingWaveCondition)
- func (mgr *RisingWaveManager) UpdateRemoteRisingWaveStatus(ctx context.Context) error
- func (mgr *RisingWaveManager) UpdateStatus(f func(*risingwavev1alpha1.RisingWaveStatus))
- type RisingWaveReader
- func (r *RisingWaveReader) DoesConditionExistAndEqual(conditionType risingwavev1alpha1.RisingWaveConditionType, value bool) bool
- func (r *RisingWaveReader) GetCondition(conditionType risingwavev1alpha1.RisingWaveConditionType) *risingwavev1alpha1.RisingWaveCondition
- func (r *RisingWaveReader) GetNodeGroup(component, group string) *risingwavev1alpha1.RisingWaveNodeGroup
- func (r *RisingWaveReader) GetNodeGroups(component string) []risingwavev1alpha1.RisingWaveNodeGroup
- func (r *RisingWaveReader) IsObservedGenerationOutdated() bool
- func (r *RisingWaveReader) IsStandaloneModeEnabled() bool
- func (r *RisingWaveReader) RisingWave() *risingwavev1alpha1.RisingWave
- type ScaleViewLockManager
- func (svl *ScaleViewLockManager) GetScaleViewLock(sv *risingwavev1alpha1.RisingWaveScaleView) *risingwavev1alpha1.RisingWaveScaleViewLock
- func (svl *ScaleViewLockManager) GrabOrUpdateScaleViewLockFor(sv *risingwavev1alpha1.RisingWaveScaleView) (bool, error)
- func (svl *ScaleViewLockManager) GrabScaleViewLockFor(sv *risingwavev1alpha1.RisingWaveScaleView) error
- func (svl *ScaleViewLockManager) IsScaleViewLocked(sv *risingwavev1alpha1.RisingWaveScaleView) bool
- func (svl *ScaleViewLockManager) ReleaseLockFor(sv *risingwavev1alpha1.RisingWaveScaleView) bool
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 ¶
func (r *RisingWaveReader) GetCondition(conditionType risingwavev1alpha1.RisingWaveConditionType) *risingwavev1alpha1.RisingWaveCondition
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 ¶
func (r *RisingWaveReader) RisingWave() *risingwavev1alpha1.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
func (svl *ScaleViewLockManager) GetScaleViewLock(sv *risingwavev1alpha1.RisingWaveScaleView) *risingwavev1alpha1.RisingWaveScaleViewLock
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
func (svl *ScaleViewLockManager) IsScaleViewLocked(sv *risingwavev1alpha1.RisingWaveScaleView) bool
IsScaleViewLocked checks if the RisingWaveScaleView locks the target RisingWave.
func (*ScaleViewLockManager) ReleaseLockFor ¶ added in v0.2.2
func (svl *ScaleViewLockManager) ReleaseLockFor(sv *risingwavev1alpha1.RisingWaveScaleView) bool
ReleaseLockFor releases the lock for the specified RisingWaveScaleView in memory, by removing the scale view record from the status field of the RisingWave object.