X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=benchmark%2Fntfbenchmark%2Fsrc%2Fmain%2Fjava%2Fntfbenchmark%2Fimpl%2FNtfbenchNonblockingProducer.java;h=b0e239c4d45f99f483c7abbd1ae681d98498f723;hb=refs%2Fchanges%2F64%2F84164%2F1;hp=ce2adc968376b56a4c226c3459433991f2a91dc4;hpb=f1df4d4b606bd729b9f13b7ed19e35203708645d;p=controller.git diff --git a/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchNonblockingProducer.java b/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchNonblockingProducer.java index ce2adc9683..b0e239c4d4 100644 --- a/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchNonblockingProducer.java +++ b/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchNonblockingProducer.java @@ -5,19 +5,16 @@ * 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 ntfbenchmark.impl; -import com.google.common.base.Throwables; import com.google.common.util.concurrent.ListenableFuture; -import com.google.common.util.concurrent.SettableFuture; import java.util.concurrent.ExecutionException; -import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; +import org.opendaylight.mdsal.binding.api.NotificationPublishService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class NtfbenchNonblockingProducer extends AbstractNtfbenchProducer { - - private final SettableFuture lastDeliveryFuture = SettableFuture.create(); - + private static final Logger LOG = LoggerFactory.getLogger(NtfbenchNonblockingProducer.class); public NtfbenchNonblockingProducer(final NotificationPublishService publishService, final int iterations, final int payloadSize) { @@ -26,6 +23,7 @@ public class NtfbenchNonblockingProducer extends AbstractNtfbenchProducer { @Override + @SuppressWarnings("checkstyle:illegalCatch") public void run() { int ntfOk = 0; int ntfError = 0; @@ -40,6 +38,7 @@ public class NtfbenchNonblockingProducer extends AbstractNtfbenchProducer { lastOkFuture = result; } } catch (final Exception e) { + LOG.debug("Failed to publish notification", e); ntfError++; } } @@ -51,7 +50,7 @@ public class NtfbenchNonblockingProducer extends AbstractNtfbenchProducer { try { lastOkFuture.get(); } catch (InterruptedException | ExecutionException e) { - throw Throwables.propagate(e); + throw new RuntimeException(e); } } }