Search in sources :

Example 21 with MemberName

use of org.opendaylight.controller.cluster.access.concepts.MemberName in project controller by opendaylight.

the class DistributedShardedDOMDataTree method createPrefixConfigShard.

private static void createPrefixConfigShard(final AbstractDataStore dataStore) {
    Configuration configuration = dataStore.getActorContext().getConfiguration();
    Collection<MemberName> memberNames = configuration.getUniqueMemberNamesForAllShards();
    CreateShard createShardMessage = new CreateShard(new ModuleShardConfiguration(PrefixShards.QNAME.getNamespace(), "prefix-shard-configuration", ClusterUtils.PREFIX_CONFIG_SHARD_ID, ModuleShardStrategy.NAME, memberNames), Shard.builder(), dataStore.getActorContext().getDatastoreContext());
    dataStore.getActorContext().getShardManager().tell(createShardMessage, noSender());
}
Also used : Configuration(org.opendaylight.controller.cluster.datastore.config.Configuration) ModuleShardConfiguration(org.opendaylight.controller.cluster.datastore.config.ModuleShardConfiguration) MemberName(org.opendaylight.controller.cluster.access.concepts.MemberName) CreateShard(org.opendaylight.controller.cluster.datastore.messages.CreateShard) ModuleShardConfiguration(org.opendaylight.controller.cluster.datastore.config.ModuleShardConfiguration)

Example 22 with MemberName

use of org.opendaylight.controller.cluster.access.concepts.MemberName in project controller by opendaylight.

the class ShardedDataTreeActor method memberExited.

private void memberExited(final MemberExited message) {
    final MemberName memberName = memberToName(message.member());
    LOG.info("{}: Received MemberExited: memberName: {}, address: {}", persistenceId(), memberName, message.member().address());
    resolver.removePeerAddress(memberName);
}
Also used : MemberName(org.opendaylight.controller.cluster.access.concepts.MemberName)

Example 23 with MemberName

use of org.opendaylight.controller.cluster.access.concepts.MemberName in project controller by opendaylight.

the class ShardedDataTreeActor method memberUnreachable.

private void memberUnreachable(final UnreachableMember message) {
    final MemberName memberName = memberToName(message.member());
    LOG.debug("Received UnreachableMember: memberName {}, address: {}", memberName, message.member().address());
    resolver.removePeerAddress(memberName);
}
Also used : MemberName(org.opendaylight.controller.cluster.access.concepts.MemberName)

Example 24 with MemberName

use of org.opendaylight.controller.cluster.access.concepts.MemberName in project controller by opendaylight.

the class ShardedDataTreeActor method memberRemoved.

private void memberRemoved(final MemberRemoved message) {
    final MemberName memberName = memberToName(message.member());
    LOG.info("{}: Received MemberRemoved: memberName: {}, address: {}", persistenceId(), memberName, message.member().address());
    resolver.removePeerAddress(memberName);
}
Also used : MemberName(org.opendaylight.controller.cluster.access.concepts.MemberName)

Example 25 with MemberName

use of org.opendaylight.controller.cluster.access.concepts.MemberName in project controller by opendaylight.

the class ShardedDataTreeActor method memberWeaklyUp.

private void memberWeaklyUp(final MemberWeaklyUp message) {
    final MemberName memberName = memberToName(message.member());
    LOG.info("{}: Received MemberWeaklyUp: memberName: {}, address: {}", persistenceId(), memberName, message.member().address());
    resolver.addPeerAddress(memberName, message.member().address());
}
Also used : MemberName(org.opendaylight.controller.cluster.access.concepts.MemberName)

Aggregations

MemberName (org.opendaylight.controller.cluster.access.concepts.MemberName)32 Test (org.junit.Test)6 HashMap (java.util.HashMap)5 ActorRef (akka.actor.ActorRef)4 Configuration (org.opendaylight.controller.cluster.datastore.config.Configuration)3 AddressFromURIString (akka.actor.AddressFromURIString)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 Entry (java.util.Map.Entry)2 Before (org.junit.Before)2 AbstractShardManagerTest (org.opendaylight.controller.cluster.datastore.AbstractShardManagerTest)2 DatastoreContext (org.opendaylight.controller.cluster.datastore.DatastoreContext)2 DatastoreContextFactory (org.opendaylight.controller.cluster.datastore.DatastoreContextFactory)2 ModuleShardConfiguration (org.opendaylight.controller.cluster.datastore.config.ModuleShardConfiguration)2 ShardIdentifier (org.opendaylight.controller.cluster.datastore.identifiers.ShardIdentifier)2 CreateShard (org.opendaylight.controller.cluster.datastore.messages.CreateShard)2 ModuleShardStrategy (org.opendaylight.controller.cluster.datastore.shardstrategy.ModuleShardStrategy)2 ShardStrategy (org.opendaylight.controller.cluster.datastore.shardstrategy.ShardStrategy)2 MockConfiguration (org.opendaylight.controller.cluster.datastore.utils.MockConfiguration)2 Address (akka.actor.Address)1