Clone implements memberlist.Mergeable.
()
| 484 | |
| 485 | // Clone implements memberlist.Mergeable. |
| 486 | func (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 | |
| 500 | func (m *PartitionDesc) IsPending() bool { |
| 501 | return m.GetState() == PartitionPending |