use of org.opendaylight.controller.cluster.access.concepts.MemberName in project controller by opendaylight.
the class ShardManager method memberExited.
private void memberExited(final ClusterEvent.MemberExited message) {
MemberName memberName = memberToName(message.member());
LOG.info("{}: Received MemberExited: memberName: {}, address: {}", persistenceId(), memberName, message.member().address());
peerAddressResolver.removePeerAddress(memberName);
for (ShardInformation info : localShards.values()) {
info.peerDown(memberName, getShardIdentifier(memberName, info.getShardName()).toString(), getSelf());
}
}
use of org.opendaylight.controller.cluster.access.concepts.MemberName in project controller by opendaylight.
the class ShardManager method memberWeaklyUp.
private void memberWeaklyUp(final MemberWeaklyUp message) {
MemberName memberName = memberToName(message.member());
LOG.info("{}: Received MemberWeaklyUp: memberName: {}, address: {}", persistenceId(), memberName, message.member().address());
memberUp(memberName, message.member().address());
}
use of org.opendaylight.controller.cluster.access.concepts.MemberName in project controller by opendaylight.
the class ShardedDataTreeActor method memberUp.
private void memberUp(final MemberUp message) {
final MemberName memberName = memberToName(message.member());
LOG.info("{}: Received MemberUp: memberName: {}, address: {}", persistenceId(), memberName, message.member().address());
resolver.addPeerAddress(memberName, message.member().address());
}
use of org.opendaylight.controller.cluster.access.concepts.MemberName in project controller by opendaylight.
the class EntityOwnershipShard method onPeerDown.
private void onPeerDown(final PeerDown peerDown) {
LOG.info("{}: onPeerDown: {}", persistenceId(), peerDown);
MemberName downMemberName = peerDown.getMemberName();
if (downPeerMemberNames.add(downMemberName) && isLeader()) {
// Select new owners for entities owned by the down peer and which have other candidates. For an entity for
// which the down peer is the only candidate, we leave it as the owner and don't clear it. This is done to
// handle the case where the peer member process is actually still running but the node is partitioned.
// When the partition is healed, the peer just remains as the owner. If the peer process actually restarted,
// it will first remove all its candidates on startup. If another candidate is registered during the time
// the peer is down, the new candidate will be selected as the new owner.
selectNewOwnerForEntitiesOwnedBy(ImmutableSet.of(downMemberName.getName()));
}
}
use of org.opendaylight.controller.cluster.access.concepts.MemberName in project controller by opendaylight.
the class FileModuleShardConfigProvider method readModuleShardsConfig.
private static Map<String, ModuleConfig.Builder> readModuleShardsConfig(final Config moduleShardsConfig) {
final List<? extends ConfigObject> moduleShardsConfigObjectList = moduleShardsConfig.getObjectList("module-shards");
final Map<String, ModuleConfig.Builder> moduleConfigMap = new HashMap<>();
for (final ConfigObject moduleShardConfigObject : moduleShardsConfigObjectList) {
final String moduleName = moduleShardConfigObject.get("name").unwrapped().toString();
final ModuleConfig.Builder builder = ModuleConfig.builder(moduleName);
final List<? extends ConfigObject> shardsConfigObjectList = moduleShardConfigObject.toConfig().getObjectList("shards");
for (final ConfigObject shard : shardsConfigObjectList) {
final String shardName = shard.get("name").unwrapped().toString();
final List<MemberName> replicas = shard.toConfig().getStringList("replicas").stream().map(MemberName::forName).collect(Collectors.toList());
builder.shardConfig(shardName, replicas);
}
moduleConfigMap.put(moduleName, builder);
}
return moduleConfigMap;
}
Aggregations