diff options
Diffstat (limited to 'infra/it')
7 files changed, 20 insertions, 16 deletions
diff --git a/infra/it/benchmark/pom.xml b/infra/it/benchmark/pom.xml index abaec23d6..fa3e2759e 100644 --- a/infra/it/benchmark/pom.xml +++ b/infra/it/benchmark/pom.xml @@ -34,7 +34,7 @@ <packaging>jar</packaging> <properties> - <jmh.version>1.15</jmh.version> + <jmh.version>1.21</jmh.version> <uberjar.name>benchmarks</uberjar.name> </properties> diff --git a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerConfigWriteBenchmark.java b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerConfigWriteBenchmark.java index 245b8654c..4e5c50d5a 100644 --- a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerConfigWriteBenchmark.java +++ b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerConfigWriteBenchmark.java @@ -41,9 +41,9 @@ import java.util.List; import java.util.Optional; import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; -import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.binding.api.WriteTransaction; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.ContainerWithList; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.SimpleContainer; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.container.with.list.ListInContainer; @@ -191,7 +191,7 @@ public class DataBrokerConfigWriteBenchmark extends AbstractModule implements Fi // Commit based on frequency set if (counter % submitFrequency == 0) { try { - tx.submit().get(); + tx.commit().get(); } catch (InterruptedException | ExecutionException e) { throw new RuntimeException("Submit failed", e); } diff --git a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerOperReadBenchmark.java b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerOperReadBenchmark.java index 941978103..a4810bd78 100644 --- a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerOperReadBenchmark.java +++ b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/data/DataBrokerOperReadBenchmark.java @@ -16,6 +16,11 @@ package io.fd.honeycomb.benchmark.data; +import com.google.inject.AbstractModule; +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.Key; +import com.google.inject.Module; import com.google.inject.multibindings.Multibinder; import com.google.inject.name.Names; import io.fd.honeycomb.benchmark.util.DataProvider; @@ -36,9 +41,10 @@ import java.util.List; import java.util.Optional; import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; -import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction; -import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; +import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.mdsal.binding.api.DataBroker; +import org.opendaylight.mdsal.binding.api.ReadTransaction; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.ContainerWithList; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.ContainerWithListBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.hc.test.rev150105.SimpleContainer; @@ -116,7 +122,7 @@ public class DataBrokerOperReadBenchmark extends AbstractModule implements FileM private List<Reader<?, ?>> noopReaders = new ArrayList<>(); private DataBroker dataBroker; private long counter = 0; - private ReadOnlyTransaction tx; + private @NonNull ReadTransaction tx; private HoneycombConfiguration instance; @Setup(Level.Iteration) diff --git a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataProvider.java b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataProvider.java index 7d3df2691..642c5dd63 100644 --- a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataProvider.java +++ b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataProvider.java @@ -171,7 +171,7 @@ public interface DataProvider { private final List<DataProvider> values; private int valueSize; - public MultiValueDataProvider(final List<DataProvider> values) { + MultiValueDataProvider(final List<DataProvider> values) { // Wrap as array list so that index lookup is fast this.values = Lists.newArrayList(values); this.valueSize = values.size(); diff --git a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataSubmitter.java b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataSubmitter.java index 8f5413502..1a263cf49 100644 --- a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataSubmitter.java +++ b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/DataSubmitter.java @@ -16,8 +16,8 @@ package io.fd.honeycomb.benchmark.util; -import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.mdsal.binding.api.WriteTransaction; +import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -26,7 +26,7 @@ public interface DataSubmitter { void submit(LogicalDatastoreType type, WriteTransaction tx, InstanceIdentifier<?> id, DataObject data); - public static DataSubmitter from(String operation) { + static DataSubmitter from(String operation) { switch (operation) { case "put": { return (type, tx, id, data) -> tx.put(type, (InstanceIdentifier) id, data); diff --git a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/NoopWriter.java b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/NoopWriter.java index c42474754..9d4898b0a 100644 --- a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/NoopWriter.java +++ b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/NoopWriter.java @@ -17,7 +17,6 @@ package io.fd.honeycomb.benchmark.util; import io.fd.honeycomb.translate.write.WriteContext; -import io.fd.honeycomb.translate.write.WriteFailedException; import io.fd.honeycomb.translate.write.Writer; import org.opendaylight.yangtools.yang.binding.DataObject; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @@ -43,7 +42,7 @@ public final class NoopWriter<T extends DataObject> implements Writer<T> { public void processModification(@Nonnull final InstanceIdentifier<? extends DataObject> id, @Nullable final DataObject dataBefore, @Nullable final DataObject dataAfter, - @Nonnull final WriteContext ctx) throws WriteFailedException { + @Nonnull final WriteContext ctx) { counter++; // NOOP } diff --git a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/StaticReader.java b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/StaticReader.java index 8e776e1c0..bfbe8d618 100644 --- a/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/StaticReader.java +++ b/infra/it/benchmark/src/main/java/io/fd/honeycomb/benchmark/util/StaticReader.java @@ -17,7 +17,6 @@ package io.fd.honeycomb.benchmark.util; import io.fd.honeycomb.translate.read.ReadContext; -import io.fd.honeycomb.translate.read.ReadFailedException; import io.fd.honeycomb.translate.read.Reader; import java.util.Optional; import javax.annotation.Nonnull; @@ -56,22 +55,22 @@ public final class StaticReader<T extends DataObject, B extends Builder<T>> impl } @Override - public boolean isPresent(final InstanceIdentifier<T> id, final T built, final ReadContext ctx) { + public boolean isPresent(@Nonnull final InstanceIdentifier<T> id, @Nonnull final T built, + @Nonnull final ReadContext ctx) { return true; } @Nonnull @Override public Optional<? extends DataObject> read(@Nonnull final InstanceIdentifier<? extends DataObject> id, - @Nonnull final ReadContext ctx) throws ReadFailedException { + @Nonnull final ReadContext ctx) { counter++; return Optional.of(data.getData(counter)); } @Override public void readCurrentAttributes(@Nonnull final InstanceIdentifier<T> id, @Nonnull final B builder, - @Nonnull final ReadContext ctx) - throws ReadFailedException { + @Nonnull final ReadContext ctx) { throw new UnsupportedOperationException("No read current attrs!"); } |