2 * Copyright (c) 2015 Brocade Communications Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.cluster.datastore.entityownership;
10 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.CANDIDATE_NODE_ID;
11 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_ID_NODE_ID;
12 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_ID_QNAME;
13 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_NODE_ID;
14 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_OWNERS_PATH;
15 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_OWNER_NODE_ID;
16 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_OWNER_QNAME;
17 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_TYPES_PATH;
18 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_TYPE_NODE_ID;
19 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_TYPE_QNAME;
20 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.candidateMapEntry;
21 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.candidateNodeKey;
22 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.candidatePath;
23 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.createEntity;
24 import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.entityOwnersWithCandidate;
25 import akka.actor.ActorRef;
26 import akka.actor.ActorSelection;
27 import akka.actor.Cancellable;
28 import akka.pattern.Patterns;
29 import com.google.common.base.Optional;
30 import com.google.common.base.Preconditions;
31 import com.google.common.base.Strings;
32 import java.util.ArrayList;
33 import java.util.Collection;
34 import java.util.HashMap;
35 import java.util.HashSet;
38 import java.util.concurrent.TimeUnit;
39 import org.opendaylight.controller.cluster.datastore.DatastoreContext;
40 import org.opendaylight.controller.cluster.datastore.Shard;
41 import org.opendaylight.controller.cluster.datastore.entityownership.messages.CandidateAdded;
42 import org.opendaylight.controller.cluster.datastore.entityownership.messages.CandidateRemoved;
43 import org.opendaylight.controller.cluster.datastore.entityownership.messages.RegisterCandidateLocal;
44 import org.opendaylight.controller.cluster.datastore.entityownership.messages.RegisterListenerLocal;
45 import org.opendaylight.controller.cluster.datastore.entityownership.messages.SelectOwner;
46 import org.opendaylight.controller.cluster.datastore.entityownership.messages.UnregisterCandidateLocal;
47 import org.opendaylight.controller.cluster.datastore.entityownership.messages.UnregisterListenerLocal;
48 import org.opendaylight.controller.cluster.datastore.entityownership.selectionstrategy.EntityOwnerSelectionStrategy;
49 import org.opendaylight.controller.cluster.datastore.entityownership.selectionstrategy.EntityOwnerSelectionStrategyConfig;
50 import org.opendaylight.controller.cluster.datastore.identifiers.ShardIdentifier;
51 import org.opendaylight.controller.cluster.datastore.messages.BatchedModifications;
52 import org.opendaylight.controller.cluster.datastore.messages.PeerDown;
53 import org.opendaylight.controller.cluster.datastore.messages.PeerUp;
54 import org.opendaylight.controller.cluster.datastore.messages.SuccessReply;
55 import org.opendaylight.controller.cluster.datastore.modification.DeleteModification;
56 import org.opendaylight.controller.cluster.datastore.modification.MergeModification;
57 import org.opendaylight.controller.cluster.datastore.modification.WriteModification;
58 import org.opendaylight.controller.md.sal.common.api.clustering.Entity;
59 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
60 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
61 import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild;
62 import org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode;
63 import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
64 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
65 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
66 import scala.concurrent.Future;
67 import scala.concurrent.duration.FiniteDuration;
70 * Special Shard for EntityOwnership.
72 * @author Thomas Pantelis
74 class EntityOwnershipShard extends Shard {
75 private final String localMemberName;
76 private final EntityOwnershipShardCommitCoordinator commitCoordinator;
77 private final EntityOwnershipListenerSupport listenerSupport;
78 private final Set<String> downPeerMemberNames = new HashSet<>();
79 private final Map<String, String> peerIdToMemberNames = new HashMap<>();
80 private final EntityOwnerSelectionStrategyConfig strategyConfig;
81 private final Map<YangInstanceIdentifier, Cancellable> entityToScheduledOwnershipTask = new HashMap<>();
82 private final EntityOwnershipStatistics entityOwnershipStatistics;
84 private static DatastoreContext noPersistenceDatastoreContext(DatastoreContext datastoreContext) {
85 return DatastoreContext.newBuilderFrom(datastoreContext).persistent(false).build();
88 protected EntityOwnershipShard(Builder builder) {
90 this.localMemberName = builder.localMemberName;
91 this.commitCoordinator = new EntityOwnershipShardCommitCoordinator(builder.localMemberName, LOG);
92 this.listenerSupport = new EntityOwnershipListenerSupport(getContext(), persistenceId());
93 this.strategyConfig = builder.ownerSelectionStrategyConfig;
94 this.entityOwnershipStatistics = new EntityOwnershipStatistics();
95 this.entityOwnershipStatistics.init(getDataStore());
97 for(String peerId: getRaftActorContext().getPeerIds()) {
98 ShardIdentifier shardId = ShardIdentifier.builder().fromShardIdString(peerId).build();
99 peerIdToMemberNames.put(peerId, shardId.getMemberName());
104 protected void onDatastoreContext(DatastoreContext context) {
105 super.onDatastoreContext(noPersistenceDatastoreContext(context));
109 protected void onRecoveryComplete() {
110 super.onRecoveryComplete();
112 new CandidateListChangeListener(getSelf(), persistenceId()).init(getDataStore());
113 new EntityOwnerChangeListener(localMemberName, listenerSupport).init(getDataStore());
117 public void onReceiveCommand(final Object message) throws Exception {
118 if(message instanceof RegisterCandidateLocal) {
119 onRegisterCandidateLocal((RegisterCandidateLocal) message);
120 } else if(message instanceof UnregisterCandidateLocal) {
121 onUnregisterCandidateLocal((UnregisterCandidateLocal)message);
122 } else if(message instanceof CandidateAdded){
123 onCandidateAdded((CandidateAdded) message);
124 } else if(message instanceof CandidateRemoved){
125 onCandidateRemoved((CandidateRemoved) message);
126 } else if(message instanceof PeerDown) {
127 onPeerDown((PeerDown) message);
128 } else if(message instanceof PeerUp) {
129 onPeerUp((PeerUp) message);
130 } else if(message instanceof RegisterListenerLocal) {
131 onRegisterListenerLocal((RegisterListenerLocal)message);
132 } else if(message instanceof UnregisterListenerLocal) {
133 onUnregisterListenerLocal((UnregisterListenerLocal) message);
134 } else if(message instanceof SelectOwner) {
135 onSelectOwner((SelectOwner) message);
136 } else if(!commitCoordinator.handleMessage(message, this)) {
137 super.onReceiveCommand(message);
141 private void onSelectOwner(SelectOwner selectOwner) {
142 LOG.debug("{}: onSelectOwner: {}", persistenceId(), selectOwner);
144 String currentOwner = getCurrentOwner(selectOwner.getEntityPath());
145 if(Strings.isNullOrEmpty(currentOwner)) {
146 String entityType = EntityOwnersModel.entityTypeFromEntityPath(selectOwner.getEntityPath());
147 writeNewOwner(selectOwner.getEntityPath(), newOwner(selectOwner.getAllCandidates(),
148 entityOwnershipStatistics.byEntityType(entityType),
149 selectOwner.getOwnerSelectionStrategy()));
151 Cancellable cancellable = entityToScheduledOwnershipTask.get(selectOwner.getEntityPath());
152 if(cancellable != null){
153 if(!cancellable.isCancelled()){
154 cancellable.cancel();
156 entityToScheduledOwnershipTask.remove(selectOwner.getEntityPath());
161 private void onRegisterCandidateLocal(RegisterCandidateLocal registerCandidate) {
162 LOG.debug("{}: onRegisterCandidateLocal: {}", persistenceId(), registerCandidate);
164 listenerSupport.setHasCandidateForEntity(registerCandidate.getEntity());
166 NormalizedNode<?, ?> entityOwners = entityOwnersWithCandidate(registerCandidate.getEntity().getType(),
167 registerCandidate.getEntity().getId(), localMemberName);
168 commitCoordinator.commitModification(new MergeModification(ENTITY_OWNERS_PATH, entityOwners), this);
170 getSender().tell(SuccessReply.INSTANCE, getSelf());
173 private void onUnregisterCandidateLocal(UnregisterCandidateLocal unregisterCandidate) {
174 LOG.debug("{}: onUnregisterCandidateLocal: {}", persistenceId(), unregisterCandidate);
176 Entity entity = unregisterCandidate.getEntity();
177 listenerSupport.unsetHasCandidateForEntity(entity);
179 YangInstanceIdentifier candidatePath = candidatePath(entity.getType(), entity.getId(), localMemberName);
180 commitCoordinator.commitModification(new DeleteModification(candidatePath), this);
182 getSender().tell(SuccessReply.INSTANCE, getSelf());
185 private void onRegisterListenerLocal(final RegisterListenerLocal registerListener) {
186 LOG.debug("{}: onRegisterListenerLocal: {}", persistenceId(), registerListener);
188 listenerSupport.addEntityOwnershipListener(registerListener.getEntityType(), registerListener.getListener());
190 getSender().tell(SuccessReply.INSTANCE, getSelf());
192 searchForEntitiesOwnedBy(localMemberName, new EntityWalker() {
194 public void onEntity(MapEntryNode entityTypeNode, MapEntryNode entityNode) {
195 Optional<DataContainerChild<? extends PathArgument, ?>> possibleType =
196 entityTypeNode.getChild(ENTITY_TYPE_NODE_ID);
197 String entityType = possibleType.isPresent() ? possibleType.get().getValue().toString() : null;
198 if (registerListener.getEntityType().equals(entityType)) {
199 Entity entity = new Entity(entityType,
200 (YangInstanceIdentifier) entityNode.getChild(ENTITY_ID_NODE_ID).get().getValue());
201 listenerSupport.notifyEntityOwnershipListener(entity, false, true, true, registerListener.getListener());
207 private void onUnregisterListenerLocal(UnregisterListenerLocal unregisterListener) {
208 LOG.debug("{}: onUnregisterListenerLocal: {}", persistenceId(), unregisterListener);
210 listenerSupport.removeEntityOwnershipListener(unregisterListener.getEntityType(), unregisterListener.getListener());
212 getSender().tell(SuccessReply.INSTANCE, getSelf());
215 void tryCommitModifications(final BatchedModifications modifications) {
217 LOG.debug("{}: Committing BatchedModifications {} locally", persistenceId(), modifications.getTransactionID());
219 // Note that it's possible the commit won't get consensus and will timeout and not be applied
220 // to the state. However we don't need to retry it in that case b/c it will be committed to
221 // the journal first and, once a majority of followers come back on line and it is replicated,
222 // it will be applied at that point.
223 handleBatchedModificationsLocal(modifications, self());
225 final ActorSelection leader = getLeader();
226 if (leader != null) {
227 if(LOG.isDebugEnabled()) {
228 LOG.debug("{}: Sending BatchedModifications {} to leader {}", persistenceId(),
229 modifications.getTransactionID(), leader);
232 Future<Object> future = Patterns.ask(leader, modifications, TimeUnit.SECONDS.toMillis(
233 getDatastoreContext().getShardTransactionCommitTimeoutInSeconds()));
235 Patterns.pipe(future, getContext().dispatcher()).pipeTo(getSelf(), ActorRef.noSender());
240 boolean hasLeader() {
241 return getLeader() != null && !isIsolatedLeader();
245 protected void onStateChanged() {
246 super.onStateChanged();
248 boolean isLeader = isLeader();
249 if(LOG.isDebugEnabled()) {
250 LOG.debug("{}: onStateChanged: isLeader: {}, hasLeader: {}", persistenceId(), isLeader, hasLeader());
253 commitCoordinator.onStateChanged(this, isLeader);
257 protected void onLeaderChanged(String oldLeader, String newLeader) {
258 super.onLeaderChanged(oldLeader, newLeader);
260 boolean isLeader = isLeader();
261 LOG.debug("{}: onLeaderChanged: oldLeader: {}, newLeader: {}, isLeader: {}", persistenceId(), oldLeader,
262 newLeader, isLeader);
265 // We were just elected leader. If the old leader is down, select new owners for the entities
266 // owned by the down leader.
268 String oldLeaderMemberName = peerIdToMemberNames.get(oldLeader);
270 LOG.debug("{}: oldLeaderMemberName: {}", persistenceId(), oldLeaderMemberName);
272 if(downPeerMemberNames.contains(oldLeaderMemberName)) {
273 removeCandidateFromEntities(oldLeaderMemberName);
276 // The leader changed - notify the coordinator to check if pending modifications need to be sent.
277 // While onStateChanged also does this, this method handles the case where the shard hears from a
278 // leader and stays in the follower state. In that case no behavior state change occurs.
279 commitCoordinator.onStateChanged(this, isLeader);
283 private void onCandidateRemoved(CandidateRemoved message) {
284 LOG.debug("{}: onCandidateRemoved: {}", persistenceId(), message);
287 String currentOwner = getCurrentOwner(message.getEntityPath());
288 if(message.getRemovedCandidate().equals(currentOwner) || message.getRemainingCandidates().size() == 0){
289 String entityType = EntityOwnersModel.entityTypeFromEntityPath(message.getEntityPath());
290 writeNewOwner(message.getEntityPath(),
291 newOwner(message.getRemainingCandidates(), entityOwnershipStatistics.byEntityType(entityType),
292 getEntityOwnerElectionStrategy(message.getEntityPath())));
295 // We're not the leader. If the removed candidate is our local member then check if we actually
296 // have a local candidate registered. If we do then we must have been partitioned from the leader
297 // and the leader removed our candidate since the leader can't tell the difference between a
298 // temporary network partition and a node's process actually restarted. So, in that case, re-add
300 if(localMemberName.equals(message.getRemovedCandidate()) &&
301 listenerSupport.hasCandidateForEntity(createEntity(message.getEntityPath()))) {
302 LOG.debug("Local candidate member was removed but a local candidate is registered for {}" +
303 " - adding back local candidate", message.getEntityPath());
305 commitCoordinator.commitModification(new MergeModification(
306 candidatePath(message.getEntityPath(), localMemberName),
307 candidateMapEntry(localMemberName)), this);
312 private EntityOwnerSelectionStrategy getEntityOwnerElectionStrategy(YangInstanceIdentifier entityPath) {
313 final String entityType = EntityOwnersModel.entityTypeFromEntityPath(entityPath);
314 return strategyConfig.createStrategy(entityType);
317 private void onCandidateAdded(CandidateAdded message) {
322 LOG.debug("{}: onCandidateAdded: {}", persistenceId(), message);
324 // Since a node's candidate member is only added by the node itself, we can assume the node is up so
325 // remove it from the downPeerMemberNames.
326 downPeerMemberNames.remove(message.getNewCandidate());
328 final String currentOwner = getCurrentOwner(message.getEntityPath());
329 final EntityOwnerSelectionStrategy strategy = getEntityOwnerElectionStrategy(message.getEntityPath());
330 final String entityType = EntityOwnersModel.entityTypeFromEntityPath(message.getEntityPath());
332 // Available members is all the known peers - the number of peers that are down + self
333 // So if there are 2 peers and 1 is down then availableMembers will be 2
334 final int availableMembers = (peerIdToMemberNames.size() - downPeerMemberNames.size()) + 1;
336 LOG.debug("{}: Using strategy {} to select owner", persistenceId(), strategy);
337 if(Strings.isNullOrEmpty(currentOwner)){
338 if(strategy.getSelectionDelayInMillis() == 0L) {
339 writeNewOwner(message.getEntityPath(), newOwner(message.getAllCandidates(),
340 entityOwnershipStatistics.byEntityType(entityType), strategy));
341 } else if(message.getAllCandidates().size() == availableMembers) {
342 LOG.debug("{}: Received the maximum candidates requests : {} writing new owner",
343 persistenceId(), availableMembers);
344 cancelOwnerSelectionTask(message.getEntityPath());
345 writeNewOwner(message.getEntityPath(), newOwner(message.getAllCandidates(),
346 entityOwnershipStatistics.byEntityType(entityType), strategy));
348 scheduleOwnerSelection(message.getEntityPath(), message.getAllCandidates(), strategy);
353 private void onPeerDown(PeerDown peerDown) {
354 LOG.info("{}: onPeerDown: {}", persistenceId(), peerDown);
356 String downMemberName = peerDown.getMemberName();
357 if(downPeerMemberNames.add(downMemberName) && isLeader()) {
358 // Remove the down peer as a candidate from all entities.
359 removeCandidateFromEntities(downMemberName);
363 private void onPeerUp(PeerUp peerUp) {
364 LOG.debug("{}: onPeerUp: {}", persistenceId(), peerUp);
366 peerIdToMemberNames.put(peerUp.getPeerId(), peerUp.getMemberName());
367 downPeerMemberNames.remove(peerUp.getMemberName());
369 // Notify the coordinator to check if pending modifications need to be sent. We do this here
370 // to handle the case where the leader's peer address isn't now yet when a prior state or
371 // leader change occurred.
372 commitCoordinator.onStateChanged(this, isLeader());
375 private void removeCandidateFromEntities(final String owner) {
376 final BatchedModifications modifications = commitCoordinator.newBatchedModifications();
377 searchForEntities(new EntityWalker() {
379 public void onEntity(MapEntryNode entityTypeNode, MapEntryNode entityNode) {
380 if (hasCandidate(entityNode, owner)) {
381 YangInstanceIdentifier entityId =
382 (YangInstanceIdentifier) entityNode.getIdentifier().getKeyValues().get(ENTITY_ID_QNAME);
383 YangInstanceIdentifier candidatePath = candidatePath(
384 entityTypeNode.getIdentifier().getKeyValues().get(ENTITY_TYPE_QNAME).toString(),
387 LOG.info("{}: Found entity {}, removing candidate {}, path {}", persistenceId(), entityId,
388 owner, candidatePath);
390 modifications.addModification(new DeleteModification(candidatePath));
395 commitCoordinator.commitModifications(modifications, this);
398 private static boolean hasCandidate(MapEntryNode entity, String candidateName) {
399 return ((MapNode)entity.getChild(CANDIDATE_NODE_ID).get()).getChild(candidateNodeKey(candidateName)).isPresent();
402 private void searchForEntitiesOwnedBy(final String owner, final EntityWalker walker) {
403 Optional<NormalizedNode<?, ?>> possibleEntityTypes = getDataStore().readNode(ENTITY_TYPES_PATH);
404 if(!possibleEntityTypes.isPresent()) {
408 LOG.debug("{}: Searching for entities owned by {}", persistenceId(), owner);
410 searchForEntities(new EntityWalker() {
412 public void onEntity(MapEntryNode entityTypeNode, MapEntryNode entityNode) {
413 Optional<DataContainerChild<? extends PathArgument, ?>> possibleOwner =
414 entityNode.getChild(ENTITY_OWNER_NODE_ID);
415 if (possibleOwner.isPresent() && owner.equals(possibleOwner.get().getValue().toString())) {
416 walker.onEntity(entityTypeNode, entityNode);
422 private void searchForEntities(EntityWalker walker) {
423 Optional<NormalizedNode<?, ?>> possibleEntityTypes = getDataStore().readNode(ENTITY_TYPES_PATH);
424 if(!possibleEntityTypes.isPresent()) {
428 for(MapEntryNode entityType: ((MapNode) possibleEntityTypes.get()).getValue()) {
429 Optional<DataContainerChild<? extends PathArgument, ?>> possibleEntities =
430 entityType.getChild(ENTITY_NODE_ID);
431 if(!possibleEntities.isPresent()) {
432 continue; // shouldn't happen but handle anyway
435 for(MapEntryNode entity: ((MapNode) possibleEntities.get()).getValue()) {
436 walker.onEntity(entityType, entity);
441 private void writeNewOwner(YangInstanceIdentifier entityPath, String newOwner) {
442 LOG.debug("{}: Writing new owner {} for entity {}", persistenceId(), newOwner, entityPath);
444 commitCoordinator.commitModification(new WriteModification(entityPath.node(ENTITY_OWNER_QNAME),
445 ImmutableNodes.leafNode(ENTITY_OWNER_NODE_ID, newOwner)), this);
449 * Schedule a new owner selection job. Cancelling any outstanding job if it has not been cancelled.
452 * @param allCandidates
454 public void scheduleOwnerSelection(YangInstanceIdentifier entityPath, Collection<String> allCandidates,
455 EntityOwnerSelectionStrategy strategy){
456 cancelOwnerSelectionTask(entityPath);
458 LOG.debug("{}: Scheduling owner selection after {} ms", persistenceId(), strategy.getSelectionDelayInMillis());
460 final Cancellable lastScheduledTask = context().system().scheduler().scheduleOnce(
461 FiniteDuration.apply(strategy.getSelectionDelayInMillis(), TimeUnit.MILLISECONDS)
462 , self(), new SelectOwner(entityPath, allCandidates, strategy)
463 , context().system().dispatcher(), self());
465 entityToScheduledOwnershipTask.put(entityPath, lastScheduledTask);
468 private void cancelOwnerSelectionTask(YangInstanceIdentifier entityPath){
469 final Cancellable lastScheduledTask = entityToScheduledOwnershipTask.get(entityPath);
470 if(lastScheduledTask != null && !lastScheduledTask.isCancelled()){
471 lastScheduledTask.cancel();
475 private String newOwner(Collection<String> candidates, Map<String, Long> statistics, EntityOwnerSelectionStrategy ownerSelectionStrategy) {
476 Collection<String> viableCandidates = getViableCandidates(candidates);
477 if(viableCandidates.size() == 0){
480 return ownerSelectionStrategy.newOwner(viableCandidates, statistics);
483 private Collection<String> getViableCandidates(Collection<String> candidates) {
484 Collection<String> viableCandidates = new ArrayList<>();
486 for (String candidate : candidates) {
487 if (!downPeerMemberNames.contains(candidate)) {
488 viableCandidates.add(candidate);
491 return viableCandidates;
494 private String getCurrentOwner(YangInstanceIdentifier entityId) {
495 Optional<NormalizedNode<?, ?>> optionalEntityOwner = getDataStore().readNode(entityId.node(ENTITY_OWNER_QNAME));
496 if(optionalEntityOwner.isPresent()){
497 return optionalEntityOwner.get().getValue().toString();
502 private static interface EntityWalker {
503 void onEntity(MapEntryNode entityTypeNode, MapEntryNode entityNode);
506 public static Builder newBuilder() {
507 return new Builder();
510 static class Builder extends Shard.AbstractBuilder<Builder, EntityOwnershipShard> {
511 private String localMemberName;
512 private EntityOwnerSelectionStrategyConfig ownerSelectionStrategyConfig;
514 protected Builder() {
515 super(EntityOwnershipShard.class);
518 Builder localMemberName(String localMemberName) {
520 this.localMemberName = localMemberName;
524 Builder ownerSelectionStrategyConfig(EntityOwnerSelectionStrategyConfig ownerSelectionStrategyConfig){
526 this.ownerSelectionStrategyConfig = ownerSelectionStrategyConfig;
531 protected void verify() {
533 Preconditions.checkNotNull(localMemberName, "localMemberName should not be null");
534 Preconditions.checkNotNull(ownerSelectionStrategyConfig, "ownerSelectionStrategyConfig should not be null");