Class DistributedShardedDOMDataTree

  • All Implemented Interfaces:
    DistributedShardFactory, org.opendaylight.mdsal.dom.api.DOMDataTreeProducerFactory, org.opendaylight.mdsal.dom.api.DOMDataTreeService, org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService, org.opendaylight.mdsal.dom.api.DOMExtensibleService<org.opendaylight.mdsal.dom.api.DOMDataTreeService,​org.opendaylight.mdsal.dom.api.DOMDataTreeServiceExtension>, org.opendaylight.mdsal.dom.api.DOMService

    public class DistributedShardedDOMDataTree
    extends Object
    implements org.opendaylight.mdsal.dom.api.DOMDataTreeService, org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService, DistributedShardFactory
    A layer on top of DOMDataTreeService that distributes producer/shard registrations to remote nodes via ShardedDataTreeActor. Also provides QoL method for addition of prefix based clustered shard into the system.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CompletionStage<DistributedShardRegistration> createDistributedShard​(org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier prefix, Collection<org.opendaylight.controller.cluster.access.concepts.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>
      org.opendaylight.yangtools.concepts.ListenerRegistration<T>
      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>
      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)  
    • Constructor Detail

      • DistributedShardedDOMDataTree

        public DistributedShardedDOMDataTree​(org.opendaylight.controller.cluster.ActorSystemProvider actorSystemProvider,
                                             AbstractDataStore distributedOperDatastore,
                                             AbstractDataStore distributedConfigDatastore)
    • Method Detail

      • registerListener

        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
        Specified by:
        registerListener in interface org.opendaylight.mdsal.dom.api.DOMDataTreeService
        Throws:
        org.opendaylight.mdsal.dom.api.DOMDataTreeLoopException
      • getExtensions

        public com.google.common.collect.ClassToInstanceMap<org.opendaylight.mdsal.dom.api.DOMDataTreeServiceExtension> getExtensions()
        Specified by:
        getExtensions in interface org.opendaylight.mdsal.dom.api.DOMExtensibleService<org.opendaylight.mdsal.dom.api.DOMDataTreeService,​org.opendaylight.mdsal.dom.api.DOMDataTreeServiceExtension>
      • createProducer

        public org.opendaylight.mdsal.dom.api.DOMDataTreeProducer createProducer​(Collection<org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier> subtrees)
        Specified by:
        createProducer in interface org.opendaylight.mdsal.dom.api.DOMDataTreeProducerFactory
      • createDistributedShard

        public CompletionStage<DistributedShardRegistration> createDistributedShard​(org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier prefix,
                                                                                    Collection<org.opendaylight.controller.cluster.access.concepts.MemberName> replicaMembers)
                                                                             throws org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException
        Description copied from interface: DistributedShardFactory
        Register a new shard that is rooted at the desired prefix with replicas on the provided members. Note to register a shard without replicas you still need to provide at least one Member for the shard.
        Specified by:
        createDistributedShard in interface DistributedShardFactory
        Parameters:
        prefix - Shard root
        replicaMembers - Members that this shard is replicated on, has to have at least one Member even if the shard should not be replicated.
        Returns:
        A future that will be completed with a DistributedShardRegistration once the backend and frontend shards are spawned.
        Throws:
        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.
      • registerDataTreeShard

        public <T extends org.opendaylight.mdsal.dom.api.DOMDataTreeShard> org.opendaylight.yangtools.concepts.ListenerRegistration<T> registerDataTreeShard​(org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier prefix,
                                                                                                                                                             T shard,
                                                                                                                                                             org.opendaylight.mdsal.dom.api.DOMDataTreeProducer producer)
                                                                                                                                                      throws org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException
        Specified by:
        registerDataTreeShard in interface org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService
        Throws:
        org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException