Skip to content

Commit

Permalink
storage: add Store.VisitReplicas
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
tbg committed Feb 11, 2019
1 parent 2990b96 commit 3878b12
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/storage/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1788,6 +1788,13 @@ func (s *Store) GossipDeadReplicas(ctx context.Context) error {
return s.cfg.Gossip.AddInfoProto(key, &deadReplicas, gossip.StoreTTL)
}

// VisitReplicas invokes the visitor on the Store's Replicas until the visitor returns false.
// Replicas which are added to the Store after iteration begins may or may not be observed.
func (s *Store) VisitReplicas(visitor func(*Replica) bool) {
v := newStoreReplicaVisitor(s)
v.Visit(visitor)
}

// Bootstrap writes a new store ident to the underlying engine. To
// ensure that no crufty data already exists in the engine, it scans
// the engine contents before writing the new store ident. The engine
Expand Down

0 comments on commit 3878b12

Please sign in to comment.