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

Method Clone

ring/partition_ring_model.go:486–498  ·  view source on GitHub ↗

Clone implements memberlist.Mergeable.

()

Source from the content-addressed store, hash-verified

484
485// Clone implements memberlist.Mergeable.
486func (m *PartitionRingDesc) Clone() memberlist.Mergeable {
487 clone := proto.Clone(m).(*PartitionRingDesc)
488
489 // Ensure empty maps are preserved (easier to compare with a deep equal in tests).
490 if m.Partitions != nil && clone.Partitions == nil {
491 clone.Partitions = map[int32]PartitionDesc{}
492 }
493 if m.Owners != nil && clone.Owners == nil {
494 clone.Owners = map[string]OwnerDesc{}
495 }
496
497 return clone
498}
499
500func (m *PartitionDesc) IsPending() bool {
501 return m.GetState() == PartitionPending

Callers

nothing calls this directly

Calls 1

CloneMethod · 0.65

Tested by

no test coverage detected