<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
*/
package org.opendaylight.dsbenchmark;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterList;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterListBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterListKey;
return outerList;
}
- private static List<InnerList> buildInnerList(final int index, final int elements) {
- List<InnerList> innerList = new ArrayList<>(elements);
+ private static Map<InnerListKey, InnerList> buildInnerList(final int index, final int elements) {
+ Builder<InnerListKey, InnerList> innerList = ImmutableMap.builderWithExpectedSize(elements);
final String itemStr = "Item-" + String.valueOf(index) + "-";
for (int i = 0; i < elements; i++) {
- innerList.add(new InnerListBuilder()
- .withKey(new InnerListKey(i))
+ final InnerListKey key = new InnerListKey(i);
+ innerList.put(key, new InnerListBuilder()
+ .withKey(key)
.setName(i)
.setValue(itemStr + String.valueOf(i))
.build());
}
- return innerList;
+ return innerList.build();
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestStatus;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestStatus.ExecStatus;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.TestStatusBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.OuterList;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
}
private void cleanupTestStore() {
- TestExec data = new TestExecBuilder()
- .setOuterList(Collections.<OuterList>emptyList())
- .build();
+ TestExec data = new TestExecBuilder().setOuterList(Collections.emptyMap()).build();
WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
tx.put(LogicalDatastoreType.CONFIGURATION, TEST_EXEC_IID, data);
String[] objectsArray = new String[outerList.getInnerList().size()];
- for (InnerList innerList : outerList.getInnerList()) {
+ for (InnerList innerList : outerList.getInnerList().values()) {
if (objectsArray[innerList.getName()] != null) {
LOG.error("innerList: DUPLICATE name: {}, value: {}", innerList.getName(),
innerList.getValue());
OuterList outerList = optionalDataObject.get();
String[] objectsArray = new String[outerList.getInnerList().size()];
- for (InnerList innerList : outerList.getInnerList()) {
+ for (InnerList innerList : outerList.getInnerList().values()) {
if (objectsArray[innerList.getName()] != null) {
LOG.error("innerList: DUPLICATE name: {}, value: {}", innerList.getName(),
innerList.getValue());
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
*/
package ntfbenchmark.impl;
-import java.util.ArrayList;
-import java.util.List;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbench.payload.rev150709.Ntfbench;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbench.payload.rev150709.NtfbenchBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbench.payload.rev150709.payload.Payload;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbench.payload.rev150709.payload.PayloadBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ntfbench.payload.rev150709.payload.PayloadKey;
public abstract class AbstractNtfbenchProducer implements Runnable {
protected final NotificationPublishService publishService;
this.publishService = publishService;
this.iterations = iterations;
- final List<Payload> listVals = new ArrayList<>();
+ final Builder<PayloadKey, Payload> listVals = ImmutableMap.builderWithExpectedSize(payloadSize);
for (int i = 0; i < payloadSize; i++) {
- listVals.add(new PayloadBuilder().setId(i).build());
+ final PayloadKey key = new PayloadKey(i);
+ listVals.put(key, new PayloadBuilder().withKey(key).build());
}
- ntf = new NtfbenchBuilder().setPayload(listVals).build();
+ ntf = new NtfbenchBuilder().setPayload(listVals.build()).build();
}
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.controller</groupId>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
*/
package rpcbenchmark.impl;
-import java.util.ArrayList;
-import java.util.List;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
+import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicLong;
import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.RpcbenchPayloadService;
import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.payload.Payload;
import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.payload.PayloadBuilder;
+import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.payload.PayloadKey;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
}
this.inSize = inSize;
- List<Payload> listVals = new ArrayList<>();
+ Builder<PayloadKey, Payload> listVals = ImmutableMap.builderWithExpectedSize(inSize);
for (int i = 0; i < inSize; i++) {
- listVals.add(new PayloadBuilder().setId(i).build());
+ final PayloadKey key = new PayloadKey(i);
+ listVals.put(key, new PayloadBuilder().withKey(key).build());
}
- inVal = new GlobalRpcBenchInputBuilder().setPayload(listVals).build();
+ inVal = new GlobalRpcBenchInputBuilder().setPayload(listVals.build()).build();
}
@Override
RpcResult<GlobalRpcBenchOutput> rpcResult = output.get();
if (rpcResult.isSuccessful()) {
- List<Payload> retVal = rpcResult.getResult().getPayload();
+ Map<PayloadKey, Payload> retVal = rpcResult.getResult().getPayload();
if (retVal.size() == inSize) {
ok++;
}
*/
package rpcbenchmark.impl;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadLocalRandom;
import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.RpcbenchPayloadService;
import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.payload.Payload;
import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.payload.PayloadBuilder;
+import org.opendaylight.yang.gen.v1.rpcbench.payload.rev150702.payload.PayloadKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcResult;
import org.slf4j.Logger;
this.inSize = inSize;
this.inVal = new ArrayList<>();
- List<Payload> listVals = new ArrayList<>();
+ Builder<PayloadKey, Payload> listVals = ImmutableMap.builderWithExpectedSize(inSize);
for (int i = 0; i < inSize; i++) {
- listVals.add(new PayloadBuilder().setId(i).build());
+ final PayloadKey key = new PayloadKey(i);
+ listVals.put(key, new PayloadBuilder().withKey(key).build());
}
for (InstanceIdentifier<?> iid : routeIid) {
- inVal.add(new RoutedRpcBenchInputBuilder().setNode(iid).setPayload(listVals).build());
+ inVal.add(new RoutedRpcBenchInputBuilder().setNode(iid).setPayload(listVals.build()).build());
}
}
RpcResult<RoutedRpcBenchOutput> rpcResult = output.get();
if (rpcResult.isSuccessful()) {
- List<Payload> retVal = rpcResult.getResult().getPayload();
+ Map<PayloadKey, Payload> retVal = rpcResult.getResult().getPayload();
if (retVal.size() == inSize) {
ok++;
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<link>https://commons.apache.org/proper/commons-lang/javadocs/api-3.9/</link>
<link>https://commons.apache.org/proper/commons-codec/apidocs/</link>
- <link>https://www.javadoc.io/doc/org.opendaylight.yangtools/yangtools-docs/4.0.6/</link>
- <link>https://www.javadoc.io/doc/org.opendaylight.mdsal/mdsal-docs/5.0.9/</link>
+ <link>https://www.javadoc.io/doc/org.opendaylight.yangtools/yangtools-docs/5.0.0-SNAPSHOT/</link>
+ <link>https://www.javadoc.io/doc/org.opendaylight.mdsal/mdsal-docs/6.0.0-SNAPSHOT/</link>
</links>
<groups>
<group>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>odl-mdsal-binding-base</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.controller</groupId>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-config-netty">
<feature name="odl-config-netty">
- <feature version="[6,7)">odl-netty-4</feature>
+ <feature version="[7,8)">odl-netty-4</feature>
</feature>
</features>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>feature-repo-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>4.0.6</version>
+ <version>5.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="odl-controller-blueprint-${project.version}">
<feature name="odl-controller-blueprint" version="${project.version}">
- <feature version="[4,5)">odl-yangtools-codec</feature>
- <feature version="[5,6)">odl-mdsal-binding-api</feature>
- <feature version="[5,6)">odl-mdsal-binding-runtime</feature>
- <feature version="[5,6)">odl-mdsal-dom-api</feature>
+ <feature version="[5,6)">odl-yangtools-codec</feature>
+ <feature version="[6,7)">odl-mdsal-binding-api</feature>
+ <feature version="[6,7)">odl-mdsal-binding-runtime</feature>
+ <feature version="[6,7)">odl-mdsal-dom-api</feature>
<bundle start-level="40">mvn:org.opendaylight.controller/blueprint/${blueprint.version}</bundle>
</feature>
</features>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="odl-controller-mdsal-common-${project.version}">
<feature name="odl-controller-mdsal-common" version="${project.version}">
- <feature version="[5,6)">odl-mdsal-common</feature>
- <feature version="[5,6)">odl-mdsal-binding-runtime</feature>
+ <feature version="[6,7)">odl-mdsal-common</feature>
+ <feature version="[6,7)">odl-mdsal-binding-runtime</feature>
</feature>
</features>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>4.0.6</version>
+ <version>5.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="odl-mdsal-${project.version}">
<feature name="odl-mdsal-broker-local" version="${project.version}">
- <feature version="[5,6)">odl-mdsal-dom</feature>
- <feature version="[5,6)">odl-mdsal-eos-binding</feature>
- <feature version="[5,6)">odl-mdsal-eos-dom</feature>
- <feature version="[5,6)">odl-mdsal-singleton-dom</feature>
+ <feature version="[6,7)">odl-mdsal-dom</feature>
+ <feature version="[6,7)">odl-mdsal-eos-binding</feature>
+ <feature version="[6,7)">odl-mdsal-eos-dom</feature>
+ <feature version="[6,7)">odl-mdsal-singleton-dom</feature>
</feature>
</features>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="odl-mdsal-${project.version}">
<feature name="odl-mdsal-broker" version="${project.version}">
- <feature version="[5,6)">odl-mdsal-singleton-dom</feature>
- <feature version="[5,6)">odl-mdsal-eos-binding</feature>
+ <feature version="[6,7)">odl-mdsal-singleton-dom</feature>
+ <feature version="[6,7)">odl-mdsal-eos-binding</feature>
</feature>
</features>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>4.0.6</version>
+ <version>5.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-controller-${project.version}">
<feature name="odl-mdsal-clustering-commons" version="${project.version}">
- <feature version="[6,7)">odl-akka-system-2.5</feature>
- <feature version="[6,7)">odl-akka-persistence-2.5</feature>
- <feature version="[6,7)">odl-akka-clustering-2.5</feature>
- <feature version="[6,7)">odl-apache-commons-lang3</feature>
- <feature version="[6,7)">odl-dropwizard-metrics</feature>
- <feature version="[6,7)">odl-servlet-api</feature>
- <feature version="[4,5)">odl-yangtools-data</feature>
- <feature version="[4,5)">odl-yangtools-codec</feature>
+ <feature version="[7,8)">odl-akka-system-2.5</feature>
+ <feature version="[7,8)">odl-akka-persistence-2.5</feature>
+ <feature version="[7,8)">odl-akka-clustering-2.5</feature>
+ <feature version="[7,8)">odl-apache-commons-lang3</feature>
+ <feature version="[7,8)">odl-dropwizard-metrics</feature>
+ <feature version="[7,8)">odl-servlet-api</feature>
+ <feature version="[5,6)">odl-yangtools-data</feature>
+ <feature version="[5,6)">odl-yangtools-codec</feature>
</feature>
</features>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>4.0.6</version>
+ <version>5.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
-->
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0" name="odl-controller-${project.version}">
<feature name="odl-mdsal-distributed-datastore" version="${project.version}">
- <feature version="[6,7)">odl-apache-commons-text</feature>
- <feature version="[4,5)">odl-yangtools-codec</feature>
- <feature version="[5,6)">odl-mdsal-eos-dom</feature>
- <feature version="[5,6)">odl-mdsal-dom-broker</feature>
- <feature version="[5,6)">odl-mdsal-binding-dom-adapter</feature>
+ <feature version="[7,8)">odl-apache-commons-text</feature>
+ <feature version="[5,6)">odl-yangtools-codec</feature>
+ <feature version="[6,7)">odl-mdsal-eos-dom</feature>
+ <feature version="[6,7)">odl-mdsal-dom-broker</feature>
+ <feature version="[6,7)">odl-mdsal-binding-dom-adapter</feature>
<configfile finalname="configuration/initial/akka.conf">
mvn:org.opendaylight.controller/sal-clustering-config/${project.version}/xml/akkaconf
</configfile>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>single-feature-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>odl-mdsal-binding-runtime</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>xml</type>
<classifier>features</classifier>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>karaf4-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>features-mdsal</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<classifier>features</classifier>
<type>xml</type>
<scope>runtime</scope>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yangtools-artifacts</artifactId>
- <version>4.0.6</version>
+ <version>5.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.aries</groupId>
<artifactId>org.apache.aries.util</artifactId>
- <version>1.1.3</version>
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-binding-dom-adapter</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-generator-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-runtime-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
"Module not found in SchemaContext: " + moduleName + "; service: " + service));
LOG.debug("Resolved service {} to module {}", service, module);
- final Collection<RpcDefinition> rpcs = module.getRpcs();
+ final Collection<? extends RpcDefinition> rpcs = module.getRpcs();
final Collection<SchemaPath> ret = new ArrayList<>(rpcs.size());
for (RpcDefinition rpc : rpcs) {
final RpcRoutingStrategy strategy = RpcRoutingStrategy.from(rpc);
Lists lists = new DataStoreAppConfigDefaultXMLReader<>(
getClass(), "/opendaylight-sal-test-store-config.xml",
getDataBrokerTestCustomizer().getSchemaService(),
- getDataBrokerTestCustomizer().getBindingToNormalized(),
+ getDataBrokerTestCustomizer().getAdapterContext().currentSerializer(),
Lists.class).createDefaultInstance();
- UnorderedList element = lists.getUnorderedContainer().getUnorderedList().get(0);
+ UnorderedList element = lists.getUnorderedContainer().getUnorderedList().values().iterator().next();
assertThat(element.getName()).isEqualTo("someName");
assertThat(element.getValue()).isEqualTo("someValue");
}
new DataStoreAppConfigDefaultXMLReader<>(
getClass(), "/badname.xml",
getDataBrokerTestCustomizer().getSchemaService(),
- getDataBrokerTestCustomizer().getBindingToNormalized(),
+ getDataBrokerTestCustomizer().getAdapterContext().currentSerializer(),
Lists.class).createDefaultInstance();
}
}
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<dependencies>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.12</artifactId>
+ <artifactId>akka-actor_2.13</artifactId>
</dependency>
<dependency>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.12</artifactId>
+ <artifactId>akka-testkit_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.12</artifactId>
+ <artifactId>akka-actor_2.13</artifactId>
</dependency>
<dependency>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.12</artifactId>
+ <artifactId>akka-testkit_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<dependencies>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.12</artifactId>
+ <artifactId>akka-actor_2.13</artifactId>
</dependency>
<dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>mdsal-artifacts</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>bundle-parent</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
import static java.util.Objects.requireNonNull;
+import com.google.common.util.concurrent.FluentFuture;
import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.MoreExecutors;
import java.util.Collection;
-import java.util.List;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.CopyOnWriteArraySet;
LOG.debug("Notify existing nodes");
final Pattern nodeRegex = this.nodeIdPattern;
- final ReadTransaction tx = eventSourceTopology.getDataBroker().newReadOnlyTransaction();
- final ListenableFuture<Optional<Topology>> future =
- tx.read(LogicalDatastoreType.OPERATIONAL, EventSourceTopology.EVENT_SOURCE_TOPOLOGY_PATH);
+ final FluentFuture<Optional<Topology>> future;
+ try (ReadTransaction tx = eventSourceTopology.getDataBroker().newReadOnlyTransaction()) {
+ future = tx.read(LogicalDatastoreType.OPERATIONAL, EventSourceTopology.EVENT_SOURCE_TOPOLOGY_PATH);
+ }
- Futures.addCallback(future, new FutureCallback<Optional<Topology>>() {
+ future.addCallback(new FutureCallback<Optional<Topology>>() {
@Override
public void onSuccess(final Optional<Topology> data) {
if (data.isPresent()) {
- final List<Node> nodes = data.get().getNode();
- if (nodes != null) {
- for (final Node node : nodes) {
- if (nodeRegex.matcher(node.getNodeId().getValue()).matches()) {
- notifyNode(EventSourceTopology.EVENT_SOURCE_TOPOLOGY_PATH.child(Node.class,
- node.key()));
- }
+ for (final Node node : data.get().nonnullNode().values()) {
+ if (nodeRegex.matcher(node.getNodeId().getValue()).matches()) {
+ notifyNode(EventSourceTopology.EVENT_SOURCE_TOPOLOGY_PATH.child(Node.class, node.key()));
}
}
}
- tx.close();
}
@Override
public void onFailure(final Throwable ex) {
LOG.error("Can not notify existing nodes", ex);
- tx.close();
}
}, MoreExecutors.directExecutor());
}
import static org.mockito.Mockito.verify;
import com.google.common.util.concurrent.FluentFuture;
-import java.util.ArrayList;
-import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
+import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
RpcConsumerRegistry rpcServiceMock;
CreateTopicInput createTopicInputMock;
ListenerRegistration<?> listenerRegistrationMock;
- NodeKey nodeKey;
ObjectRegistration<EventAggregatorService> aggregatorRpcReg;
@Before
Topology topologyMock = mock(Topology.class);
doReturn(Optional.of(topologyMock)).when(checkedFutureMock).get();
- Node nodeMock = mock(Node.class);
- List<Node> nodeList = new ArrayList<>();
- nodeList.add(nodeMock);
- doReturn(nodeList).when(topologyMock).getNode();
-
- NodeId nodeId = new NodeId("nodeIdValue1");
- doReturn(nodeId).when(nodeMock).getNodeId();
+ final NodeKey nodeKey = new NodeKey(new NodeId("nodeIdValue1"));
+ final Node node = new NodeBuilder().withKey(nodeKey).build();
+ doReturn(Map.of(nodeKey, node)).when(topologyMock).getNode();
}
@Test
Node nodeMock = mock(Node.class);
EventSource eventSourceMock = mock(EventSource.class);
NodeId nodeId = new NodeId("nodeIdValue1");
- nodeKey = new NodeKey(nodeId);
+ NodeKey nodeKey = new NodeKey(nodeId);
doReturn(nodeKey).when(nodeMock).key();
doReturn(nodeKey).when(eventSourceMock).getSourceNodeKey();
ObjectRegistration routedRpcRegistrationMock = mock(ObjectRegistration.class);
topicTestHelper();
EventSource eventSourceMock = mock(EventSource.class);
NodeId nodeId = new NodeId("nodeIdValue1");
- nodeKey = new NodeKey(nodeId);
+ NodeKey nodeKey = new NodeKey(nodeId);
Map<NodeKey, Registration> localMap = eventSourceTopology.getRoutedRpcRegistrations();
NodeKey nodeKeyMock = mock(NodeKey.class);
doReturn(nodeKeyMock).when(eventSourceMock).getSourceNodeKey();
Node nodeMock = mock(Node.class);
EventSource eventSourceMock = mock(EventSource.class);
NodeId nodeId = new NodeId("nodeIdValue1");
- nodeKey = new NodeKey(nodeId);
+ NodeKey nodeKey = new NodeKey(nodeId);
doReturn(nodeKey).when(nodeMock).key();
doReturn(nodeKey).when(eventSourceMock).getSourceNodeKey();
ObjectRegistration routedRpcRegistrationMock = mock(ObjectRegistration.class);
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.12</artifactId>
+ <artifactId>akka-actor_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-cluster_2.12</artifactId>
+ <artifactId>akka-cluster_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-persistence_2.12</artifactId>
+ <artifactId>akka-persistence_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-remote_2.12</artifactId>
+ <artifactId>akka-remote_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.12</artifactId>
+ <artifactId>akka-testkit_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-slf4j_2.12</artifactId>
+ <artifactId>akka-slf4j_2.13</artifactId>
</dependency>
<!-- Test Dependencies -->
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scala.concurrent.Future;
+import scala.jdk.javaapi.CollectionConverters;
/**
* An akka AsyncWriteJournal implementation that stores data in memory. This is intended for testing.
final CountDownLatch latch;
final Class<?> ofType;
- WriteMessagesComplete(int count, Class<?> ofType) {
+ WriteMessagesComplete(final int count, final Class<?> ofType) {
this.latch = new CountDownLatch(count);
this.ofType = ofType;
}
private static final Map<String, CountDownLatch> BLOCK_READ_MESSAGES_LATCHES = new ConcurrentHashMap<>();
- private static Object deserialize(Object data) {
+ private static Object deserialize(final Object data) {
return data instanceof byte[] ? SerializationUtils.deserialize((byte[])data) : data;
}
- public static void addEntry(String persistenceId, long sequenceNr, Object data) {
+ public static void addEntry(final String persistenceId, final long sequenceNr, final Object data) {
Map<Long, Object> journal = JOURNALS.computeIfAbsent(persistenceId, k -> new LinkedHashMap<>());
synchronized (journal) {
}
@SuppressWarnings("unchecked")
- public static <T> List<T> get(String persistenceId, Class<T> type) {
+ public static <T> List<T> get(final String persistenceId, final Class<T> type) {
Map<Long, Object> journalMap = JOURNALS.get(persistenceId);
if (journalMap == null) {
return Collections.<T>emptyList();
}
}
- public static Map<Long, Object> get(String persistenceId) {
+ public static Map<Long, Object> get(final String persistenceId) {
Map<Long, Object> journalMap = JOURNALS.get(persistenceId);
return journalMap != null ? journalMap : Collections.<Long, Object>emptyMap();
}
- public static void dumpJournal(String persistenceId) {
+ public static void dumpJournal(final String persistenceId) {
StringBuilder builder = new StringBuilder(String.format("Journal log for %s:", persistenceId));
Map<Long, Object> journalMap = JOURNALS.get(persistenceId);
if (journalMap != null) {
LOG.info(builder.toString());
}
- public static void waitForDeleteMessagesComplete(String persistenceId) {
+ public static void waitForDeleteMessagesComplete(final String persistenceId) {
if (!Uninterruptibles.awaitUninterruptibly(DELETE_MESSAGES_COMPLETE_LATCHES.get(persistenceId),
5, TimeUnit.SECONDS)) {
throw new AssertionError("Delete messages did not complete");
}
}
- public static void waitForWriteMessagesComplete(String persistenceId) {
+ public static void waitForWriteMessagesComplete(final String persistenceId) {
if (!Uninterruptibles.awaitUninterruptibly(WRITE_MESSAGES_COMPLETE.get(persistenceId).latch,
5, TimeUnit.SECONDS)) {
throw new AssertionError("Journal write messages did not complete");
}
}
- public static void addDeleteMessagesCompleteLatch(String persistenceId) {
+ public static void addDeleteMessagesCompleteLatch(final String persistenceId) {
DELETE_MESSAGES_COMPLETE_LATCHES.put(persistenceId, new CountDownLatch(1));
}
- public static void addWriteMessagesCompleteLatch(String persistenceId, int count) {
+ public static void addWriteMessagesCompleteLatch(final String persistenceId, final int count) {
WRITE_MESSAGES_COMPLETE.put(persistenceId, new WriteMessagesComplete(count, null));
}
- public static void addWriteMessagesCompleteLatch(String persistenceId, int count, Class<?> ofType) {
+ public static void addWriteMessagesCompleteLatch(final String persistenceId, final int count,
+ final Class<?> ofType) {
WRITE_MESSAGES_COMPLETE.put(persistenceId, new WriteMessagesComplete(count, ofType));
}
- public static void addBlockReadMessagesLatch(String persistenceId, CountDownLatch latch) {
+ public static void addBlockReadMessagesLatch(final String persistenceId, final CountDownLatch latch) {
BLOCK_READ_MESSAGES_LATCHES.put(persistenceId, latch);
}
if (++count <= max && entry.getKey() >= fromSequenceNr && entry.getKey() <= toSequenceNr) {
PersistentRepr persistentMessage =
new PersistentImpl(deserialize(entry.getValue()), entry.getKey(), persistenceId,
- null, false, null, null);
+ null, false, null, null, 0);
replayCallback.accept(persistentMessage);
}
}
}
@Override
- public Future<Long> doAsyncReadHighestSequenceNr(String persistenceId, long fromSequenceNr) {
+ public Future<Long> doAsyncReadHighestSequenceNr(final String persistenceId, final long fromSequenceNr) {
LOG.trace("doAsyncReadHighestSequenceNr for {}: fromSequenceNr: {}", persistenceId, fromSequenceNr);
// Akka calls this during recovery.
public Future<Iterable<Optional<Exception>>> doAsyncWriteMessages(final Iterable<AtomicWrite> messages) {
return Futures.future(() -> {
for (AtomicWrite write : messages) {
- // Copy to array - workaround for eclipse "ambiguous method" errors for toIterator, toIterable etc
- PersistentRepr[] array = new PersistentRepr[write.payload().size()];
- write.payload().copyToArray(array);
- for (PersistentRepr repr: array) {
+ for (PersistentRepr repr : CollectionConverters.asJava(write.payload())) {
LOG.trace("doAsyncWriteMessages: id: {}: seqNr: {}, payload: {}", repr.persistenceId(),
repr.sequenceNr(), repr.payload());
}
@Override
- public Future<Void> doAsyncDeleteMessagesTo(String persistenceId, long toSequenceNr) {
+ public Future<Void> doAsyncDeleteMessagesTo(final String persistenceId, final long toSequenceNr) {
LOG.trace("doAsyncDeleteMessagesTo: {}", toSequenceNr);
Map<Long, Object> journal = JOURNALS.get(persistenceId);
if (journal != null) {
<!-- Akka -->
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.12</artifactId>
+ <artifactId>akka-actor_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-persistence_2.12</artifactId>
+ <artifactId>akka-persistence_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-slf4j_2.12</artifactId>
+ <artifactId>akka-slf4j_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.12</artifactId>
+ <artifactId>akka-testkit_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-persistence-tck_2.12</artifactId>
+ <artifactId>akka-persistence-tck_2.13</artifactId>
</dependency>
<!-- Codahale -->
import org.opendaylight.controller.cluster.reporting.MetricsReporter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import scala.collection.Iterator;
-import scala.collection.SeqLike;
import scala.concurrent.Future;
import scala.concurrent.Promise;
+import scala.jdk.javaapi.CollectionConverters;
/**
* This actor handles a single PersistentActor's journal. The journal is split into two {@link SegmentedJournal}s:
}
private void writeRequest(final SegmentedJournalWriter<DataJournalEntry> writer, final AtomicWrite request) {
- // Cast is needed for Eclipse because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=468276
- final Iterator<PersistentRepr> it = ((SeqLike<PersistentRepr, ?>) request.payload()).iterator();
- while (it.hasNext()) {
- final PersistentRepr repr = it.next();
+ for (PersistentRepr repr : CollectionConverters.asJava(request.payload())) {
final Object payload = repr.payload();
if (!(payload instanceof Serializable)) {
throw new UnsupportedOperationException("Non-serializable payload encountered " + payload.getClass());
<!-- Akka -->
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.12</artifactId>
+ <artifactId>akka-actor_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.12</artifactId>
+ <artifactId>akka-testkit_2.13</artifactId>
<scope>test</scope>
</dependency>
import com.google.common.base.Strings;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Maps;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.RemoveShardReplicaOutputBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.get.known.clients._for.all.shards.output.ShardResult1;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.get.known.clients._for.all.shards.output.ShardResult1Builder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.get.known.clients._for.all.shards.output.shard.result.KnownClients;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.get.known.clients._for.all.shards.output.shard.result.KnownClientsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.locate.shard.output.member.node.LeaderActorRefBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.locate.shard.output.member.node.LocalBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.member.voting.states.input.MemberVotingState;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.shard.result.output.ShardResult;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.shard.result.output.ShardResultBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.shard.result.output.ShardResultKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.Empty;
import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
private static RpcResult<GetKnownClientsForAllShardsOutput> processReplies(
final ImmutableMap<ShardIdentifier, ListenableFuture<GetKnownClientsReply>> allShardReplies) {
- final List<ShardResult> result = new ArrayList<>(allShardReplies.size());
+ final Map<ShardResultKey, ShardResult> result = Maps.newHashMapWithExpectedSize(allShardReplies.size());
for (Entry<ShardIdentifier, ListenableFuture<GetKnownClientsReply>> entry : allShardReplies.entrySet()) {
final ListenableFuture<GetKnownClientsReply> future = entry.getValue();
final ShardResultBuilder builder = new ShardResultBuilder()
reply = Futures.getDone(future);
} catch (ExecutionException e) {
LOG.debug("Shard {} failed to answer", entry.getKey(), e);
- result.add(builder.setSucceeded(Boolean.FALSE).setErrorMessage(e.getCause().getMessage()).build());
+ final ShardResult sr = builder
+ .setSucceeded(Boolean.FALSE)
+ .setErrorMessage(e.getCause().getMessage())
+ .build();
+ result.put(sr.key(), sr);
continue;
}
- result.add(builder
- .setSucceeded(Boolean.TRUE)
- .addAugmentation(ShardResult1.class, new ShardResult1Builder()
- .setKnownClients(reply.getClients().stream()
- .map(client -> new KnownClientsBuilder()
- .setMember(client.getFrontendId().getMemberName().toYang())
- .setType(client.getFrontendId().getClientType().toYang())
- .setGeneration(client.getYangGeneration())
- .build())
- .collect(Collectors.toList()))
- .build())
- .build());
+ final ShardResult sr = builder
+ .setSucceeded(Boolean.TRUE)
+ .addAugmentation(ShardResult1.class, new ShardResult1Builder()
+ .setKnownClients(reply.getClients().stream()
+ .map(client -> new KnownClientsBuilder()
+ .setMember(client.getFrontendId().getMemberName().toYang())
+ .setType(client.getFrontendId().getClientType().toYang())
+ .setGeneration(client.getYangGeneration())
+ .build())
+ .collect(Collectors.toMap(KnownClients::key, Function.identity())))
+ .build())
+ .build();
+
+ result.put(sr.key(), sr);
}
return RpcResultBuilder.success(new GetKnownClientsForAllShardsOutputBuilder().setShardResult(result).build())
private static <T> SettableFuture<RpcResult<T>> waitForShardResults(
final List<Entry<ListenableFuture<Success>, ShardResultBuilder>> shardResultData,
- final Function<List<ShardResult>, T> resultDataSupplier,
+ final Function<Map<ShardResultKey, ShardResult>, T> resultDataSupplier,
final String failureLogMsgPrefix) {
final SettableFuture<RpcResult<T>> returnFuture = SettableFuture.create();
- final List<ShardResult> shardResults = new ArrayList<>();
+ final Map<ShardResultKey, ShardResult> shardResults = new HashMap<>();
for (final Entry<ListenableFuture<Success>, ShardResultBuilder> entry : shardResultData) {
Futures.addCallback(entry.getKey(), new FutureCallback<Success>() {
@Override
public void onSuccess(final Success result) {
synchronized (shardResults) {
- ShardResultBuilder shardResult = entry.getValue();
- LOG.debug("onSuccess for shard {}, type {}", shardResult.getShardName(),
- shardResult.getDataStoreType());
- shardResults.add(shardResult.setSucceeded(true).build());
+ final ShardResultBuilder builder = entry.getValue();
+ LOG.debug("onSuccess for shard {}, type {}", builder.getShardName(),
+ builder.getDataStoreType());
+ final ShardResult sr = builder.setSucceeded(Boolean.TRUE).build();
+ shardResults.put(sr.key(), sr);
checkIfComplete();
}
}
@Override
public void onFailure(final Throwable failure) {
synchronized (shardResults) {
- ShardResultBuilder shardResult = entry.getValue();
- LOG.warn("{} for shard {}, type {}", failureLogMsgPrefix, shardResult.getShardName(),
- shardResult.getDataStoreType(), failure);
- shardResults.add(shardResult.setSucceeded(false).setErrorMessage(
- Throwables.getRootCause(failure).getMessage()).build());
+ ShardResultBuilder builder = entry.getValue();
+ LOG.warn("{} for shard {}, type {}", failureLogMsgPrefix, builder.getShardName(),
+ builder.getDataStoreType(), failure);
+ final ShardResult sr = builder
+ .setSucceeded(Boolean.FALSE)
+ .setErrorMessage(Throwables.getRootCause(failure).getMessage())
+ .build();
+ shardResults.put(sr.key(), sr);
checkIfComplete();
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.member.voting.states.input.MemberVotingStateBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.shard.result.output.ShardResult;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.shard.result.output.ShardResultBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.cluster.admin.rev151013.shard.result.output.ShardResultKey;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.opendaylight.yangtools.yang.common.RpcError;
import org.opendaylight.yangtools.yang.common.RpcResult;
});
}
- private static void verifyShardResults(final List<ShardResult> shardResults, final ShardResult... expShardResults) {
+ private static void verifyShardResults(final Map<ShardResultKey, ShardResult> shardResults,
+ final ShardResult... expShardResults) {
Map<String, ShardResult> expResultsMap = new HashMap<>();
for (ShardResult r: expShardResults) {
expResultsMap.put(r.getShardName() + "-" + r.getDataStoreType(), r);
}
- for (ShardResult result: shardResults) {
+ for (ShardResult result: shardResults.values()) {
ShardResult exp = expResultsMap.remove(result.getShardName() + "-" + result.getDataStoreType());
assertNotNull(String.format("Unexpected result for shard %s, type %s", result.getShardName(),
result.getDataStoreType()), exp);
<!-- Akka -->
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.12</artifactId>
+ <artifactId>akka-actor_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-cluster_2.12</artifactId>
+ <artifactId>akka-cluster_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-osgi_2.12</artifactId>
+ <artifactId>akka-osgi_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-persistence_2.12</artifactId>
+ <artifactId>akka-persistence_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-remote_2.12</artifactId>
+ <artifactId>akka-remote_2.13</artifactId>
</dependency>
<dependency>
<!-- Enforce Netty’s optional dependency on servlet API -->
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-slf4j_2.12</artifactId>
+ <artifactId>akka-slf4j_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.12</artifactId>
+ <artifactId>akka-testkit_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-persistence-tck_2.12</artifactId>
+ <artifactId>akka-persistence-tck_2.13</artifactId>
</dependency>
<!-- Codahale -->
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
+++ /dev/null
-/*
- * Copyright (c) 2014 Brocade Communications 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.md.sal.common.util.jmx;
-
-import static java.util.Objects.requireNonNull;
-
-import java.util.List;
-import org.opendaylight.yangtools.util.concurrent.ListenerNotificationQueueStats;
-import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager;
-import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManagerMXBean;
-
-/**
- * Implementation of the QueuedNotificationManagerMXBean interface.
- *
- * <p>
- * This class is not intended for use outside of MD-SAL and its part of private
- * implementation (still exported as public to be reused across MD-SAL implementation
- * components) and may be removed in subsequent
- * releases.
- *
- * @author Thomas Pantelis
- */
-public class QueuedNotificationManagerMXBeanImpl extends AbstractMXBean
- implements QueuedNotificationManagerMXBean {
-
- private final QueuedNotificationManager<?,?> manager;
-
- public QueuedNotificationManagerMXBeanImpl(final QueuedNotificationManager<?,?> manager,
- final String beanName, final String beanType, final String beanCategory) {
- super(beanName, beanType, beanCategory);
- this.manager = requireNonNull(manager);
- }
-
- @Override
- public List<ListenerNotificationQueueStats> getCurrentListenerQueueStats() {
- return manager.getListenerNotificationQueueStats();
- }
-
- @Override
- public int getMaxListenerQueueSize() {
- return manager.getMaxQueueCapacity();
- }
-
- public QueuedNotificationManagerStats toQueuedNotificationManagerStats() {
- return new QueuedNotificationManagerStats(getMaxListenerQueueSize(), getCurrentListenerQueueStats());
- }
-}
+++ /dev/null
-/*
- * Copyright (c) 2014 Brocade Communications 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.md.sal.common.util.jmx;
-
-import java.beans.ConstructorProperties;
-import java.util.List;
-import org.opendaylight.yangtools.util.concurrent.ListenerNotificationQueueStats;
-
-/**
- * A bean class that holds various QueuedNotificationManager statistic metrics. This class is
- * suitable for mapping to the MXBean CompositeDataSupport type.
- *
- * <p>
- * This class is not intended for use outside of MD-SAL and its part of private
- * implementation (still exported as public to be reused across MD-SAL implementation
- * components) and may be removed in subsequent
- * releases.
- * @author Thomas Pantelis
- * @see QueuedNotificationManagerMXBeanImpl
- */
-public class QueuedNotificationManagerStats {
- private final int maxListenerQueueSize;
- private final List<ListenerNotificationQueueStats> currentListenerQueueStats;
-
- @ConstructorProperties({"maxListenerQueueSize","currentListenerQueueStats"})
- public QueuedNotificationManagerStats(int maxListenerQueueSize,
- List<ListenerNotificationQueueStats> currentListenerQueueStats) {
- this.maxListenerQueueSize = maxListenerQueueSize;
- this.currentListenerQueueStats = currentListenerQueueStats;
- }
-
- public List<ListenerNotificationQueueStats> getCurrentListenerQueueStats() {
- return currentListenerQueueStats;
- }
-
- public int getMaxListenerQueueSize() {
- return maxListenerQueueSize;
- }
-}
<!-- Akka -->
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.12</artifactId>
+ <artifactId>akka-actor_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-cluster_2.12</artifactId>
+ <artifactId>akka-cluster_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-osgi_2.12</artifactId>
+ <artifactId>akka-osgi_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-persistence_2.12</artifactId>
+ <artifactId>akka-persistence_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-remote_2.12</artifactId>
+ <artifactId>akka-remote_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-slf4j_2.12</artifactId>
+ <artifactId>akka-slf4j_2.13</artifactId>
</dependency>
<dependency>
<groupId>org.scala-lang.modules</groupId>
- <artifactId>scala-java8-compat_2.12</artifactId>
+ <artifactId>scala-java8-compat_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.12</artifactId>
+ <artifactId>akka-testkit_2.13</artifactId>
<scope>test</scope>
</dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-test-util</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-generator-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-runtime-spi</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
import org.opendaylight.mdsal.dom.spi.store.DOMStoreTreeChangePublisher;
import org.opendaylight.yangtools.concepts.ListenerRegistration;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContextListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scala.concurrent.duration.Duration;
/**
* Base implementation of a distributed DOMStore.
*/
-public abstract class AbstractDataStore implements DistributedDataStoreInterface, SchemaContextListener,
+public abstract class AbstractDataStore implements DistributedDataStoreInterface, EffectiveModelContextListener,
DatastoreContextPropertiesUpdater.Listener, DOMStoreTreeChangePublisher,
DOMDataTreeCommitCohortRegistry, AutoCloseable {
}
@Override
- public void onGlobalContextUpdated(final SchemaContext schemaContext) {
- actorUtils.setSchemaContext(schemaContext);
+ public void onModelContextUpdated(final EffectiveModelContext newModelContext) {
+ actorUtils.setSchemaContext(newModelContext);
}
@Override
*/
package org.opendaylight.controller.cluster.datastore;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.annotations.VisibleForTesting;
import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer;
-import org.opendaylight.mdsal.binding.dom.codec.impl.BindingNormalizedNodeCodecRegistry;
-import org.opendaylight.mdsal.binding.generator.api.ClassLoadingStrategy;
-import org.opendaylight.mdsal.binding.generator.util.BindingRuntimeContext;
import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
/**
* Factory for creating DatastoreContextIntrospector instances.
* @author Thomas Pantelis
*/
public class DatastoreContextIntrospectorFactory {
- private final DOMSchemaService schemaService;
- private final ClassLoadingStrategy classLoadingStrategy;
+ private final BindingNormalizedNodeSerializer serializer;
- public DatastoreContextIntrospectorFactory(DOMSchemaService schemaService,
- ClassLoadingStrategy classLoadingStrategy) {
- this.schemaService = schemaService;
- this.classLoadingStrategy = classLoadingStrategy;
+ public DatastoreContextIntrospectorFactory(final BindingNormalizedNodeSerializer serializer) {
+ this.serializer = requireNonNull(serializer);
}
- public DatastoreContextIntrospector newInstance(LogicalDatastoreType datastoreType) {
- return new DatastoreContextIntrospector(DatastoreContext.newBuilder()
- .logicalStoreType(datastoreType).tempFileDirectory("./data").build(), newBindingSerializer());
+ public DatastoreContextIntrospector newInstance(final LogicalDatastoreType datastoreType) {
+ return newInstance(DatastoreContext.newBuilder()
+ .logicalStoreType(datastoreType)
+ .tempFileDirectory("./data")
+ .build());
}
@VisibleForTesting
- DatastoreContextIntrospector newInstance(DatastoreContext context) {
- return new DatastoreContextIntrospector(context, newBindingSerializer());
- }
-
- private BindingNormalizedNodeSerializer newBindingSerializer() {
- BindingNormalizedNodeCodecRegistry codecRegistry = new BindingNormalizedNodeCodecRegistry(
- BindingRuntimeContext.create(classLoadingStrategy, schemaService.getGlobalContext()));
- return codecRegistry;
+ DatastoreContextIntrospector newInstance(final DatastoreContext context) {
+ return new DatastoreContextIntrospector(context, serializer);
}
}
<odl:static-reference id="schemaService" interface="org.opendaylight.mdsal.dom.api.DOMSchemaService" />
- <reference id="classLoadingStrategy" interface="org.opendaylight.mdsal.binding.generator.api.ClassLoadingStrategy" />
+ <reference id="bindingSerializer" interface="org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer"/>
+
+ <bean id="introspectorFactory" class="org.opendaylight.controller.cluster.datastore.DatastoreContextIntrospectorFactory">
+ <argument ref="bindingSerializer"/>
+ </bean>
<!-- ActorSystemProvider -->
<argument value="./clustered-datastore-restore"/>
</bean>
- <bean id="introspectorFactory" class="org.opendaylight.controller.cluster.datastore.DatastoreContextIntrospectorFactory">
- <argument ref="schemaService"/>
- <argument ref="classLoadingStrategy"/>
- </bean>
-
<bean id="introspectorConfig" factory-ref="introspectorFactory" factory-method="newInstance">
<argument type="org.opendaylight.mdsal.common.api.LogicalDatastoreType" value="CONFIGURATION"/>
</bean>
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.doReturn;
-import static org.mockito.Mockito.mock;
import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_HEARTBEAT_INTERVAL_IN_MILLIS;
import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_OPERATION_TIMEOUT_IN_MS;
import static org.opendaylight.controller.cluster.datastore.DatastoreContext.DEFAULT_SHARD_INITIALIZATION_TIMEOUT;
import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.CONFIGURATION;
import static org.opendaylight.mdsal.common.api.LogicalDatastoreType.OPERATIONAL;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import org.junit.Test;
-import org.opendaylight.mdsal.binding.generator.impl.GeneratedClassLoadingStrategy;
-import org.opendaylight.mdsal.binding.generator.impl.ModuleInfoBackedContext;
-import org.opendaylight.mdsal.binding.spec.reflect.BindingReflections;
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
+import org.opendaylight.binding.runtime.spi.BindingRuntimeHelpers;
+import org.opendaylight.mdsal.binding.dom.codec.impl.BindingCodecContext;
+import org.opendaylight.mdsal.binding.generator.impl.DefaultBindingRuntimeGenerator;
import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStoreConfigProperties;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.config.distributed.datastore.provider.rev140612.DataStorePropertiesContainer;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
/**
* Unit tests for DatastoreContextIntrospector.
*
* @author Thomas Pantelis
*/
-@SuppressWarnings("checkstyle:IllegalCatch")
public class DatastoreContextIntrospectorTest {
-
- static SchemaContext SCHEMA_CONTEXT;
- static DatastoreContextIntrospectorFactory INTROSPECTOR_FACTORY;
-
- static {
- final ModuleInfoBackedContext moduleContext = ModuleInfoBackedContext.create();
- try {
- moduleContext.addModuleInfos(Arrays.asList(
- BindingReflections.getModuleInfo(DataStorePropertiesContainer.class)));
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- SCHEMA_CONTEXT = moduleContext.tryToCreateSchemaContext().get();
-
- DOMSchemaService mockSchemaService = mock(DOMSchemaService.class);
- doReturn(SCHEMA_CONTEXT).when(mockSchemaService).getGlobalContext();
- INTROSPECTOR_FACTORY = new DatastoreContextIntrospectorFactory(mockSchemaService,
- GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy());
- }
+ static final DatastoreContextIntrospectorFactory INTROSPECTOR_FACTORY = new DatastoreContextIntrospectorFactory(
+ new BindingCodecContext(BindingRuntimeHelpers.createRuntimeContext(new DefaultBindingRuntimeGenerator(),
+ DataStorePropertiesContainer.class)));
@Test
public void testYangDefaults() {
import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import scala.concurrent.Await;
public DistributedDataStore setupDistributedDataStore(final String typeName, final String moduleShardsConfig,
final boolean waitUntilLeader,
- final SchemaContext schemaContext) throws Exception {
+ final EffectiveModelContext schemaContext) throws Exception {
return setupDistributedDataStore(typeName, moduleShardsConfig, "modules.conf", waitUntilLeader, schemaContext);
}
public DistributedDataStore setupDistributedDataStore(final String typeName, final String moduleShardsConfig,
final String modulesConfig,
final boolean waitUntilLeader,
- final SchemaContext schemaContext,
+ final EffectiveModelContext schemaContext,
final String... shardNames) throws Exception {
return (DistributedDataStore) setupAbstractDataStore(DistributedDataStore.class, typeName, moduleShardsConfig,
modulesConfig, waitUntilLeader, schemaContext, shardNames);
public AbstractDataStore setupAbstractDataStore(final Class<? extends AbstractDataStore> implementation,
final String typeName, final String moduleShardsConfig,
final boolean waitUntilLeader,
- final SchemaContext schemaContext,
+ final EffectiveModelContext schemaContext,
final String... shardNames) throws Exception {
return setupAbstractDataStore(implementation, typeName, moduleShardsConfig, "modules.conf", waitUntilLeader,
schemaContext, shardNames);
private AbstractDataStore setupAbstractDataStore(final Class<? extends AbstractDataStore> implementation,
final String typeName, final String moduleShardsConfig,
final String modulesConfig, final boolean waitUntilLeader,
- final SchemaContext schemaContext, final String... shardNames)
+ final EffectiveModelContext schemaContext,
+ final String... shardNames)
throws Exception {
final ClusterWrapper cluster = new ClusterWrapperImpl(getSystem());
final Configuration config = new ConfigurationImpl(moduleShardsConfig, modulesConfig);
final AbstractDataStore dataStore = constructor.newInstance(getSystem(), cluster, config, mockContextFactory,
restoreFromSnapshot);
- dataStore.onGlobalContextUpdated(schemaContext);
+ dataStore.onModelContextUpdated(schemaContext);
if (waitUntilLeader) {
waitUntilLeader(dataStore.getActorUtils(), shardNames);
}
public DistributedDataStore setupDistributedDataStoreWithoutConfig(final String typeName,
- final SchemaContext schemaContext) {
+ final EffectiveModelContext schemaContext) {
final ClusterWrapper cluster = new ClusterWrapperImpl(getSystem());
final ConfigurationImpl configuration = new ConfigurationImpl(new EmptyModuleShardConfigProvider());
final DistributedDataStore dataStore = new DistributedDataStore(getSystem(), cluster,
configuration, mockContextFactory, restoreFromSnapshot);
- dataStore.onGlobalContextUpdated(schemaContext);
+ dataStore.onModelContextUpdated(schemaContext);
datastoreContextBuilder = DatastoreContext.newBuilderFrom(datastoreContext);
return dataStore;
}
public DistributedDataStore setupDistributedDataStoreWithoutConfig(final String typeName,
- final SchemaContext schemaContext,
+ final EffectiveModelContext schemaContext,
final LogicalDatastoreType storeType) {
final ClusterWrapper cluster = new ClusterWrapperImpl(getSystem());
final ConfigurationImpl configuration = new ConfigurationImpl(new EmptyModuleShardConfigProvider());
final DistributedDataStore dataStore = new DistributedDataStore(getSystem(), cluster,
configuration, mockContextFactory, restoreFromSnapshot);
- dataStore.onGlobalContextUpdated(schemaContext);
+ dataStore.onModelContextUpdated(schemaContext);
datastoreContextBuilder = DatastoreContext.newBuilderFrom(datastoreContext);
return dataStore;
import org.opendaylight.controller.cluster.raft.client.messages.GetOnDemandRaftState;
import org.opendaylight.controller.cluster.raft.client.messages.OnDemandRaftState;
import org.opendaylight.controller.md.cluster.datastore.model.SchemaContextHelper;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.slf4j.LoggerFactory;
import scala.concurrent.Await;
import scala.concurrent.Future;
private boolean useAkkaArtery = true;
private String[] waitForshardLeader = new String[0];
private String testName;
- private SchemaContext schemaContext;
+ private EffectiveModelContext schemaContext;
private boolean createOperDatastore = true;
private DatastoreContext.Builder datastoreContextBuilder = DatastoreContext.newBuilder()
.shardHeartbeatIntervalInMillis(300).shardElectionTimeoutFactor(30);
*
* @return this Builder
*/
- public Builder schemaContext(final SchemaContext newSchemaContext) {
+ public Builder schemaContext(final EffectiveModelContext newSchemaContext) {
this.schemaContext = newSchemaContext;
return this;
}
* 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.cluster.datastore;
import static org.junit.Assert.assertEquals;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import scala.concurrent.Promise;
@SuppressWarnings({"resource", "checkstyle:IllegalThrows", "checkstyle:AvoidHidingCauseException"})
}
@Test
- public void testReadRoot() throws InterruptedException, ExecutionException,
- java.util.concurrent.TimeoutException {
- SchemaContext schemaContext = SchemaContextHelper.full();
+ public void testReadRoot() throws InterruptedException, ExecutionException, java.util.concurrent.TimeoutException {
+ EffectiveModelContext schemaContext = SchemaContextHelper.full();
Configuration configuration = mock(Configuration.class);
doReturn(configuration).when(mockActorContext).getConfiguration();
doReturn(schemaContext).when(mockActorContext).getSchemaContext();
* 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.cluster.datastore.modification;
import com.google.common.util.concurrent.ListenableFuture;
import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
public abstract class AbstractModificationTest {
- private static SchemaContext TEST_SCHEMA_CONTEXT;
+ private static EffectiveModelContext TEST_SCHEMA_CONTEXT;
protected InMemoryDOMDataStore store;
@Before
public void setUp() {
store = new InMemoryDOMDataStore("test", MoreExecutors.newDirectExecutorService());
- store.onGlobalContextUpdated(TEST_SCHEMA_CONTEXT);
+ store.onModelContextUpdated(TEST_SCHEMA_CONTEXT);
}
protected void commitTransaction(final DOMStoreWriteTransaction transaction) {
* 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.cluster.datastore.utils;
import akka.actor.ActorRef;
import akka.cluster.UniqueAddress;
import org.opendaylight.controller.cluster.access.concepts.MemberName;
import org.opendaylight.controller.cluster.datastore.ClusterWrapper;
-import scala.collection.immutable.Set;
+import scala.collection.immutable.Set.Set1;
public class MockClusterWrapper implements ClusterWrapper {
public static MemberRemoved createMemberRemoved(final String memberName, final String address) {
UniqueAddress uniqueAddress = new UniqueAddress(AddressFromURIString.parse(address), 55L);
- Member member = new Member(uniqueAddress, 1, MemberStatus.removed(), setOf(memberName));
+ Member member = new Member(uniqueAddress, 1, MemberStatus.removed(), new Set1<>(memberName));
return new MemberRemoved(member, MemberStatus.up());
}
public static MemberUp createMemberUp(final String memberName, final String address) {
UniqueAddress uniqueAddress = new UniqueAddress(AddressFromURIString.parse(address), 55L);
- Member member = new Member(uniqueAddress, 1, MemberStatus.up(), setOf(memberName));
+ Member member = new Member(uniqueAddress, 1, MemberStatus.up(), new Set1<>(memberName));
return new MemberUp(member);
}
public static UnreachableMember createUnreachableMember(final String memberName, final String address) {
UniqueAddress uniqueAddress = new UniqueAddress(AddressFromURIString.parse(address), 55L);
- Member member = new Member(uniqueAddress, 1, MemberStatus.up(), setOf(memberName));
+ Member member = new Member(uniqueAddress, 1, MemberStatus.up(), new Set1<>(memberName));
return new UnreachableMember(member);
}
public static ReachableMember createReachableMember(final String memberName, final String address) {
UniqueAddress uniqueAddress = new UniqueAddress(AddressFromURIString.parse(address), 55L);
- Member member = new Member(uniqueAddress, 1, MemberStatus.up(), setOf(memberName));
+ Member member = new Member(uniqueAddress, 1, MemberStatus.up(), new Set1<>(memberName));
return new ReachableMember(member);
}
-
- @SuppressWarnings("unchecked")
- private static Set<String> setOf(final String str) {
- return scala.collection.immutable.Set$.MODULE$.<String>newBuilder().$plus$eq(str).result();
- }
}
* 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.cluster.datastore.utils;
import static org.junit.Assert.assertEquals;
import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
public class NormalizedNodeAggregatorTest {
@Test
public void testAggregate() throws InterruptedException, ExecutionException,
DataValidationFailedException {
- SchemaContext schemaContext = SchemaContextHelper.full();
+ EffectiveModelContext schemaContext = SchemaContextHelper.full();
NormalizedNode<?, ?> expectedNode1 = ImmutableNodes.containerNode(TestModel.TEST_QNAME);
NormalizedNode<?, ?> expectedNode2 = ImmutableNodes.containerNode(CarsModel.CARS_QNAME);
}
- public static NormalizedNode<?, ?> getRootNode(NormalizedNode<?, ?> moduleNode, SchemaContext schemaContext)
- throws ExecutionException, InterruptedException {
+ public static NormalizedNode<?, ?> getRootNode(final NormalizedNode<?, ?> moduleNode,
+ final EffectiveModelContext schemaContext) throws ExecutionException, InterruptedException {
try (InMemoryDOMDataStore store = new InMemoryDOMDataStore("test", Executors.newSingleThreadExecutor())) {
- store.onGlobalContextUpdated(schemaContext);
+ store.onModelContextUpdated(schemaContext);
DOMStoreWriteTransaction writeTransaction = store.newWriteOnlyTransaction();
}
}
- public static NormalizedNode<?,?> findChildWithQName(Collection<NormalizedNode<?, ?>> collection, QName qname) {
+ public static NormalizedNode<?,?> findChildWithQName(final Collection<NormalizedNode<?, ?>> collection,
+ final QName qname) {
for (NormalizedNode<?, ?> node : collection) {
if (node.getNodeType().equals(qname)) {
return node;
import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
import org.opendaylight.yangtools.yang.data.impl.schema.builder.api.CollectionNodeBuilder;
import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
public final class TestModel {
}
- public static SchemaContext createTestContext() {
+ public static EffectiveModelContext createTestContext() {
return YangParserTestUtils.parseYangResource(DATASTORE_TEST_YANG);
}
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.12</artifactId>
+ <artifactId>akka-testkit_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
dataStore = new DistributedDataStore(getSystem(), new MockClusterWrapper(), configuration,
mockContextFactory, null);
- dataStore.onGlobalContextUpdated(EOSTestUtils.SCHEMA_CONTEXT);
+ dataStore.onModelContextUpdated(EOSTestUtils.SCHEMA_CONTEXT);
}
@After
package org.opendaylight.controller.cluster.entityownership;
import java.io.File;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
import org.opendaylight.yangtools.yang.test.util.YangParserTestUtils;
final class EOSTestUtils {
- static final SchemaContext SCHEMA_CONTEXT = YangParserTestUtils.parseYangFiles(
+ static final EffectiveModelContext SCHEMA_CONTEXT = YangParserTestUtils.parseYangFiles(
new File("src/main/yang/entity-owners.yang"));
private EOSTestUtils() {
<dependencies>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.12</artifactId>
+ <artifactId>akka-actor_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-cluster_2.12</artifactId>
+ <artifactId>akka-cluster_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-persistence_2.12</artifactId>
+ <artifactId>akka-persistence_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-remote_2.12</artifactId>
+ <artifactId>akka-remote_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.12</artifactId>
+ <artifactId>akka-testkit_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-slf4j_2.12</artifactId>
+ <artifactId>akka-slf4j_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-osgi_2.12</artifactId>
+ <artifactId>akka-osgi_2.13</artifactId>
</dependency>
<dependency>
<dependencies>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-actor_2.12</artifactId>
+ <artifactId>akka-actor_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-cluster_2.12</artifactId>
+ <artifactId>akka-cluster_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-remote_2.12</artifactId>
+ <artifactId>akka-remote_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-testkit_2.12</artifactId>
+ <artifactId>akka-testkit_2.13</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-osgi_2.12</artifactId>
+ <artifactId>akka-osgi_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-slf4j_2.12</artifactId>
+ <artifactId>akka-slf4j_2.13</artifactId>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
- <artifactId>akka-persistence_2.12</artifactId>
+ <artifactId>akka-persistence_2.13</artifactId>
</dependency>
<!-- SAL Dependencies -->
<dependency>
*/
package org.opendaylight.controller.md.sal.test.model.util;
-import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableMap.Builder;
+import com.google.common.collect.Maps;
import java.util.Arrays;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugment;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.md.sal.test.augment.rev140709.TreeComplexUsesAugmentBuilder;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
public final class ListsBindingUtils {
-
private static final InstanceIdentifier<Top> TOP_PATH = InstanceIdentifier.create(Top.class);
- private ListsBindingUtils() {
- throw new UnsupportedOperationException();
- }
-
public static final TopLevelListKey TOP_FOO_KEY = new TopLevelListKey("foo");
public static final TopLevelListKey TOP_BAR_KEY = new TopLevelListKey("bar");
public static final ListViaUsesKey USES_ONE_KEY = new ListViaUsesKey("one");
public static final ListViaUsesKey USES_TWO_KEY = new ListViaUsesKey("two");
+ private ListsBindingUtils() {
+
+ }
public static InstanceIdentifier<TopLevelList> path(final TopLevelListKey key) {
return TOP_PATH.child(TopLevelList.class, key);
}
public static Top top(final TopLevelList... listItems) {
- return new TopBuilder().setTopLevelList(Arrays.asList(listItems)).build();
+ return new TopBuilder().setTopLevelList(Maps.uniqueIndex(Arrays.asList(listItems), TopLevelList::key)).build();
}
public static TopLevelList topLevelList(final TopLevelListKey key) {
}
public static TreeComplexUsesAugment complexUsesAugment(final ListViaUsesKey... keys) {
- ImmutableList.Builder<ListViaUses> listViaUses = ImmutableList.<ListViaUses>builder();
+ Builder<ListViaUsesKey, ListViaUses> listViaUses = ImmutableMap.builderWithExpectedSize(keys.length);
for (ListViaUsesKey key : keys) {
- listViaUses.add(new ListViaUsesBuilder().withKey(key).build());
+ listViaUses.put(key, new ListViaUsesBuilder().withKey(key).build());
}
return new TreeComplexUsesAugmentBuilder().setListViaUses(listViaUses.build()).build();
}
return new TreeLeafOnlyUsesAugmentBuilder().setLeafFromGrouping(leafFromGroupingValue).build();
}
-
}
WriteTransaction tx = dataProvider.newWriteOnlyTransaction();
- tx.put(LogicalDatastoreType.CONFIGURATION, carPersonIId, carPerson, true);
+ tx.put(LogicalDatastoreType.CONFIGURATION, carPersonIId, carPerson);
tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
.child(Person.class, person.key()).build();
// Place entry in data store tree
WriteTransaction tx = dataProvider.newWriteOnlyTransaction();
- tx.put(LogicalDatastoreType.CONFIGURATION, personId, person, true);
+ tx.put(LogicalDatastoreType.CONFIGURATION, personId, person);
tx.commit().addCallback(new FutureCallback<CommitInfo>() {
@Override
</dependency>
<dependency>
<groupId>org.opendaylight.mdsal</groupId>
- <artifactId>mdsal-binding-dom-adapter</artifactId>
- <type>test-jar</type>
+ <artifactId>mdsal-binding-generator-impl</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-runtime-spi</artifactId>
<scope>test</scope>
</dependency>
- <!-- used to mock up classes -->
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
+ <dependency>
+ <groupId>org.opendaylight.mdsal</groupId>
+ <artifactId>mdsal-binding-dom-adapter</artifactId>
+ <type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.mdsal</groupId>
<artifactId>binding-parent</artifactId>
- <version>5.0.9</version>
+ <version>6.0.0-SNAPSHOT</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<parent>
<groupId>org.opendaylight.odlparent</groupId>
<artifactId>odlparent-lite</artifactId>
- <version>6.0.4</version>
+ <version>7.0.1</version>
<relativePath/>
</parent>
<groupId>org.opendaylight.controller</groupId>