Search in sources :

Example 6 with LocalShardNotFound

use of org.opendaylight.controller.cluster.datastore.messages.LocalShardNotFound in project controller by opendaylight.

the class ShardManager method findLocalShard.

private void findLocalShard(final FindLocalShard message) {
    LOG.debug("{}: findLocalShard : {}", persistenceId(), message.getShardName());
    final ShardInformation shardInformation = localShards.get(message.getShardName());
    if (shardInformation == null) {
        LOG.debug("{}: Local shard {} not found - shards present: {}", persistenceId(), message.getShardName(), localShards.keySet());
        getSender().tell(new LocalShardNotFound(message.getShardName()), getSelf());
        return;
    }
    sendResponse(shardInformation, message.isWaitUntilInitialized(), false, () -> new LocalShardFound(shardInformation.getActor()));
}
Also used : LocalShardNotFound(org.opendaylight.controller.cluster.datastore.messages.LocalShardNotFound) LocalShardFound(org.opendaylight.controller.cluster.datastore.messages.LocalShardFound)

Aggregations

LocalShardNotFound (org.opendaylight.controller.cluster.datastore.messages.LocalShardNotFound)6 FindLocalShard (org.opendaylight.controller.cluster.datastore.messages.FindLocalShard)5 TestKit (akka.testkit.javadsl.TestKit)4 Test (org.junit.Test)4 AbstractShardManagerTest (org.opendaylight.controller.cluster.datastore.AbstractShardManagerTest)2 Configuration (org.opendaylight.controller.cluster.datastore.config.Configuration)2 LocalShardFound (org.opendaylight.controller.cluster.datastore.messages.LocalShardFound)2 ActorContext (org.opendaylight.controller.cluster.datastore.utils.ActorContext)2 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)2 FiniteDuration (scala.concurrent.duration.FiniteDuration)2 ActorRef (akka.actor.ActorRef)1 AddressFromURIString (akka.actor.AddressFromURIString)1 Status (akka.actor.Status)1 DeleteSnapshotsFailure (akka.persistence.DeleteSnapshotsFailure)1 SaveSnapshotFailure (akka.persistence.SaveSnapshotFailure)1 TestActorRef (akka.testkit.TestActorRef)1 Timeout (akka.util.Timeout)1 Dispatchers (org.opendaylight.controller.cluster.common.actor.Dispatchers)1 ChangeShardMembersVotingStatus (org.opendaylight.controller.cluster.datastore.messages.ChangeShardMembersVotingStatus)1 FlipShardMembersVotingStatus (org.opendaylight.controller.cluster.datastore.messages.FlipShardMembersVotingStatus)1