private DOMDataBroker createDataStore(SchemaService schemaService) { final DOMStore operStore = InMemoryDOMDataStoreFactory .create("DOM-OPER", schemaService); final DOMStore configStore = InMemoryDOMDataStoreFactory .create("DOM-CFG", schemaService); ExecutorService listenableFutureExecutor = SpecialExecutors.newBlockingBoundedCachedThreadPool( 16, 16, "CommitFutures"); final EnumMap<LogicalDatastoreType, DOMStore> datastores = new EnumMap<>(LogicalDatastoreType.class); datastores.put(LogicalDatastoreType.CONFIGURATION, configStore); datastores.put(LogicalDatastoreType.OPERATIONAL, operStore); return new SerializedDOMDataBroker(datastores, MoreExecutors.listeningDecorator(listenableFutureExecutor)); }
private void createConcurrentDOMDataBroker() { this.listenableFutureExecutor = SpecialExecutors.newBlockingBoundedCachedThreadPool( this.maxDataBrokerFutureCallbackPoolSize, this.maxDataBrokerFutureCallbackQueueSize, "CommitFutures", Logger.class); this.commitStatsTracker = DurationStatisticsTracker.createConcurrent(); final Map<LogicalDatastoreType, DOMStore> datastores = new HashMap<>(); datastores.put(LogicalDatastoreType.CONFIGURATION, this.configDatastore); datastores.put(LogicalDatastoreType.OPERATIONAL, this.operDatastore); this.concurrentDOMDataBroker = new ConcurrentDOMDataBroker(datastores, this.listenableFutureExecutor, this.commitStatsTracker); this.concurrentDOMDataBrokerOld = new LegacyDOMDataBrokerAdapter(this.concurrentDOMDataBroker); }
@Override protected SerializedDOMDataBroker create() { // This Databroker is dedicated for netconf metadata, not expected to be under heavy load ExecutorService listenableFutureExecutor = SpecialExecutors.newBlockingBoundedCachedThreadPool(1, 100, "commits", getClass()); ExecutorService commitExecutor = SpecialExecutors.newBoundedSingleThreadExecutor(100, "WriteTxCommit", getClass()); // TODO HONEYCOMB-164 try to provide more lightweight implementation of DataBroker Map<LogicalDatastoreType, DOMStore> map = new LinkedHashMap<>(); map.put(LogicalDatastoreType.CONFIGURATION, cfgDataStore); map.put(LogicalDatastoreType.OPERATIONAL, operDataStore); return new SerializedDOMDataBroker(map, new DeadlockDetectingListeningExecutorService(commitExecutor, TransactionCommitDeadlockException.DEADLOCK_EXCEPTION_SUPPLIER, listenableFutureExecutor)); } }
ExecutorService listenableFutureExecutor = SpecialExecutors.newBlockingBoundedCachedThreadPool( getMaxDataBrokerFutureCallbackPoolSize(), getMaxDataBrokerFutureCallbackQueueSize(), "CommitFutures");