*/
package org.opendaylight.controller.cluster.datastore.entityownership;
+import static java.util.Objects.requireNonNull;
import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.CANDIDATE_NAME_NODE_ID;
import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.CANDIDATE_NODE_ID;
import static org.opendaylight.controller.cluster.datastore.entityownership.EntityOwnersModel.ENTITY_ID_NODE_ID;
import akka.cluster.Member;
import akka.cluster.MemberStatus;
import akka.pattern.Patterns;
-import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
final List<Modification> modifications = new ArrayList<>();
searchForEntities((entityTypeNode, entityNode) -> {
if (hasCandidate(entityNode, member)) {
- YangInstanceIdentifier entityId =
- (YangInstanceIdentifier) entityNode.getIdentifier().getKeyValues().get(ENTITY_ID_QNAME);
- YangInstanceIdentifier candidatePath = candidatePath(
- entityTypeNode.getIdentifier().getKeyValues().get(ENTITY_TYPE_QNAME).toString(),
- entityId, member.getName());
+ YangInstanceIdentifier entityId = (YangInstanceIdentifier) entityNode.getIdentifier()
+ .getValue(ENTITY_ID_QNAME);
+ YangInstanceIdentifier candidatePath = candidatePath(entityTypeNode.getIdentifier()
+ .getValue(ENTITY_TYPE_QNAME).toString(), entityId, member.getName());
LOG.info("{}: Found entity {}, removing candidate {}, path {}", persistenceId(), entityId,
member, candidatePath);
@Override
protected void verify() {
super.verify();
- Preconditions.checkNotNull(localMemberName, "localMemberName should not be null");
- Preconditions.checkNotNull(ownerSelectionStrategyConfig, "ownerSelectionStrategyConfig should not be null");
+ requireNonNull(localMemberName, "localMemberName should not be null");
+ requireNonNull(ownerSelectionStrategyConfig, "ownerSelectionStrategyConfig should not be null");
}
}
}