<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>config-parent</artifactId>
- <version>0.7.0-SNAPSHOT</version>
- <relativePath>../../opendaylight/config/config-parent/pom.xml</relativePath>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>binding-parent</artifactId>
+ <version>0.11.0-SNAPSHOT</version>
+ <relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dsbenchmark</artifactId>
<version>1.4.0-SNAPSHOT</version>
<packaging>bundle</packaging>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>mdsal-artifacts</artifactId>
+ <version>1.6.0-SNAPSHOT</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
<dependencies>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>benchmark-api</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.controller</groupId>
+ <artifactId>sal-binding-api</artifactId>
+ </dependency>
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>sal-core-api</artifactId>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- vi: set et smarttab sw=4 tabstop=4: -->
-<!--
-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
--->
-<snapshot>
- <required-capabilities>
- <capability>urn:opendaylight:params:xml:ns:yang:dsbenchmark:impl?module=dsbenchmark-impl&revision=2014-12-10</capability>
- <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding?module=opendaylight-md-sal-binding&revision=2013-10-28</capability>
- </required-capabilities>
- <configuration>
-
- <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
- <modules xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
- <module>
- <type xmlns:prefix="urn:opendaylight:params:xml:ns:yang:dsbenchmark:impl">prefix:dsbenchmark-impl</type>
- <name>dsbenchmark-default</name>
- <broker>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-broker-osgi-registry</type>
- <name>binding-osgi-broker</name>
- </broker>
- <dom-data-broker>
- <type xmlns:dom="urn:opendaylight:params:xml:ns:yang:controller:md:sal:dom">dom:dom-async-data-broker</type>
- <name>pingpong-broker</name>
- </dom-data-broker>
- <binding-data-broker>
- <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-async-data-broker</type>
- <name>pingpong-binding-data-broker</name>
- </binding-data-broker>
- </module>
- </modules>
- </data>
- </configuration>
-</snapshot>
*/
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;
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<TestExec> TEST_EXEC_IID =
private final AtomicReference<ExecStatus> 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<DsbenchmarkService> 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
.setTestsCompleted(tstCompl)
.build();
- WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
+ WriteTransaction tx = simpleTxDataBroker.newWriteOnlyTransaction();
tx.put(LogicalDatastoreType.OPERATIONAL, TEST_STATUS_IID, status);
try {
.setOuterList(Collections.<OuterList>emptyList())
.build();
- WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
+ WriteTransaction tx = simpleTxDataBroker.newWriteOnlyTransaction();
tx.put(LogicalDatastoreType.CONFIGURATION, TEST_EXEC_IID, data);
try {
tx.submit().checkedGet();
throw new IllegalStateException(e);
}
- tx = dataBroker.newWriteOnlyTransaction();
+ tx = simpleTxDataBroker.newWriteOnlyTransaction();
tx.put(LogicalDatastoreType.OPERATIONAL, TEST_EXEC_IID, data);
try {
tx.submit().checkedGet();
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 {
} 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 {
+++ /dev/null
-/*
- * 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;
- }
-
-}
+++ /dev/null
-/*
- * 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 {
-
-}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2017 Inocybe Technologies 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
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
+ odl:use-default-for-reference-types="true">
+
+ <reference id="domDataBroker" interface="org.opendaylight.controller.md.sal.dom.api.DOMDataBroker" odl:type="pingpong"/>
+ <reference id="txChainDataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker" odl:type="pingpong"/>
+ <reference id="simpleTxDataBroker" interface="org.opendaylight.controller.md.sal.binding.api.DataBroker"/>
+
+ <bean id="provider" class="org.opendaylight.dsbenchmark.DsbenchmarkProvider"
+ init-method="init" destroy-method="close">
+ <argument ref="domDataBroker"/>
+ <argument ref="txChainDataBroker"/>
+ <argument ref="simpleTxDataBroker"/>
+ </bean>
+
+ <odl:rpc-implementation ref="provider"/>
+</blueprint>
+++ /dev/null
-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;
- }
- }
- }
- }
- }
-}
<artifactId>dsbenchmark</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>dsbenchmark</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>ntfbenchmark</artifactId>
<feature version='${controller.mdsal.version}'>odl-mdsal-broker</feature>
<feature version='${project.version}'>odl-benchmark-api</feature>
<bundle>mvn:org.opendaylight.controller/dsbenchmark/{{VERSION}}</bundle>
- <configfile finalname="dsbenchmark-impl-default-config.xml">mvn:org.opendaylight.controller/dsbenchmark/{{VERSION}}/xml/config</configfile>
</feature>
<feature name='odl-ntfbenchmark' version='${project.version}' description='OpenDaylight :: ntfbenchmark :: '>
<feature version='${controller.mdsal.version}'>odl-mdsal-broker</feature>
<configfile finalname="ntfbenchmark-impl-default-config.xml">mvn:org.opendaylight.controller/ntfbenchmark/{{VERSION}}/xml/config</configfile>
</feature>
<feature name='odl-mdsal-benchmark' version='${project.version}' description='OpenDaylight :: dsbenchmark :: '>
- <feature version='${controller.mdsal.version}'>odl-mdsal-broker</feature>
- <feature version='${project.version}'>odl-benchmark-api</feature>
- <bundle>mvn:org.opendaylight.controller/benchmark-api/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.controller/dsbenchmark/{{VERSION}}</bundle>
- <bundle>mvn:org.opendaylight.controller/ntfbenchmark/{{VERSION}}</bundle>
+ <feature version='${project.version}'>odl-dsbenchmark</feature>
+ <feature version='${project.version}'>odl-ntfbenchmark</feature>
<bundle>mvn:org.opendaylight.controller/rpcbenchmark/{{VERSION}}</bundle>
- <configfile finalname="dsbenchmark-impl-default-config.xml">mvn:org.opendaylight.controller/dsbenchmark/{{VERSION}}/xml/config</configfile>
- <configfile finalname="ntfbenchmark-impl-default-config.xml">mvn:org.opendaylight.controller/ntfbenchmark/{{VERSION}}/xml/config</configfile>
<configfile finalname="rpcbenchmark-impl-default-config.xml">mvn:org.opendaylight.controller/rpcbenchmark/{{VERSION}}/xml/config</configfile>
</feature>
</features>
<artifactId>dsbenchmark</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <!-- finalname="dsbenchmark-impl-default-config.xml" -->
- <groupId>${project.groupId}</groupId>
- <artifactId>dsbenchmark</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright © 2016, 2017 Red Hat, Inc. and others.
-
- 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
- -->
-<features name="odl-dsbenchmark-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
- <feature name='odl-dsbenchmark' version='${project.version}' description='OpenDaylight :: dsbenchmark :: '>
- <configfile finalname="dsbenchmark-impl-default-config.xml">
- mvn:org.opendaylight.controller/dsbenchmark/${project.version}/xml/config
- </configfile>
- </feature>
-</features>
<artifactId>rpcbenchmark</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <!-- finalname="dsbenchmark-impl-default-config.xml" -->
- <groupId>${project.groupId}</groupId>
- <artifactId>dsbenchmark</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
<dependency>
<!-- finalname="ntfbenchmark-impl-default-config.xml" -->
<groupId>${project.groupId}</groupId>
<classifier>config</classifier>
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
-->
<features name="odl-dsbenchmark-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.2.0">
<feature name="odl-mdsal-benchmark" version="${project.version}">
- <configfile finalname="dsbenchmark-impl-default-config.xml">
- mvn:org.opendaylight.controller/dsbenchmark/${project.version}/xml/config
- </configfile>
<configfile finalname="ntfbenchmark-impl-default-config.xml">
mvn:org.opendaylight.controller/ntfbenchmark/${project.version}/xml/config
</configfile>