From: Tom Pantelis Date: Wed, 7 Jun 2017 14:04:06 +0000 (-0400) Subject: Convert ntfbenchmark to blueprint X-Git-Tag: release/nitrogen~136 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=2188a562d80e6eec5dbb5a29779d2521272ccec6 Convert ntfbenchmark to blueprint Change-Id: I6e4fe58575783d94cf9d01dbcd5b45d50d8b0f60 Signed-off-by: Tom Pantelis --- diff --git a/benchmark/ntfbenchmark/pom.xml b/benchmark/ntfbenchmark/pom.xml index fbf9b91dd5..53bd833fa9 100644 --- a/benchmark/ntfbenchmark/pom.xml +++ b/benchmark/ntfbenchmark/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 ntfbenchmark 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/ntfbenchmark/src/main/config/default-config.xml b/benchmark/ntfbenchmark/src/main/config/default-config.xml deleted file mode 100644 index 9853304339..0000000000 --- a/benchmark/ntfbenchmark/src/main/config/default-config.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - urn:opendaylight:params:xml:ns:yang:ntfbenchmark:impl?module=ntfbenchmark-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:ntfbenchmark - ntfbenchmark-default - - binding:binding-broker-osgi-registry - binding-osgi-broker - - - binding:binding-new-notification-publish-service - binding-notification-publish-adapter - - - binding:binding-new-notification-service - binding-notification-adapter - - - - - - diff --git a/benchmark/ntfbenchmark/src/main/config/maven-metadata-local.xml b/benchmark/ntfbenchmark/src/main/config/maven-metadata-local.xml deleted file mode 100644 index cf4dd85199..0000000000 --- a/benchmark/ntfbenchmark/src/main/config/maven-metadata-local.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - org.opendaylight.controller - ntfbenchmark - 1.1.0-SNAPSHOT - - - true - - 20151113053911 - - - config - xml - 1.1.0-SNAPSHOT - 20151113053911 - - - - diff --git a/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java b/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java index c41729e45e..4b2a1ebdf3 100644 --- a/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java +++ b/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchmarkProvider.java @@ -15,11 +15,8 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; - import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; import org.opendaylight.controller.md.sal.binding.api.NotificationService; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext; -import org.opendaylight.controller.sal.binding.api.BindingAwareProvider; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.rev150105.NtfbenchmarkService; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.rev150105.StartTestInput; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.rev150105.StartTestInput.ProducerType; @@ -32,11 +29,11 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class NtfbenchmarkProvider implements BindingAwareProvider, AutoCloseable, NtfbenchmarkService { +public class NtfbenchmarkProvider implements AutoCloseable, NtfbenchmarkService { private static final Logger LOG = LoggerFactory.getLogger(NtfbenchmarkProvider.class); - private NotificationService listenService; - private NotificationPublishService publishService; + private final NotificationService listenService; + private final NotificationPublishService publishService; private static final int testTimeout = 5; public NtfbenchmarkProvider(final NotificationService listenServiceDependency, @@ -46,15 +43,13 @@ public class NtfbenchmarkProvider implements BindingAwareProvider, AutoCloseable publishService = publishServiceDependency; } - @Override - public void onSessionInitiated(final ProviderContext session) { - LOG.debug("NtfbenchmarkProvider Session Initiated"); - session.addRpcImplementation(NtfbenchmarkService.class, this); + public void init() { + LOG.info("NtfbenchmarkProvider initiated"); } @Override public void close() throws Exception { - LOG.debug("NtfbenchmarkProvider Closed"); + LOG.info("NtfbenchmarkProvider closed"); } @Override @@ -128,8 +123,8 @@ public class NtfbenchmarkProvider implements BindingAwareProvider, AutoCloseable .setListenerOk(allListeners) .setProducerOk(allProducersOk) .setProducerError(allProducersError) - .setProducerRate(((allProducersOk + allProducersError) * 1000000000) / producerElapsedTime) - .setListenerRate((allListeners * 1000000000) / listenerElapsedTime) + .setProducerRate((allProducersOk + allProducersError) * 1000000000 / producerElapsedTime) + .setListenerRate(allListeners * 1000000000 / listenerElapsedTime) .build(); return RpcResultBuilder.success(output).buildFuture(); } finally { diff --git a/benchmark/ntfbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/ntfbenchmark/impl/rev141210/NtfbenchmarkModule.java b/benchmark/ntfbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/ntfbenchmark/impl/rev141210/NtfbenchmarkModule.java deleted file mode 100644 index d418dffabb..0000000000 --- a/benchmark/ntfbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/ntfbenchmark/impl/rev141210/NtfbenchmarkModule.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2015 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.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.impl.rev141210; - -import ntfbenchmark.impl.NtfbenchmarkProvider; - -public class NtfbenchmarkModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.impl.rev141210.AbstractNtfbenchmarkModule { - public NtfbenchmarkModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) { - super(identifier, dependencyResolver); - } - - public NtfbenchmarkModule(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.ntfbenchmark.impl.rev141210.NtfbenchmarkModule 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() { - NtfbenchmarkProvider provider = new NtfbenchmarkProvider(getListenServiceDependency(), getPublishServiceDependency()); - getBrokerDependency().registerProvider(provider); - return provider; - } - -} diff --git a/benchmark/ntfbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/ntfbenchmark/impl/rev141210/NtfbenchmarkModuleFactory.java b/benchmark/ntfbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/ntfbenchmark/impl/rev141210/NtfbenchmarkModuleFactory.java deleted file mode 100644 index 43d7a2e04a..0000000000 --- a/benchmark/ntfbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/ntfbenchmark/impl/rev141210/NtfbenchmarkModuleFactory.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2015 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 - */ -/* -* Generated file -* -* Generated from: yang module name: ntfbenchmark yang module local name: ntfbenchmark -* 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.ntfbenchmark.impl.rev141210; -public class NtfbenchmarkModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbenchmark.impl.rev141210.AbstractNtfbenchmarkModuleFactory { - -} diff --git a/benchmark/ntfbenchmark/src/main/resources/org/opendaylight/blueprint/ntfbenchmark.xml b/benchmark/ntfbenchmark/src/main/resources/org/opendaylight/blueprint/ntfbenchmark.xml new file mode 100644 index 0000000000..93ba1cebff --- /dev/null +++ b/benchmark/ntfbenchmark/src/main/resources/org/opendaylight/blueprint/ntfbenchmark.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + diff --git a/benchmark/ntfbenchmark/src/main/yang/ntfbenchmark-impl.yang b/benchmark/ntfbenchmark/src/main/yang/ntfbenchmark-impl.yang deleted file mode 100644 index b12e10f437..0000000000 --- a/benchmark/ntfbenchmark/src/main/yang/ntfbenchmark-impl.yang +++ /dev/null @@ -1,53 +0,0 @@ -module ntfbenchmark-impl { - yang-version 1; - namespace "urn:opendaylight:params:xml:ns:yang:ntfbenchmark:impl"; - prefix "ntfbenchmark-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-sal-binding-broker-impl {prefix binding-impl; revision-date 2013-10-28;} - - description - "Service definition for ntfbenchmark project"; - - revision "2014-12-10" { - description - "Initial revision"; - } - - identity ntfbenchmark { - base config:module-type; - config:java-name-prefix Ntfbenchmark; - } - - augment "/config:modules/config:module/config:configuration" { - case ntfbenchmark { - when "/config:modules/config:module/config:type = 'ntfbenchmark'"; - container broker { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity md-sal-binding:binding-broker-osgi-registry; - } - } - } - container publish-service { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity binding-impl:binding-new-notification-publish-service; - } - } - } - container listen-service { - uses config:service-ref { - refine type { - mandatory true; - config:required-identity binding-impl:binding-new-notification-service; - } - } - } - - } - } -} diff --git a/features/benchmark/features-mdsal-benchmark/pom.xml b/features/benchmark/features-mdsal-benchmark/pom.xml index dea279b584..72e9812fcd 100644 --- a/features/benchmark/features-mdsal-benchmark/pom.xml +++ b/features/benchmark/features-mdsal-benchmark/pom.xml @@ -68,13 +68,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL ntfbenchmark ${project.version} - - ${project.groupId} - ntfbenchmark - ${project.version} - xml - config - ${project.groupId} rpcbenchmark 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 9e5e5c8954..b1a1a1889a 100644 --- a/features/benchmark/features-mdsal-benchmark/src/main/features/features.xml +++ b/features/benchmark/features-mdsal-benchmark/src/main/features/features.xml @@ -27,7 +27,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html odl-mdsal-broker odl-benchmark-api mvn:org.opendaylight.controller/ntfbenchmark/{{VERSION}} - mvn:org.opendaylight.controller/ntfbenchmark/{{VERSION}}/xml/config odl-dsbenchmark diff --git a/features/benchmark/odl-mdsal-benchmark/pom.xml b/features/benchmark/odl-mdsal-benchmark/pom.xml index 22ad6301c8..ec732703e8 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} - ntfbenchmark - ${project.version} - xml - config - ${project.groupId} 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 36d134267b..f5f1e0a9c2 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/ntfbenchmark/${project.version}/xml/config - mvn:org.opendaylight.controller/rpcbenchmark/${project.version}/xml/config diff --git a/features/benchmark/odl-ntfbenchmark/pom.xml b/features/benchmark/odl-ntfbenchmark/pom.xml index 4ef19c8bf8..03dd870d10 100644 --- a/features/benchmark/odl-ntfbenchmark/pom.xml +++ b/features/benchmark/odl-ntfbenchmark/pom.xml @@ -45,14 +45,6 @@ ntfbenchmark ${project.version} - - - ${project.groupId} - ntfbenchmark - ${project.version} - xml - config - - \ No newline at end of file + diff --git a/features/benchmark/odl-ntfbenchmark/src/main/feature/feature.xml b/features/benchmark/odl-ntfbenchmark/src/main/feature/feature.xml deleted file mode 100644 index ee4127b8ab..0000000000 --- a/features/benchmark/odl-ntfbenchmark/src/main/feature/feature.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - mvn:org.opendaylight.controller/ntfbenchmark/${project.version}/xml/config - - -