public class DistributedShardedDOMDataTree extends Object implements org.opendaylight.mdsal.dom.api.DOMDataTreeService, org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService, DistributedShardFactory
ShardedDataTreeActor
. Also provides QoL method for addition of prefix based clustered shard into the system.DistributedShardFactory.DistributedShardRegistration
Constructor and Description |
---|
DistributedShardedDOMDataTree(ActorSystemProvider actorSystemProvider,
AbstractDataStore distributedOperDatastore,
AbstractDataStore distributedConfigDatastore) |
Modifier and Type | Method and Description |
---|---|
CompletionStage<DistributedShardFactory.DistributedShardRegistration> |
createDistributedShard(org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier prefix,
Collection<MemberName> replicaMembers)
Register a new shard that is rooted at the desired prefix with replicas on the provided members.
|
org.opendaylight.mdsal.dom.api.DOMDataTreeProducer |
createProducer(Collection<org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier> subtrees) |
com.google.common.collect.ClassToInstanceMap<org.opendaylight.mdsal.dom.api.DOMDataTreeServiceExtension> |
getExtensions() |
void |
init()
This will try to initialize prefix configuration shards upon their
successful start.
|
<T extends org.opendaylight.mdsal.dom.api.DOMDataTreeShard> |
registerDataTreeShard(org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier prefix,
T shard,
org.opendaylight.mdsal.dom.api.DOMDataTreeProducer producer) |
<T extends org.opendaylight.mdsal.dom.api.DOMDataTreeListener> |
registerListener(T listener,
Collection<org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier> subtrees,
boolean allowRxMerges,
Collection<org.opendaylight.mdsal.dom.api.DOMDataTreeProducer> producers) |
public DistributedShardedDOMDataTree(ActorSystemProvider actorSystemProvider, AbstractDataStore distributedOperDatastore, AbstractDataStore distributedConfigDatastore)
public void init()
createDistributedShard(org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier, java.util.Collection<org.opendaylight.controller.cluster.access.concepts.MemberName>)
and
resolveShardAdditions(java.util.Set<org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier>)
requests and update prefix configuration
shards accordingly.
We also need to initialize listeners on these shards, so we can react on changes made on them by other cluster members or even by ourselves.
Finally, we need to be sure that default shards for both operational and configuration data stores are up and running and we have distributed shards frontend created for them.
This is intended to be invoked by blueprint as initialization method.
@Nonnull public <T extends org.opendaylight.mdsal.dom.api.DOMDataTreeListener> org.opendaylight.yangtools.concepts.ListenerRegistration<T> registerListener(T listener, Collection<org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier> subtrees, boolean allowRxMerges, Collection<org.opendaylight.mdsal.dom.api.DOMDataTreeProducer> producers) throws org.opendaylight.mdsal.dom.api.DOMDataTreeLoopException
registerListener
in interface org.opendaylight.mdsal.dom.api.DOMDataTreeService
org.opendaylight.mdsal.dom.api.DOMDataTreeLoopException
public com.google.common.collect.ClassToInstanceMap<org.opendaylight.mdsal.dom.api.DOMDataTreeServiceExtension> getExtensions()
getExtensions
in interface org.opendaylight.mdsal.dom.api.DOMExtensibleService<org.opendaylight.mdsal.dom.api.DOMDataTreeService,org.opendaylight.mdsal.dom.api.DOMDataTreeServiceExtension>
@Nonnull public org.opendaylight.mdsal.dom.api.DOMDataTreeProducer createProducer(@Nonnull Collection<org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier> subtrees)
createProducer
in interface org.opendaylight.mdsal.dom.api.DOMDataTreeProducerFactory
public CompletionStage<DistributedShardFactory.DistributedShardRegistration> createDistributedShard(org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier prefix, Collection<MemberName> replicaMembers) throws org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException
DistributedShardFactory
createDistributedShard
in interface DistributedShardFactory
prefix
- Shard rootreplicaMembers
- Members that this shard is replicated on, has to have at least one Member even if the shard
should not be replicated.org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException
- If the initial check for a conflict on the local node fails, the
sharding configuration won't be updated if this exception is thrown.@Nonnull public <T extends org.opendaylight.mdsal.dom.api.DOMDataTreeShard> org.opendaylight.yangtools.concepts.ListenerRegistration<T> registerDataTreeShard(@Nonnull org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier prefix, @Nonnull T shard, @Nonnull org.opendaylight.mdsal.dom.api.DOMDataTreeProducer producer) throws org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException
registerDataTreeShard
in interface org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService
org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException
Copyright © 2019 OpenDaylight. All rights reserved.