MCPcopy
hub / github.com/grafana/dskit / ChangePartitionState

Method ChangePartitionState

ring/partition_ring_editor.go:29–33  ·  view source on GitHub ↗

ChangePartitionState changes the partition state to toState. This function returns ErrPartitionDoesNotExist if the partition doesn't exist, and ErrPartitionStateChangeNotAllowed if the state change is not allowed.

(ctx context.Context, partitionID int32, toState PartitionState)

Source from the content-addressed store, hash-verified

27// This function returns ErrPartitionDoesNotExist if the partition doesn't exist,
28// and ErrPartitionStateChangeNotAllowed if the state change is not allowed.
29func (l *PartitionRingEditor) ChangePartitionState(ctx context.Context, partitionID int32, toState PartitionState) error {
30 return l.updateRing(ctx, func(ring *PartitionRingDesc) (bool, error) {
31 return changePartitionState(ring, partitionID, toState)
32 })
33}
34
35func (l *PartitionRingEditor) RemoveMultiPartitionOwner(ctx context.Context, instanceID string, partitionID int32) error {
36 return l.updateRing(ctx, func(ring *PartitionRingDesc) (bool, error) {

Calls 2

updateRingMethod · 0.95
changePartitionStateFunction · 0.85