import org.opendaylight.mdsal.dom.api.DOMDataTreeShard;
import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingConflictException;
import org.opendaylight.mdsal.dom.api.DOMDataTreeShardingService;
+import org.opendaylight.mdsal.dom.spi.DOMDataTreePrefixTable;
+import org.opendaylight.mdsal.dom.spi.DOMDataTreePrefixTableEntry;
import org.opendaylight.mdsal.dom.spi.store.DOMStoreTreeChangePublisher;
import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
private static final Logger LOG = LoggerFactory.getLogger(ShardedDOMDataTree.class);
@GuardedBy("this")
- private final ShardingTable<ShardRegistration<?>> shards = ShardingTable.create();
+ private final DOMDataTreePrefixTable<ShardRegistration<?>> shards = DOMDataTreePrefixTable.create();
@GuardedBy("this")
- private final ShardingTable<DOMDataTreeProducer> producers = ShardingTable.create();
+ private final DOMDataTreePrefixTable<DOMDataTreeProducer> producers = DOMDataTreePrefixTable.create();
void removeShard(final ShardRegistration<?> reg) {
* and if it exists, check if its registration prefix does not collide with
* this registration.
*/
- final ShardingTableEntry<ShardRegistration<?>> parent = shards.lookup(prefix);
+ final DOMDataTreePrefixTableEntry<ShardRegistration<?>> parent = shards.lookup(prefix);
if (parent != null) {
parentReg = parent.getValue();
if (parentReg != null && prefix.equals(parentReg.getPrefix())) {
@GuardedBy("this")
private DOMDataTreeProducer findProducer(final DOMDataTreeIdentifier subtree) {
- ShardingTableEntry<DOMDataTreeProducer> producerEntry = producers.lookup(subtree);
+ DOMDataTreePrefixTableEntry<DOMDataTreeProducer> producerEntry = producers.lookup(subtree);
if (producerEntry != null) {
return producerEntry.getValue();
}
Preconditions.checkArgument(!subtrees.isEmpty(), "Subtrees may not be empty");
final Map<DOMDataTreeIdentifier, DOMDataTreeShard> shardMap = new HashMap<>();
- for (final DOMDataTreeIdentifier s : subtrees) {
+ for (final DOMDataTreeIdentifier subtree : subtrees) {
// Attempting to create a disconnected producer -- all subtrees have to be unclaimed
- final DOMDataTreeProducer producer = findProducer(s);
- Preconditions.checkArgument(producer == null, "Subtree %s is attached to producer %s", s, producer);
+ final DOMDataTreeProducer producer = findProducer(subtree);
+ Preconditions.checkArgument(producer == null, "Subtree %s is attached to producer %s", subtree, producer);
- shardMap.put(s, shards.lookup(s).getValue().getInstance());
+ shardMap.put(subtree, shards.lookup(subtree).getValue().getInstance());
}
return createProducer(shardMap);