<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>rpcbenchmark</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 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
--->
-<snapshot>
- <required-capabilities>
- <capability>urn:opendaylight:params:xml:ns:yang:rpcbenchmark:impl?module=rpcbenchmark-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:rpcbenchmark:impl">prefix:rpcbenchmark</type>
- <name>rpcbenchmark-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>
- </module>
- </modules>
- </data>
- </configuration>
-</snapshot>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata modelVersion="1.1.0">
- <groupId>org.opendaylight.controller</groupId>
- <artifactId>rpcbenchmark</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <versioning>
- <snapshot>
- <localCopy>true</localCopy>
- </snapshot>
- <lastUpdated>20151122054906</lastUpdated>
- <snapshotVersions>
- <snapshotVersion>
- <classifier>config</classifier>
- <extension>xml</extension>
- <value>1.1.0-SNAPSHOT</value>
- <updated>20151122054906</updated>
- </snapshotVersion>
- </snapshotVersions>
- </versioning>
-</metadata>
+++ /dev/null
-/*
- * 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.rpcbenchmark.impl.rev141210;
-
-import rpcbenchmark.impl.RpcbenchmarkProvider;
-
-public class RpcbenchmarkModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rpcbenchmark.impl.rev141210.AbstractRpcbenchmarkModule {
- public RpcbenchmarkModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
- super(identifier, dependencyResolver);
- }
-
- public RpcbenchmarkModule(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.rpcbenchmark.impl.rev141210.RpcbenchmarkModule 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() {
- RpcbenchmarkProvider provider = new RpcbenchmarkProvider();
- getBrokerDependency().registerProvider(provider);
- return provider;
- }
-
-}
+++ /dev/null
-/*
- * 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: rpcbenchmark yang module local name: rpcbenchmark
-* 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.rpcbenchmark.impl.rev141210;
-public class RpcbenchmarkModuleFactory extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rpcbenchmark.impl.rev141210.AbstractRpcbenchmarkModuleFactory {
-
-}
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
-import org.opendaylight.controller.sal.binding.api.BindingAwareProvider;
-import org.opendaylight.controller.sal.binding.api.RpcConsumerRegistry;
import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.NodeContext;
import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.RpcbenchPayloadService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-public class RpcbenchmarkProvider implements BindingAwareProvider, AutoCloseable, RpcbenchmarkService {
+public class RpcbenchmarkProvider implements AutoCloseable, RpcbenchmarkService {
private static final Logger LOG = LoggerFactory.getLogger(RpcbenchmarkProvider.class);
- private static final GlobalBindingRTCServer gServer = new GlobalBindingRTCServer();
private static final int testTimeout = 5;
+
+ private final GlobalBindingRTCServer globalServer;
private final AtomicReference<ExecStatus> execStatus = new AtomicReference<>(ExecStatus.Idle);
- private RpcConsumerRegistry consumerRegistry;
- private RpcProviderRegistry providerRegistry;
+ private final RpcProviderRegistry providerRegistry;
- @Override
- public void onSessionInitiated(final ProviderContext session) {
- LOG.debug("RpcbenchmarkProvider Session Initiated");
- consumerRegistry = session.getSALService(RpcConsumerRegistry.class);
- providerRegistry = session.getSALService(RpcProviderRegistry.class);
-
- // Register the benchmark Global RPC
- session.addRpcImplementation(RpcbenchPayloadService.class, gServer);
- // Register RPC Benchmark's control REST API
- session.addRpcImplementation(RpcbenchmarkService.class, this);
+ public RpcbenchmarkProvider(final RpcProviderRegistry providerRegistry, final GlobalBindingRTCServer globalServer) {
+ this.providerRegistry = providerRegistry;
+ this.globalServer = globalServer;
+ }
+
+ public void init() {
+ LOG.info("RpcbenchmarkProvider initiated");
}
@Override
- public void close() throws Exception {
- LOG.debug("RpcbenchmarkProvider Closed");
+ public void close() {
+ LOG.info("RpcbenchmarkProvider closed");
}
@Override
rpcRegs.add(routedReg);
}
- client = new RoutedBindingRTClient(consumerRegistry, input.getPayloadSize().intValue(), routeIid);
+ client = new RoutedBindingRTClient(providerRegistry, input.getPayloadSize().intValue(), routeIid);
break;
case GLOBALRTC:
- client = new GlobalBindingRTCClient(consumerRegistry, input.getPayloadSize().intValue());
+ client = new GlobalBindingRTCClient(providerRegistry, input.getPayloadSize().intValue());
break;
default:
try {
executor.awaitTermination(testTimeout, TimeUnit.MINUTES);
} catch (final InterruptedException e) {
- LOG.error("Out of time: test did not finish within the {} min deadline ", testTimeout);
+ LOG.error("Out of time: test did not finish within the {} min deadline ", testTimeout);
}
long endTime = System.nanoTime();
.setGlobalRtcClientError(client.getRpcError())
.setGlobalRtcClientOk(client.getRpcOk())
.setExecTime(TimeUnit.NANOSECONDS.toMillis(elapsedTime))
- .setRate(((client.getRpcOk() + client.getRpcError()) * 1000000000) / elapsedTime)
+ .setRate((client.getRpcOk() + client.getRpcError()) * 1000000000 / elapsedTime)
.build();
return RpcResultBuilder.success(output).buildFuture();
} finally {
public Future<RpcResult<TestStatusOutput>> testStatus() {
LOG.info("testStatus");
TestStatusOutput output = new TestStatusOutputBuilder()
- .setGlobalServerCnt((long)gServer.getNumRpcs())
+ .setGlobalServerCnt((long)globalServer.getNumRpcs())
.setExecStatus(execStatus.get())
.build();
return RpcResultBuilder.success(output).buildFuture();
--- /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">
+
+ <bean id="globalServer" class="rpcbenchmark.impl.GlobalBindingRTCServer"/>
+
+ <reference id="rpcRegistry" interface="org.opendaylight.controller.sal.binding.api.RpcProviderRegistry"/>
+
+ <bean id="provider" class="rpcbenchmark.impl.RpcbenchmarkProvider"
+ init-method="init" destroy-method="close">
+ <argument ref="rpcRegistry"/>
+ <argument ref="globalServer"/>
+ </bean>
+
+ <odl:rpc-implementation ref="globalServer"/>
+ <odl:rpc-implementation ref="provider"/>
+</blueprint>
+++ /dev/null
-module rpcbenchmark-impl {
- yang-version 1;
- namespace "urn:opendaylight:params:xml:ns:yang:rpcbenchmark:impl";
- prefix "rpcbenchmark-impl";
-
- import config { prefix config; revision-date 2013-04-05; }
- import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;}
-
- description
- "Service definition for rpcbenchmark project";
-
- revision "2014-12-10" {
- description
- "Initial revision";
- }
-
- identity rpcbenchmark {
- base config:module-type;
- config:java-name-prefix Rpcbenchmark;
- }
-
- augment "/config:modules/config:module/config:configuration" {
- case rpcbenchmark {
- when "/config:modules/config:module/config:type = 'rpcbenchmark'";
- container broker {
- uses config:service-ref {
- refine type {
- mandatory true;
- config:required-identity md-sal-binding:binding-broker-osgi-registry;
- }
- }
- }
- }
- }
-}
<artifactId>rpcbenchmark</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>${project.groupId}</groupId>
- <artifactId>rpcbenchmark</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>benchmark-api</artifactId>
<feature version='${project.version}'>odl-dsbenchmark</feature>
<feature version='${project.version}'>odl-ntfbenchmark</feature>
<bundle>mvn:org.opendaylight.controller/rpcbenchmark/{{VERSION}}</bundle>
- <configfile finalname="rpcbenchmark-impl-default-config.xml">mvn:org.opendaylight.controller/rpcbenchmark/{{VERSION}}/xml/config</configfile>
</feature>
</features>
<artifactId>rpcbenchmark</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <!-- finalname="rpcbenchmark-impl-default-config.xml" -->
- <groupId>${project.groupId}</groupId>
- <artifactId>rpcbenchmark</artifactId>
- <version>${project.version}</version>
- <type>xml</type>
- <classifier>config</classifier>
- </dependency>
</dependencies>
</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-mdsal-benchmark" version="${project.version}">
- <configfile finalname="rpcbenchmark-impl-default-config.xml">
- mvn:org.opendaylight.controller/rpcbenchmark/${project.version}/xml/config
- </configfile>
- </feature>
-</features>