From: Tom Pantelis Date: Wed, 7 Jun 2017 13:27:56 +0000 (-0400) Subject: Convert dsbenchmark to blueprint X-Git-Tag: release/nitrogen~137 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=46c19a388a9b63622376ff2e3f051486df9be39c Convert dsbenchmark to blueprint Change-Id: I14516ea469ec23aff17bc3d565f859b9edb99d2d Signed-off-by: Tom Pantelis --- diff --git a/benchmark/dsbenchmark/pom.xml b/benchmark/dsbenchmark/pom.xml index c77deb60c0..0b3f023037 100644 --- a/benchmark/dsbenchmark/pom.xml +++ b/benchmark/dsbenchmark/pom.xml @@ -9,10 +9,10 @@ and is available at http://www.eclipse.org/legal/epl-v10.html - org.opendaylight.controller - config-parent - 0.7.0-SNAPSHOT - ../../opendaylight/config/config-parent/pom.xml + org.opendaylight.mdsal + binding-parent + 0.11.0-SNAPSHOT + 4.0.0 @@ -20,12 +20,29 @@ and is available at http://www.eclipse.org/legal/epl-v10.html dsbenchmark 1.4.0-SNAPSHOT bundle + + + + + org.opendaylight.controller + mdsal-artifacts + 1.6.0-SNAPSHOT + pom + import + + + + org.opendaylight.controller benchmark-api ${project.version} + + org.opendaylight.controller + sal-binding-api + org.opendaylight.controller sal-core-api diff --git a/benchmark/dsbenchmark/src/main/config/default-config.xml b/benchmark/dsbenchmark/src/main/config/default-config.xml deleted file mode 100644 index 7fc1b6bc61..0000000000 --- a/benchmark/dsbenchmark/src/main/config/default-config.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - urn:opendaylight:params:xml:ns:yang:dsbenchmark:impl?module=dsbenchmark-impl&revision=2014-12-10 - urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28 - - - - - - - prefix:dsbenchmark-impl - dsbenchmark-default - - binding:binding-broker-osgi-registry - binding-osgi-broker - - - dom:dom-async-data-broker - pingpong-broker - - - binding:binding-async-data-broker - pingpong-binding-data-broker - - - - - - diff --git a/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/DsbenchmarkProvider.java b/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/DsbenchmarkProvider.java index 8af7e15b97..467f35cf60 100644 --- a/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/DsbenchmarkProvider.java +++ b/benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/DsbenchmarkProvider.java @@ -7,18 +7,15 @@ */ package org.opendaylight.dsbenchmark; +import com.google.common.util.concurrent.Futures; import java.util.Collections; import java.util.concurrent.Future; import java.util.concurrent.atomic.AtomicReference; - import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.WriteTransaction; 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.DOMDataBroker; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration; -import org.opendaylight.controller.sal.binding.api.BindingAwareProvider; import org.opendaylight.dsbenchmark.listener.DsbenchmarkListenerProvider; import org.opendaylight.dsbenchmark.simpletx.SimpletxBaDelete; import org.opendaylight.dsbenchmark.simpletx.SimpletxBaRead; @@ -48,9 +45,7 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.util.concurrent.Futures; - -public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkService, AutoCloseable { +public class DsbenchmarkProvider implements DsbenchmarkService, AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(DsbenchmarkProvider.class); private static final InstanceIdentifier TEST_EXEC_IID = @@ -61,35 +56,30 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer private final AtomicReference execStatus = new AtomicReference<>(ExecStatus.Idle); private final DsbenchmarkListenerProvider listenerProvider = new DsbenchmarkListenerProvider(); private final DOMDataBroker domDataBroker; // Async DOM Broker for use with all DOM operations - private final DataBroker bindingDataBroker; // Async Binding-Aware Broker for use in tx chains; initialized to + private final DataBroker txChainDataBroker; // Async Binding-Aware Broker for use in tx chains; initialized to // ping-pong broker in default config (see default-config.xml and // dsbenchmark-impl.yang) - private DataBroker dataBroker; // "Legacy" OSGI Data Broker for use in simple transactions - private RpcRegistration dstReg; + private final DataBroker simpleTxDataBroker; // "Legacy" OSGI Data Broker for use in simple transactions private long testsCompleted = 0; - public DsbenchmarkProvider(final DOMDataBroker domDataBroker, final DataBroker bindingDataBroker) { - // We have to get the DOMDataBroker via the constructor, - // since we can't get it from the session + public DsbenchmarkProvider(final DOMDataBroker domDataBroker, final DataBroker txChainDataBroker, + final DataBroker simpleTxDataBroker) { this.domDataBroker = domDataBroker; - this.bindingDataBroker = bindingDataBroker; + this.txChainDataBroker = txChainDataBroker; + this.simpleTxDataBroker = simpleTxDataBroker; } - @Override - public void onSessionInitiated(final ProviderContext session) { - this.dataBroker = session.getSALService(DataBroker.class); - this.dstReg = session.addRpcImplementation( DsbenchmarkService.class, this ); - listenerProvider.setDataBroker(dataBroker); + public void init() { + listenerProvider.setDataBroker(simpleTxDataBroker); setTestOperData(this.execStatus.get(), testsCompleted); - LOG.debug("DsbenchmarkProvider Session Initiated"); + LOG.info("DsbenchmarkProvider initiated"); } @Override - public void close() throws Exception { - dstReg.close(); - LOG.debug("DsbenchmarkProvider Closed"); + public void close() { + LOG.info("DsbenchmarkProvider closed"); } @Override @@ -171,7 +161,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer .setTestsCompleted(tstCompl) .build(); - WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); + WriteTransaction tx = simpleTxDataBroker.newWriteOnlyTransaction(); tx.put(LogicalDatastoreType.OPERATIONAL, TEST_STATUS_IID, status); try { @@ -188,7 +178,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer .setOuterList(Collections.emptyList()) .build(); - WriteTransaction tx = dataBroker.newWriteOnlyTransaction(); + WriteTransaction tx = simpleTxDataBroker.newWriteOnlyTransaction(); tx.put(LogicalDatastoreType.CONFIGURATION, TEST_EXEC_IID, data); try { tx.submit().checkedGet(); @@ -198,7 +188,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer throw new IllegalStateException(e); } - tx = dataBroker.newWriteOnlyTransaction(); + tx = simpleTxDataBroker.newWriteOnlyTransaction(); tx.put(LogicalDatastoreType.OPERATIONAL, TEST_EXEC_IID, data); try { tx.submit().checkedGet(); @@ -226,13 +216,13 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer if (txType == StartTestInput.TransactionType.SIMPLETX) { if (dataFormat == StartTestInput.DataFormat.BINDINGAWARE) { if (StartTestInput.Operation.DELETE == oper) { - retVal = new SimpletxBaDelete(this.dataBroker, outerListElem, + retVal = new SimpletxBaDelete(this.simpleTxDataBroker, outerListElem, innerListElem,writesPerTx, dataStore); } else if (StartTestInput.Operation.READ == oper) { - retVal = new SimpletxBaRead(this.dataBroker, outerListElem, + retVal = new SimpletxBaRead(this.simpleTxDataBroker, outerListElem, innerListElem, writesPerTx, dataStore); } else { - retVal = new SimpletxBaWrite(this.dataBroker, oper, outerListElem, + retVal = new SimpletxBaWrite(this.simpleTxDataBroker, oper, outerListElem, innerListElem, writesPerTx, dataStore); } } else { @@ -250,13 +240,13 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer } else { if (dataFormat == StartTestInput.DataFormat.BINDINGAWARE) { if (StartTestInput.Operation.DELETE == oper) { - retVal = new TxchainBaDelete(this.bindingDataBroker, outerListElem, + retVal = new TxchainBaDelete(this.txChainDataBroker, outerListElem, innerListElem, writesPerTx, dataStore); } else if (StartTestInput.Operation.READ == oper) { - retVal = new TxchainBaRead(this.bindingDataBroker,outerListElem, + retVal = new TxchainBaRead(this.txChainDataBroker,outerListElem, innerListElem,writesPerTx, dataStore); } else { - retVal = new TxchainBaWrite(this.bindingDataBroker, oper, outerListElem, + retVal = new TxchainBaWrite(this.txChainDataBroker, oper, outerListElem, innerListElem, writesPerTx, dataStore); } } else { diff --git a/benchmark/dsbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/dsbenchmark/impl/rev141210/DsbenchmarkImplModule.java b/benchmark/dsbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/dsbenchmark/impl/rev141210/DsbenchmarkImplModule.java deleted file mode 100644 index 2a38b6e089..0000000000 --- a/benchmark/dsbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/dsbenchmark/impl/rev141210/DsbenchmarkImplModule.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2015 Cisco Systems 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.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210; - -import org.opendaylight.dsbenchmark.DsbenchmarkProvider; - -public class DsbenchmarkImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210.AbstractDsbenchmarkImplModule { - public DsbenchmarkImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public DsbenchmarkImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210.DsbenchmarkImplModule oldModule, final java.lang.AutoCloseable oldInstance) { - super(identifier, dependencyResolver, oldModule, oldInstance); - } - - @Override - public void customValidation() { - // add custom validation form module attributes here. - } - - @Override - public java.lang.AutoCloseable createInstance() { - DsbenchmarkProvider provider = new DsbenchmarkProvider(getDomDataBrokerDependency(), - getBindingDataBrokerDependency()); - getBrokerDependency().registerProvider(provider); - return provider; - } - -} diff --git a/benchmark/dsbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/dsbenchmark/impl/rev141210/DsbenchmarkImplModuleFactory.java b/benchmark/dsbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/dsbenchmark/impl/rev141210/DsbenchmarkImplModuleFactory.java deleted file mode 100644 index f3a89a0702..0000000000 --- a/benchmark/dsbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/dsbenchmark/impl/rev141210/DsbenchmarkImplModuleFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2015 Cisco Systems 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 - */ -/* -* Generated file -* -* Generated from: yang module name: dsbenchmark yang module local name: dsbenchmark -* Generated by: org.opendaylight.controller.config.yangjmxgenerator.plugin.JMXGenerator -* Generated at: Fri Jan 02 13:49:24 CST 2015 -* -* Do not modify this file unless it is present under src/main directory -*/ -package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210; -public class DsbenchmarkImplModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210.AbstractDsbenchmarkImplModuleFactory { - -} diff --git a/benchmark/dsbenchmark/src/main/resources/org/opendaylight/blueprint/dsbenchmark.xml b/benchmark/dsbenchmark/src/main/resources/org/opendaylight/blueprint/dsbenchmark.xml new file mode 100644 index 0000000000..3f7e0cf440 --- /dev/null +++ b/benchmark/dsbenchmark/src/main/resources/org/opendaylight/blueprint/dsbenchmark.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + diff --git a/benchmark/dsbenchmark/src/main/yang/dsbenchmark-impl.yang b/benchmark/dsbenchmark/src/main/yang/dsbenchmark-impl.yang deleted file mode 100644 index d7053c1115..0000000000 --- a/benchmark/dsbenchmark/src/main/yang/dsbenchmark-impl.yang +++ /dev/null @@ -1,52 +0,0 @@ -module dsbenchmark-impl { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:dsbenchmark:impl"; - prefix "dsbenchmark-impl"; - - import config { prefix config; revision-date 2013-04-05; } - import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;} - import opendaylight-md-sal-dom { prefix md-sal-dom; revision-date 2013-10-28;} - - description - "Service definition for dsbenchmark project"; - - revision "2014-12-10" { - description - "Initial revision"; - } - - identity dsbenchmark-impl { - base config:module-type; - config:java-name-prefix DsbenchmarkImpl; - } - - augment "/config:modules/config:module/config:configuration" { - case dsbenchmark-impl { - when "/config:modules/config:module/config:type = 'dsbenchmark-impl'"; - container broker { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity md-sal-binding:binding-broker-osgi-registry; - } - } - } - container dom-data-broker { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity md-sal-dom:dom-async-data-broker; - } - } - } - container binding-data-broker { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity md-sal-binding:binding-async-data-broker; - } - } - } - } - } -} diff --git a/features/benchmark/features-mdsal-benchmark/pom.xml b/features/benchmark/features-mdsal-benchmark/pom.xml index b941735b8b..dea279b584 100644 --- a/features/benchmark/features-mdsal-benchmark/pom.xml +++ b/features/benchmark/features-mdsal-benchmark/pom.xml @@ -63,13 +63,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL dsbenchmark ${project.version} - - ${project.groupId} - dsbenchmark - ${project.version} - xml - config - ${project.groupId} ntfbenchmark diff --git a/features/benchmark/features-mdsal-benchmark/src/main/features/features.xml b/features/benchmark/features-mdsal-benchmark/src/main/features/features.xml index c2626f5669..9e5e5c8954 100644 --- a/features/benchmark/features-mdsal-benchmark/src/main/features/features.xml +++ b/features/benchmark/features-mdsal-benchmark/src/main/features/features.xml @@ -22,7 +22,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html odl-mdsal-broker odl-benchmark-api mvn:org.opendaylight.controller/dsbenchmark/{{VERSION}} - mvn:org.opendaylight.controller/dsbenchmark/{{VERSION}}/xml/config odl-mdsal-broker @@ -31,14 +30,9 @@ and is available at http://www.eclipse.org/legal/epl-v10.html mvn:org.opendaylight.controller/ntfbenchmark/{{VERSION}}/xml/config - odl-mdsal-broker - odl-benchmark-api - mvn:org.opendaylight.controller/benchmark-api/{{VERSION}} - mvn:org.opendaylight.controller/dsbenchmark/{{VERSION}} - mvn:org.opendaylight.controller/ntfbenchmark/{{VERSION}} + odl-dsbenchmark + odl-ntfbenchmark mvn:org.opendaylight.controller/rpcbenchmark/{{VERSION}} - mvn:org.opendaylight.controller/dsbenchmark/{{VERSION}}/xml/config - mvn:org.opendaylight.controller/ntfbenchmark/{{VERSION}}/xml/config mvn:org.opendaylight.controller/rpcbenchmark/{{VERSION}}/xml/config diff --git a/features/benchmark/odl-dsbenchmark/pom.xml b/features/benchmark/odl-dsbenchmark/pom.xml index d4ca5c8f64..f23997802b 100644 --- a/features/benchmark/odl-dsbenchmark/pom.xml +++ b/features/benchmark/odl-dsbenchmark/pom.xml @@ -45,13 +45,5 @@ dsbenchmark ${project.version} - - - ${project.groupId} - dsbenchmark - ${project.version} - xml - config - - \ No newline at end of file + diff --git a/features/benchmark/odl-dsbenchmark/src/main/feature/feature.xml b/features/benchmark/odl-dsbenchmark/src/main/feature/feature.xml deleted file mode 100644 index fc4cb01cd5..0000000000 --- a/features/benchmark/odl-dsbenchmark/src/main/feature/feature.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - mvn:org.opendaylight.controller/dsbenchmark/${project.version}/xml/config - - - diff --git a/features/benchmark/odl-mdsal-benchmark/pom.xml b/features/benchmark/odl-mdsal-benchmark/pom.xml index 6741a45aac..22ad6301c8 100644 --- a/features/benchmark/odl-mdsal-benchmark/pom.xml +++ b/features/benchmark/odl-mdsal-benchmark/pom.xml @@ -60,14 +60,6 @@ rpcbenchmark ${project.version} - - - ${project.groupId} - dsbenchmark - ${project.version} - xml - config - ${project.groupId} @@ -85,4 +77,4 @@ config - \ No newline at end of file + diff --git a/features/benchmark/odl-mdsal-benchmark/src/main/feature/feature.xml b/features/benchmark/odl-mdsal-benchmark/src/main/feature/feature.xml index 08b0dc0faa..36d134267b 100644 --- a/features/benchmark/odl-mdsal-benchmark/src/main/feature/feature.xml +++ b/features/benchmark/odl-mdsal-benchmark/src/main/feature/feature.xml @@ -8,9 +8,6 @@ --> - - mvn:org.opendaylight.controller/dsbenchmark/${project.version}/xml/config - mvn:org.opendaylight.controller/ntfbenchmark/${project.version}/xml/config