InMemoryDOMStoreTreeChangePublisher(final ExecutorService listenerExecutor, final int maxQueueSize) { notificationManager = new QueuedNotificationManager<>(listenerExecutor, MANAGER_INVOKER, maxQueueSize, "DataTreeChangeListenerQueueMgr"); }
@Override protected void notifyListener(final AbstractDOMDataTreeChangeListenerRegistration<?> registration, final Collection<DataTreeCandidate> changes) { LOG.debug("Enqueueing candidates {} for registration {}", changes, registration); notificationManager.submitNotifications(registration, changes); }
InMemoryDOMDataTreeShardChangePublisher(final Executor executor, final int maxQueueSize, final DataTree dataTree, final YangInstanceIdentifier rootPath, final Map<DOMDataTreeIdentifier, ChildShardContext> childShards) { super(dataTree, rootPath, childShards); notificationManager = QueuedNotificationManager.create(executor, MANAGER_INVOKER, maxQueueSize, "DataTreeChangeListenerQueueMgr"); }
@Override protected void notifyListeners(final Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> registrations, final YangInstanceIdentifier path, final DataTreeCandidateNode node) { final DataTreeCandidate candidate = DataTreeCandidates.newDataTreeCandidate(path, node); for (AbstractDOMDataTreeChangeListenerRegistration<?> reg : registrations) { LOG.debug("Enqueueing candidate {} to registration {}", candidate, registrations); notificationManager.submitNotification(reg, candidate); } }
public InMemoryDataStoreStats(final String beanType, final QueuedNotificationManager<?, ?> manager) { notificationManagerStatsBean = new QueuedNotificationManagerMXBeanImpl(manager, "notification-manager", beanType, null); notificationManagerStatsBean.registerMBean(); notificationExecutorStatsBean = ThreadExecutorStatsMXBeanImpl.create(manager.getExecutor(), "notification-executor", beanType, null); if (notificationExecutorStatsBean != null) { notificationExecutorStatsBean.registerMBean(); } }
@Override public List<ListenerNotificationQueueStats> getCurrentListenerQueueStats() { return manager.getListenerNotificationQueueStats(); }
@Override public int getMaxListenerQueueSize() { return manager.getMaxQueueCapacity(); }
@Override protected void notifyListeners(final Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> registrations, final YangInstanceIdentifier path, final DataTreeCandidateNode node) { final DataTreeCandidate candidate = DataTreeCandidates.newDataTreeCandidate(path, node); for (AbstractDOMDataTreeChangeListenerRegistration<?> reg : registrations) { LOG.debug("Enqueueing candidate {} to registration {}", candidate, registrations); notificationManager.submitNotification(reg, candidate); } }
public InMemoryDataStoreStats(final String mBeanType, final QueuedNotificationManager<?, ?> manager) { notificationManagerStatsBean = new QueuedNotificationManagerMXBeanImpl(manager, "notification-manager", mBeanType, null); notificationManagerStatsBean.registerMBean(); notificationExecutorStatsBean = ThreadExecutorStatsMXBeanImpl.create(manager.getExecutor(), "notification-executor", mBeanType, null); if (notificationExecutorStatsBean != null) { notificationExecutorStatsBean.registerMBean(); } }
InMemoryDOMStoreTreeChangePublisher(final ExecutorService listenerExecutor, final int maxQueueSize) { notificationManager = new QueuedNotificationManager<>(listenerExecutor, MANAGER_INVOKER, maxQueueSize, "DataTreeChangeListenerQueueMgr"); }
@Override protected void notifyListener(final AbstractDOMDataTreeChangeListenerRegistration<?> registration, final Collection<DataTreeCandidate> changes) { LOG.debug("Enqueueing candidates {} for registration {}", changes, registration); notificationManager.submitNotifications(registration, changes); }
<L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerTreeChangeListener(final YangInstanceIdentifier treeId, final L listener, final DataTreeSnapshot snapshot) { final AbstractDOMDataTreeChangeListenerRegistration<L> reg = registerTreeChangeListener(treeId, listener); final Optional<NormalizedNode<?, ?>> node = snapshot.readNode(treeId); if (node.isPresent()) { final DataTreeCandidate candidate = DataTreeCandidates.fromNormalizedNode(treeId, node.get()); notificationManager.submitNotification(reg, candidate); } return reg; }
InMemoryDOMStoreTreeChangePublisher(final ExecutorService listenerExecutor, final int maxQueueSize) { notificationManager = QueuedNotificationManager.create(listenerExecutor, MANAGER_INVOKER, maxQueueSize, "DataTreeChangeListenerQueueMgr"); }
/** * Create a new notification manager. * * @param executor the {@link Executor} to use for notification tasks * @param listenerInvoker the {@link BatchedInvoker} to use for invoking listeners * @param maxQueueCapacity the capacity of each listener queue * @param name the name of this instance for logging info */ public static <L, N> QueuedNotificationManager<L, N> create(final @NonNull Executor executor, final@NonNull BatchedInvoker<L, N> listenerInvoker, final int maxQueueCapacity, final @NonNull String name) { return new QueuedNotificationManager<>(executor, listenerInvoker, maxQueueCapacity, name); }
@Override public void submitNotification(final L listener, final N notification) { if (notification != null) { submitNotifications(listener, Collections.singletonList(notification)); } }
dataChangeListenerNotificationManager.submitNotification(reg, event);
/** * Create a new notification manager. * * @param executor the {@link Executor} to use for notification tasks * @param listenerInvoker the {@link BatchedInvoker} to use for invoking listeners * @param maxQueueCapacity the capacity of each listener queue * @param name the name of this instance for logging info */ public static <L, N> QueuedNotificationManager<L, N> create(final @NonNull Executor executor, final@NonNull BatchedInvoker<L, N> listenerInvoker, final int maxQueueCapacity, final @NonNull String name) { return new QueuedNotificationManager<>(executor, listenerInvoker, maxQueueCapacity, name); }
@Override public void submitNotification(final L listener, final N notification) { if (notification != null) { submitNotifications(listener, Collections.singletonList(notification)); } }