public final class ShardedDOMDataTree extends Object implements DOMDataTreeService, DOMDataTreeShardingService
Constructor and Description |
---|
ShardedDOMDataTree() |
Modifier and Type | Method and Description |
---|---|
DOMDataTreeProducer |
createProducer(Collection<DOMDataTreeIdentifier> subtrees)
Create a producer, which is able to access to a set of trees.
|
com.google.common.collect.ClassToInstanceMap<DOMDataTreeServiceExtension> |
getExtensions()
Return a map of currently-supported extensions, along with accessor services
which provide access to the specific functionality bound to this service.
|
<T extends DOMDataTreeShard> |
registerDataTreeShard(DOMDataTreeIdentifier prefix,
T shard,
DOMDataTreeProducer producer)
Register a shard as responsible for a particular subtree prefix.
|
<T extends DOMDataTreeListener> |
registerListener(T listener,
Collection<DOMDataTreeIdentifier> subtrees,
boolean allowRxMerges,
Collection<DOMDataTreeProducer> producers)
Register a
DOMDataTreeListener instance. |
public <T extends DOMDataTreeShard> DOMDataTreeShardRegistration<T> registerDataTreeShard(DOMDataTreeIdentifier prefix, T shard, DOMDataTreeProducer producer) throws DOMDataTreeShardingConflictException
DOMDataTreeShardingService
registerDataTreeShard
in interface DOMDataTreeShardingService
prefix
- Data tree identifier, may not be null.shard
- Responsible shard instanceproducer
- Producer instance to verify namespace claimDOMDataTreeShardingConflictException
- if the prefix is already boundpublic com.google.common.collect.ClassToInstanceMap<DOMDataTreeServiceExtension> getExtensions()
DOMExtensibleService
getExtensions
in interface DOMExtensibleService<DOMDataTreeService,DOMDataTreeServiceExtension>
public DOMDataTreeProducer createProducer(Collection<DOMDataTreeIdentifier> subtrees)
DOMDataTreeProducerFactory
createProducer
in interface DOMDataTreeProducerFactory
subtrees
- The collection of subtrees the resulting producer should have access to.DOMDataTreeProducer
instance.public <T extends DOMDataTreeListener> org.opendaylight.yangtools.concepts.ListenerRegistration<T> registerListener(T listener, Collection<DOMDataTreeIdentifier> subtrees, boolean allowRxMerges, Collection<DOMDataTreeProducer> producers) throws DOMDataTreeLoopException
DOMDataTreeService
DOMDataTreeListener
instance. Once registered, the listener
will start receiving changes on the selected subtrees. If the listener cannot
keep up with the rate of changes, and allowRxMerges is set to true, this service
is free to merge the changes, so that a smaller number of them will be reported,
possibly hiding some data transitions (like flaps).
If the listener wants to write into any producer, that producer has to be mentioned in the call to this method. Those producers will be bound exclusively to the registration, so that accessing them outside of this listener's callback will trigger an error. Any producers mentioned must be idle, e.g. they may not have an open transaction at the time this method is invoked.
Each listener instance can be registered at most once. Implementations of this interface have to guarantee that the listener's methods will not be invoked concurrently from multiple threads.
registerListener
in interface DOMDataTreeService
listener
- DOMDataTreeListener
that is being registeredsubtrees
- Conceptual subtree identifier of subtrees which should be monitored
for changes. May not be null or empty.allowRxMerges
- True if the backend may perform ingress state compression.producers
- DOMDataTreeProducer
instances to bind to the listener.DOMDataTreeLoopException
- if the registration of the listener to the specified
subtrees with specified producers would form a
feedback loopCopyright © 2019 OpenDaylight. All rights reserved.