Search in sources :

Example 11 with ChangeServersVotingStatus

use of org.opendaylight.controller.cluster.raft.messages.ChangeServersVotingStatus in project controller by opendaylight.

the class ShardManager method onChangeShardServersVotingStatus.

private void onChangeShardServersVotingStatus(final ChangeShardMembersVotingStatus changeMembersVotingStatus) {
    LOG.debug("{}: onChangeShardServersVotingStatus: {}", persistenceId(), changeMembersVotingStatus);
    String shardName = changeMembersVotingStatus.getShardName();
    Map<String, Boolean> serverVotingStatusMap = new HashMap<>();
    for (Entry<String, Boolean> e : changeMembersVotingStatus.getMeberVotingStatusMap().entrySet()) {
        serverVotingStatusMap.put(getShardIdentifier(MemberName.forName(e.getKey()), shardName).toString(), e.getValue());
    }
    ChangeServersVotingStatus changeServersVotingStatus = new ChangeServersVotingStatus(serverVotingStatusMap);
    findLocalShard(shardName, getSender(), localShardFound -> changeShardMembersVotingStatus(changeServersVotingStatus, shardName, localShardFound.getPath(), getSender()));
}
Also used : HashMap(java.util.HashMap) ChangeServersVotingStatus(org.opendaylight.controller.cluster.raft.messages.ChangeServersVotingStatus)

Aggregations

ChangeServersVotingStatus (org.opendaylight.controller.cluster.raft.messages.ChangeServersVotingStatus)11 ServerChangeReply (org.opendaylight.controller.cluster.raft.messages.ServerChangeReply)9 ActorRef (akka.actor.ActorRef)8 Test (org.junit.Test)8 TestActorRef (akka.testkit.TestActorRef)7 FiniteDuration (scala.concurrent.duration.FiniteDuration)6 ServerConfigurationPayload (org.opendaylight.controller.cluster.raft.persisted.ServerConfigurationPayload)4 ServerInfo (org.opendaylight.controller.cluster.raft.persisted.ServerInfo)4 SimpleReplicatedLogEntry (org.opendaylight.controller.cluster.raft.persisted.SimpleReplicatedLogEntry)4 UpdateElectionTerm (org.opendaylight.controller.cluster.raft.persisted.UpdateElectionTerm)4 TestKit (akka.testkit.javadsl.TestKit)3 Map (java.util.Map)3 Props (akka.actor.Props)2 UntypedActor (akka.actor.UntypedActor)2 Dispatchers (akka.dispatch.Dispatchers)2 DeleteSnapshotsFailure (akka.persistence.DeleteSnapshotsFailure)2 SaveSnapshotFailure (akka.persistence.SaveSnapshotFailure)2 Optional (com.google.common.base.Optional)2 Stopwatch (com.google.common.base.Stopwatch)2 ImmutableMap (com.google.common.collect.ImmutableMap)2