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)
| 27 | // This function returns ErrPartitionDoesNotExist if the partition doesn't exist, |
| 28 | // and ErrPartitionStateChangeNotAllowed if the state change is not allowed. |
| 29 | func (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 | |
| 35 | func (l *PartitionRingEditor) RemoveMultiPartitionOwner(ctx context.Context, instanceID string, partitionID int32) error { |
| 36 | return l.updateRing(ctx, func(ring *PartitionRingDesc) (bool, error) { |