From 78aa007feef2169a0280bd3d3fbbbea160b63d82 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 24 Nov 2014 17:15:11 +0100 Subject: [PATCH] Move ConcurrentDOMDataBroker to clustered-datastore The concurrent data broker is only useful for the distributed datastore, so move it along with the configuration binding there. Fixes the potential for users to misconfigure their datastore. Change-Id: I145c42ac64427db43889872abe06dd84bf751484 Signed-off-by: Robert Varga --- .../resources/initial/05-clustering.xml.conf | 22 +++- .../md-sal/sal-distributed-datastore/pom.xml | 5 + .../datastore}/ConcurrentDOMDataBroker.java | 4 +- .../DomConcurrentDataBrokerModule.java | 99 +++++++++++++++ .../DomConcurrentDataBrokerModuleFactory.java | 12 ++ .../src/main/yang/odl-sal-cds-cfg.yang | 32 +++++ ...OMConcurrentDataCommitCoordinatorTest.java | 2 +- opendaylight/md-sal/sal-dom-broker/pom.xml | 6 +- .../dom/impl/DomInmemoryDataBrokerModule.java | 63 ++++------ ...ransactionCommitFailedExceptionMapper.java | 10 +- .../yang/opendaylight-dom-broker-impl.yang | 118 +++++++++--------- 11 files changed, 261 insertions(+), 112 deletions(-) rename opendaylight/md-sal/{sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl => sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore}/ConcurrentDOMDataBroker.java (98%) create mode 100644 opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/concurrent_data_broker/DomConcurrentDataBrokerModule.java create mode 100644 opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/concurrent_data_broker/DomConcurrentDataBrokerModuleFactory.java create mode 100644 opendaylight/md-sal/sal-distributed-datastore/src/main/yang/odl-sal-cds-cfg.yang rename opendaylight/md-sal/{sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl => sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore}/DOMConcurrentDataCommitCoordinatorTest.java (99%) diff --git a/opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/05-clustering.xml.conf b/opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/05-clustering.xml.conf index b57a3f5f0b..dee2b4c861 100644 --- a/opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/05-clustering.xml.conf +++ b/opendaylight/md-sal/sal-clustering-config/src/main/resources/initial/05-clustering.xml.conf @@ -12,8 +12,8 @@ - prefix:dom-inmemory-data-broker - inmemory-data-broker + prefix:dom-concurrent-data-broker + concurrent-data-broker dom:schema-service @@ -29,8 +29,6 @@ operational-dom-store-spi:operational-dom-datastore distributed-operational-store-service - - true @@ -64,6 +62,7 @@ + @@ -81,10 +80,23 @@ + + + dom:dom-async-data-broker + + inmemory-data-broker + /modules/module[type='dom-concurrent-data-broker'][name='concurrent-data-broker'] + + + - urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl?module=opendaylight-sal-dom-broker-impl&revision=2013-10-28 + urn:opendaylight:params:xml:ns:yang:controller:config:concurrent-data-broker?module=odl-concurrent-data-broker-cfg&revision=2014-11-24 + urn:opendaylight:params:xml:ns:yang:controller:config:distributed-datastore-provider?module=distributed-datastore-privider&revision=2014-06-12 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:config-dom-store?module=opendaylight-config-dom-datastore&revision=2014-06-17 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:core:spi:operational-dom-store?module=opendaylight-operational-dom-datastore&revision=2014-06-17 + urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom?module=opendaylight-md-sal-dom&revision=2013-10-28 diff --git a/opendaylight/md-sal/sal-distributed-datastore/pom.xml b/opendaylight/md-sal/sal-distributed-datastore/pom.xml index 0c3387a5f8..d6030ea457 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/pom.xml +++ b/opendaylight/md-sal/sal-distributed-datastore/pom.xml @@ -114,6 +114,11 @@ org.opendaylight.controller sal-common-util + + org.opendaylight.controller + sal-broker-impl + + org.opendaylight.controller sal-core-spi diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ConcurrentDOMDataBroker.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ConcurrentDOMDataBroker.java similarity index 98% rename from opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ConcurrentDOMDataBroker.java rename to opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ConcurrentDOMDataBroker.java index b26b4c7c1b..13334c9272 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ConcurrentDOMDataBroker.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ConcurrentDOMDataBroker.java @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.controller.md.sal.dom.broker.impl; +package org.opendaylight.controller.cluster.datastore; import com.google.common.base.Preconditions; import com.google.common.collect.Iterables; @@ -24,6 +24,8 @@ import java.util.concurrent.atomic.AtomicInteger; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction; +import org.opendaylight.controller.md.sal.dom.broker.impl.AbstractDOMDataBroker; +import org.opendaylight.controller.md.sal.dom.broker.impl.TransactionCommitFailedExceptionMapper; import org.opendaylight.controller.sal.core.spi.data.DOMStore; import org.opendaylight.controller.sal.core.spi.data.DOMStoreThreePhaseCommitCohort; import org.opendaylight.yangtools.util.DurationStatisticsTracker; diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/concurrent_data_broker/DomConcurrentDataBrokerModule.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/concurrent_data_broker/DomConcurrentDataBrokerModule.java new file mode 100644 index 0000000000..62da307979 --- /dev/null +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/concurrent_data_broker/DomConcurrentDataBrokerModule.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.config.yang.config.concurrent_data_broker; + +import com.google.common.collect.Lists; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import org.opendaylight.controller.cluster.datastore.ConcurrentDOMDataBroker; +import org.opendaylight.controller.config.api.DependencyResolver; +import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; +import org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean; +import org.opendaylight.controller.md.sal.common.util.jmx.ThreadExecutorStatsMXBeanImpl; +import org.opendaylight.controller.md.sal.dom.broker.impl.jmx.CommitStatsMXBeanImpl; +import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreFactory; +import org.opendaylight.controller.sal.core.spi.data.DOMStore; +import org.opendaylight.yangtools.util.DurationStatisticsTracker; +import org.opendaylight.yangtools.util.concurrent.SpecialExecutors; + +public class DomConcurrentDataBrokerModule extends AbstractDomConcurrentDataBrokerModule { + private static final String JMX_BEAN_TYPE = "DOMDataBroker"; + + public DomConcurrentDataBrokerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final DependencyResolver dependencyResolver) { + super(identifier, dependencyResolver); + } + + public DomConcurrentDataBrokerModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final DependencyResolver dependencyResolver, final DomConcurrentDataBrokerModule oldModule, final AutoCloseable oldInstance) { + super(identifier, dependencyResolver, oldModule, oldInstance); + } + + @Override + public AutoCloseable createInstance() { + //Initializing Operational DOM DataStore defaulting to InMemoryDOMDataStore if one is not configured + DOMStore operStore = getOperationalDataStoreDependency(); + if(operStore == null){ + //we will default to InMemoryDOMDataStore creation + operStore = InMemoryDOMDataStoreFactory.create("DOM-OPER", getSchemaServiceDependency()); + } + + DOMStore configStore = getConfigDataStoreDependency(); + if(configStore == null){ + //we will default to InMemoryDOMDataStore creation + configStore = InMemoryDOMDataStoreFactory.create("DOM-CFG", getSchemaServiceDependency()); + } + + final Map datastores = new EnumMap<>(LogicalDatastoreType.class); + datastores.put(LogicalDatastoreType.OPERATIONAL, operStore); + datastores.put(LogicalDatastoreType.CONFIGURATION, configStore); + + /* + * We use an executor for commit ListenableFuture callbacks that favors reusing available + * threads over creating new threads at the expense of execution time. The assumption is + * that most ListenableFuture callbacks won't execute a lot of business logic where we want + * it to run quicker - many callbacks will likely just handle error conditions and do + * nothing on success. The executor queue capacity is bounded and, if the capacity is + * reached, subsequent submitted tasks will block the caller. + */ + ExecutorService listenableFutureExecutor = SpecialExecutors.newBlockingBoundedCachedThreadPool( + getMaxDataBrokerFutureCallbackPoolSize(), getMaxDataBrokerFutureCallbackQueueSize(), + "CommitFutures"); + + final List mBeans = Lists.newArrayList(); + + final DurationStatisticsTracker commitStatsTracker; + final ConcurrentDOMDataBroker cdb = new ConcurrentDOMDataBroker(datastores, listenableFutureExecutor); + commitStatsTracker = cdb.getCommitStatsTracker(); + + if(commitStatsTracker != null) { + final CommitStatsMXBeanImpl commitStatsMXBean = new CommitStatsMXBeanImpl( + commitStatsTracker, JMX_BEAN_TYPE); + commitStatsMXBean.registerMBean(); + mBeans.add(commitStatsMXBean); + } + + final AbstractMXBean commitFutureStatsMXBean = + ThreadExecutorStatsMXBeanImpl.create(listenableFutureExecutor, + "CommitFutureExecutorStats", JMX_BEAN_TYPE, null); + if(commitFutureStatsMXBean != null) { + mBeans.add(commitFutureStatsMXBean); + } + + cdb.setCloseable(new AutoCloseable() { + @Override + public void close() { + for(AbstractMXBean mBean: mBeans) { + mBean.unregisterMBean(); + } + } + }); + + return cdb; + } +} diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/concurrent_data_broker/DomConcurrentDataBrokerModuleFactory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/concurrent_data_broker/DomConcurrentDataBrokerModuleFactory.java new file mode 100644 index 0000000000..d42c444493 --- /dev/null +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/config/yang/config/concurrent_data_broker/DomConcurrentDataBrokerModuleFactory.java @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License v1.0 which accompanies this distribution, + * and is available at http://www.eclipse.org/legal/epl-v10.html + */ +package org.opendaylight.controller.config.yang.config.concurrent_data_broker; + +public class DomConcurrentDataBrokerModuleFactory extends AbstractDomConcurrentDataBrokerModuleFactory { + +} diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/yang/odl-sal-cds-cfg.yang b/opendaylight/md-sal/sal-distributed-datastore/src/main/yang/odl-sal-cds-cfg.yang new file mode 100644 index 0000000000..2abe89316b --- /dev/null +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/yang/odl-sal-cds-cfg.yang @@ -0,0 +1,32 @@ +module odl-concurrent-data-broker-cfg { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:controller:config:concurrent-data-broker"; + prefix "cdb"; + + import config { prefix config; revision-date 2013-04-05; } + import opendaylight-config-dom-datastore {prefix config-dom-store-spi;} + import opendaylight-operational-dom-datastore {prefix operational-dom-store-spi;} + import opendaylight-md-sal-dom {prefix sal; } + import opendaylight-sal-dom-broker-impl { prefix broker; } + + description + "Service definition for concurrent dom broker."; + + revision "2014-11-24" { + description + "Initial revision"; + } + + identity dom-concurrent-data-broker { + base config:module-type; + config:provided-service sal:dom-async-data-broker; + } + + augment "/config:modules/config:module/config:configuration" { + case dom-concurrent-data-broker { + when "/config:modules/config:module/config:type = 'dom-concurrent-data-broker'"; + + uses broker:dom-broker-config; + } + } +} diff --git a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMConcurrentDataCommitCoordinatorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DOMConcurrentDataCommitCoordinatorTest.java similarity index 99% rename from opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMConcurrentDataCommitCoordinatorTest.java rename to opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DOMConcurrentDataCommitCoordinatorTest.java index efc461a0c2..c760349b1e 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/test/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMConcurrentDataCommitCoordinatorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DOMConcurrentDataCommitCoordinatorTest.java @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.controller.md.sal.dom.broker.impl; +package org.opendaylight.controller.cluster.datastore; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertSame; diff --git a/opendaylight/md-sal/sal-dom-broker/pom.xml b/opendaylight/md-sal/sal-dom-broker/pom.xml index 79408669cc..aec7efe46c 100644 --- a/opendaylight/md-sal/sal-dom-broker/pom.xml +++ b/opendaylight/md-sal/sal-dom-broker/pom.xml @@ -88,6 +88,11 @@ org.opendaylight.controller.sal.dom.broker.impl, org.opendaylight.controller.sal.dom.broker.impl.*, + + + org.opendaylight.controller.md.sal.dom.broker.impl, + org.opendaylight.controller.md.sal.dom.broker.impl.jmx, + org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.impl.rev131028.*, org.opendaylight.controller.sal.dom.broker, org.opendaylight.controller.sal.dom.broker.osgi, @@ -98,7 +103,6 @@ org.opendaylight.controller.md.sal.dom.broker.impl, org.opendaylight.controller.md.sal.dom.broker.impl.*, org.opendaylight.yangtools.yang.util, - org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.impl.rev131028.*, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.dom.pingpong.rev141107.* * diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomInmemoryDataBrokerModule.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomInmemoryDataBrokerModule.java index fcbce6f8d7..fffee73b9e 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomInmemoryDataBrokerModule.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/config/yang/md/sal/dom/impl/DomInmemoryDataBrokerModule.java @@ -7,6 +7,7 @@ */ package org.opendaylight.controller.config.yang.md.sal.dom.impl; +import com.google.common.collect.Lists; import java.util.EnumMap; import java.util.List; import java.util.Map; @@ -15,8 +16,6 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitDeadlockException; import org.opendaylight.controller.md.sal.common.util.jmx.AbstractMXBean; import org.opendaylight.controller.md.sal.common.util.jmx.ThreadExecutorStatsMXBeanImpl; -import org.opendaylight.controller.md.sal.dom.broker.impl.ConcurrentDOMDataBroker; -import org.opendaylight.controller.md.sal.dom.broker.impl.AbstractDOMDataBroker; import org.opendaylight.controller.md.sal.dom.broker.impl.SerializedDOMDataBroker; import org.opendaylight.controller.md.sal.dom.broker.impl.jmx.CommitStatsMXBeanImpl; import org.opendaylight.controller.md.sal.dom.store.impl.InMemoryDOMDataStoreFactory; @@ -24,7 +23,6 @@ import org.opendaylight.controller.sal.core.spi.data.DOMStore; import org.opendaylight.yangtools.util.DurationStatisticsTracker; import org.opendaylight.yangtools.util.concurrent.DeadlockDetectingListeningExecutorService; import org.opendaylight.yangtools.util.concurrent.SpecialExecutors; -import com.google.common.collect.Lists; /** * @@ -83,39 +81,30 @@ public final class DomInmemoryDataBrokerModule extends "CommitFutures"); final List mBeans = Lists.newArrayList(); - final DurationStatisticsTracker commitStatsTracker; - final AbstractDOMDataBroker broker; - - if (getAllowConcurrentCommits()) { - final ConcurrentDOMDataBroker cdb = new ConcurrentDOMDataBroker(datastores, listenableFutureExecutor); - commitStatsTracker = cdb.getCommitStatsTracker(); - broker = cdb; - } else { - /* - * We use a single-threaded executor for commits with a bounded queue capacity. If the - * queue capacity is reached, subsequent commit tasks will be rejected and the commits will - * fail. This is done to relieve back pressure. This should be an extreme scenario - either - * there's deadlock(s) somewhere and the controller is unstable or some rogue component is - * continuously hammering commits too fast or the controller is just over-capacity for the - * system it's running on. - */ - ExecutorService commitExecutor = SpecialExecutors.newBoundedSingleThreadExecutor( - getMaxDataBrokerCommitQueueSize(), "WriteTxCommit"); - - SerializedDOMDataBroker sdb = new SerializedDOMDataBroker(datastores, - new DeadlockDetectingListeningExecutorService(commitExecutor, - TransactionCommitDeadlockException.DEADLOCK_EXCEPTION_SUPPLIER, - listenableFutureExecutor)); - commitStatsTracker = sdb.getCommitStatsTracker(); - broker = sdb; - - final AbstractMXBean commitExecutorStatsMXBean = - ThreadExecutorStatsMXBeanImpl.create(commitExecutor, "CommitExecutorStats", - JMX_BEAN_TYPE, null); - if(commitExecutorStatsMXBean != null) { - mBeans.add(commitExecutorStatsMXBean); - } + + /* + * We use a single-threaded executor for commits with a bounded queue capacity. If the + * queue capacity is reached, subsequent commit tasks will be rejected and the commits will + * fail. This is done to relieve back pressure. This should be an extreme scenario - either + * there's deadlock(s) somewhere and the controller is unstable or some rogue component is + * continuously hammering commits too fast or the controller is just over-capacity for the + * system it's running on. + */ + ExecutorService commitExecutor = SpecialExecutors.newBoundedSingleThreadExecutor( + getMaxDataBrokerCommitQueueSize(), "WriteTxCommit"); + + SerializedDOMDataBroker sdb = new SerializedDOMDataBroker(datastores, + new DeadlockDetectingListeningExecutorService(commitExecutor, + TransactionCommitDeadlockException.DEADLOCK_EXCEPTION_SUPPLIER, + listenableFutureExecutor)); + commitStatsTracker = sdb.getCommitStatsTracker(); + + final AbstractMXBean commitExecutorStatsMXBean = + ThreadExecutorStatsMXBeanImpl.create(commitExecutor, "CommitExecutorStats", + JMX_BEAN_TYPE, null); + if(commitExecutorStatsMXBean != null) { + mBeans.add(commitExecutorStatsMXBean); } if(commitStatsTracker != null) { @@ -132,7 +121,7 @@ public final class DomInmemoryDataBrokerModule extends mBeans.add(commitFutureStatsMXBean); } - broker.setCloseable(new AutoCloseable() { + sdb.setCloseable(new AutoCloseable() { @Override public void close() { for(AbstractMXBean mBean: mBeans) { @@ -141,6 +130,6 @@ public final class DomInmemoryDataBrokerModule extends } }); - return broker; + return sdb; } } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/TransactionCommitFailedExceptionMapper.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/TransactionCommitFailedExceptionMapper.java index 3b5c353202..6958f7a249 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/TransactionCommitFailedExceptionMapper.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/TransactionCommitFailedExceptionMapper.java @@ -15,14 +15,14 @@ import org.opendaylight.yangtools.util.concurrent.ExceptionMapper; * * @see ExceptionMapper */ -final class TransactionCommitFailedExceptionMapper +public final class TransactionCommitFailedExceptionMapper extends ExceptionMapper { - static final TransactionCommitFailedExceptionMapper PRE_COMMIT_MAPPER = create("preCommit"); + public static final TransactionCommitFailedExceptionMapper PRE_COMMIT_MAPPER = create("preCommit"); - static final TransactionCommitFailedExceptionMapper CAN_COMMIT_ERROR_MAPPER = create("canCommit"); + public static final TransactionCommitFailedExceptionMapper CAN_COMMIT_ERROR_MAPPER = create("canCommit"); - static final TransactionCommitFailedExceptionMapper COMMIT_ERROR_MAPPER = create("commit"); + public static final TransactionCommitFailedExceptionMapper COMMIT_ERROR_MAPPER = create("commit"); private TransactionCommitFailedExceptionMapper(final String opName) { super( opName, TransactionCommitFailedException.class ); @@ -33,7 +33,7 @@ final class TransactionCommitFailedExceptionMapper } @Override - protected TransactionCommitFailedException newWithCause( String message, Throwable cause ) { + protected TransactionCommitFailedException newWithCause( final String message, final Throwable cause ) { return new TransactionCommitFailedException( message, cause ); } } \ No newline at end of file diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/yang/opendaylight-dom-broker-impl.yang b/opendaylight/md-sal/sal-dom-broker/src/main/yang/opendaylight-dom-broker-impl.yang index fa6d496193..1a553eab52 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/yang/opendaylight-dom-broker-impl.yang +++ b/opendaylight/md-sal/sal-dom-broker/src/main/yang/opendaylight-dom-broker-impl.yang @@ -1,20 +1,20 @@ module opendaylight-sal-dom-broker-impl { - yang-version 1; + yang-version 1; namespace "urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom:impl"; prefix "binding-impl"; - import config { prefix config; revision-date 2013-04-05; } - import opendaylight-md-sal-dom {prefix sal;} - import opendaylight-md-sal-common {prefix common;} - import opendaylight-config-dom-datastore {prefix config-dom-store-spi;} - import opendaylight-operational-dom-datastore {prefix operational-dom-store-spi;} + import config { prefix config; revision-date 2013-04-05; } + import opendaylight-md-sal-dom {prefix sal;} + import opendaylight-md-sal-common {prefix common;} + import opendaylight-config-dom-datastore {prefix config-dom-store-spi;} + import opendaylight-operational-dom-datastore {prefix operational-dom-store-spi;} description "Service definition for Binding Aware MD-SAL. Note: The dom-inmemory-data-broker utilizes configurable config-dom-datastore and operation-dom-datastore. If configuration is not done for this stores then it defaults to InMemoryDOMDataStore"; - + revision "2013-10-28" { description "Initial revision"; @@ -24,14 +24,14 @@ module opendaylight-sal-dom-broker-impl { base config:module-type; config:provided-service sal:dom-broker-osgi-registry; config:java-name-prefix DomBrokerImpl; - } - - + } + + identity dom-inmemory-data-broker { base config:module-type; config:provided-service sal:dom-async-data-broker; } - + identity schema-service-singleton { base config:module-type; config:provided-service sal:schema-service; @@ -69,80 +69,74 @@ module opendaylight-sal-dom-broker-impl { } } } - - augment "/config:modules/config:module/config:configuration" { - case dom-inmemory-data-broker { - when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'"; - - container schema-service { - uses config:service-ref { - refine type { - mandatory false; - config:required-identity sal:schema-service; - } + grouping dom-broker-config { + container schema-service { + uses config:service-ref { + refine type { + mandatory false; + config:required-identity sal:schema-service; } - } + } - container config-data-store{ - uses config:service-ref { - refine type { - mandatory false; - config:required-identity config-dom-store-spi:config-dom-datastore; - } + container config-data-store { + uses config:service-ref { + refine type { + mandatory false; + config:required-identity config-dom-store-spi:config-dom-datastore; } - } + } + } - container operational-data-store{ - uses config:service-ref { - refine type { - mandatory false; - config:required-identity operational-dom-store-spi:operational-dom-datastore; - } + container operational-data-store { + uses config:service-ref { + refine type { + mandatory false; + config:required-identity operational-dom-store-spi:operational-dom-datastore; } - } + } + } - leaf max-data-broker-future-callback-queue-size { - default 1000; - type uint16; - description "The maximum queue size for the data broker's commit future callback executor."; - } + leaf max-data-broker-future-callback-queue-size { + default 1000; + type uint16; + description "The maximum queue size for the data broker's commit future callback executor."; + } - leaf max-data-broker-future-callback-pool-size { - default 20; - type uint16; - description "The maximum thread pool size for the data broker's commit future callback executor."; - } + leaf max-data-broker-future-callback-pool-size { + default 20; + type uint16; + description "The maximum thread pool size for the data broker's commit future callback executor."; + } - leaf max-data-broker-commit-queue-size { - default 5000; - type uint16; - description "The maximum queue size for the data broker's commit executor."; - } + leaf max-data-broker-commit-queue-size { + default 5000; + type uint16; + description "The maximum queue size for the data broker's commit executor."; + } + } - leaf allow-concurrent-commits { - default false; - type boolean; - description "Specifies whether or not to allow 3-phrase commits to run concurrently. - Use with caution. If set to true, the data store implementations must be prepared - to handle concurrent commits. The default is false"; - } + augment "/config:modules/config:module/config:configuration" { + case dom-inmemory-data-broker { + when "/config:modules/config:module/config:type = 'dom-inmemory-data-broker'"; + + uses dom-broker-config; } } - + augment "/config:modules/config:module/config:state" { case schema-service-singleton { when "/config:modules/config:module/config:type = 'schema-service-singleton'"; } } - + augment "/config:modules/config:module/config:state" { case dom-broker-impl { when "/config:modules/config:module/config:type = 'dom-broker-impl'"; container data { uses common:data-state; - } + } } } } -- 2.36.6