X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-inmemory-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2FInMemoryDOMDataStore.java;h=129013378ea57c713304793248e1cdc2f2c0a6ce;hp=b61b3671034601fc09d7658280f986d4d30cc3ce;hb=8061503ad1ea985067ba14c19210a7b9a09b0db1;hpb=d5a0c6e2b20851f836852af94cf6066c7beac0c3 diff --git a/opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java b/opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java index b61b367103..129013378e 100644 --- a/opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java +++ b/opendaylight/md-sal/sal-inmemory-datastore/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java @@ -21,7 +21,6 @@ import org.opendaylight.controller.md.sal.common.api.data.OptimisticLockFailedEx import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.controller.md.sal.dom.store.impl.SnapshotBackedWriteTransaction.TransactionReadyPrototype; import org.opendaylight.yangtools.util.ExecutorServiceUtil; -import org.opendaylight.yangtools.util.PropertyUtils; import org.opendaylight.yangtools.util.concurrent.NotificationManager; import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager; import org.opendaylight.yangtools.yang.data.api.schema.tree.ConflictingModificationAppliedException; @@ -50,7 +49,6 @@ import org.slf4j.LoggerFactory; import javax.annotation.concurrent.GuardedBy; -import java.util.Collections; import java.util.concurrent.Callable; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; @@ -85,11 +83,6 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable, Sch } }; - private static final String DCL_NOTIFICATION_MGR_MAX_QUEUE_SIZE_PROP = - "mdsal.datastore-dcl-notification-queue.size"; - - private static final int DEFAULT_DCL_NOTIFICATION_MGR_MAX_QUEUE_SIZE = 1000; - private final DataTree dataTree = InMemoryDataTreeFactory.getInstance().create(); private final ListenerTree listenerTree = ListenerTree.create(); private final AtomicLong txCounter = new AtomicLong(0); @@ -104,17 +97,21 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable, Sch public InMemoryDOMDataStore(final String name, final ListeningExecutorService listeningExecutor, final ExecutorService dataChangeListenerExecutor) { + this(name, listeningExecutor, dataChangeListenerExecutor, + InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE); + } + + public InMemoryDOMDataStore(final String name, final ListeningExecutorService listeningExecutor, + final ExecutorService dataChangeListenerExecutor, int maxDataChangeListenerQueueSize) { this.name = Preconditions.checkNotNull(name); this.listeningExecutor = Preconditions.checkNotNull(listeningExecutor); this.dataChangeListenerExecutor = Preconditions.checkNotNull(dataChangeListenerExecutor); - int maxDCLQueueSize = PropertyUtils.getIntSystemProperty( - DCL_NOTIFICATION_MGR_MAX_QUEUE_SIZE_PROP, DEFAULT_DCL_NOTIFICATION_MGR_MAX_QUEUE_SIZE ); - dataChangeListenerNotificationManager = new QueuedNotificationManager<>(this.dataChangeListenerExecutor, - DCL_NOTIFICATION_MGR_INVOKER, maxDCLQueueSize, "DataChangeListenerQueueMgr"); + DCL_NOTIFICATION_MGR_INVOKER, maxDataChangeListenerQueueSize, + "DataChangeListenerQueueMgr"); } @Override @@ -178,7 +175,7 @@ public class InMemoryDOMDataStore implements DOMStore, Identifiable, Sch .addCreated(path, data) // .build(); - new ChangeListenerNotifyTask(Collections.singletonList(reg), event, + new ChangeListenerNotifyTask(reg, event, dataChangeListenerNotificationManager).run(); } }