Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Separate out RaftEntryMeta
[controller.git]
/
benchmark
/
ntfbenchmark
/
src
/
main
/
java
/
ntfbenchmark
/
impl
/
NtfbenchNonblockingProducer.java
diff --git
a/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchNonblockingProducer.java
b/benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchNonblockingProducer.java
index c6e2e8affb2af60bb4f88820498a0546a876439e..4b44e1d73dbf2f25bffbd3b4de47f83c03e38f10 100644
(file)
--- a/
benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchNonblockingProducer.java
+++ b/
benchmark/ntfbenchmark/src/main/java/ntfbenchmark/impl/NtfbenchNonblockingProducer.java
@@
-8,14
+8,13
@@
package ntfbenchmark.impl;
import com.google.common.util.concurrent.ListenableFuture;
package ntfbenchmark.impl;
import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.SettableFuture;
import java.util.concurrent.ExecutionException;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import java.util.concurrent.ExecutionException;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class NtfbenchNonblockingProducer extends AbstractNtfbenchProducer {
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) {
public NtfbenchNonblockingProducer(final NotificationPublishService publishService, final int iterations,
final int payloadSize) {
@@
-29,9
+28,9
@@
public class NtfbenchNonblockingProducer extends AbstractNtfbenchProducer {
int ntfOk = 0;
int ntfError = 0;
ListenableFuture<?> lastOkFuture = null;
int ntfOk = 0;
int ntfError = 0;
ListenableFuture<?> lastOkFuture = null;
- for (int i = 0; i <
this.
iterations; i++) {
+ for (int i = 0; i < iterations; i++) {
try {
try {
- final ListenableFuture<?> result =
this.publishService.offerNotification(this.
ntf);
+ final ListenableFuture<?> result =
publishService.offerNotification(
ntf);
if (NotificationPublishService.REJECTED == result) {
ntfError++;
} else {
if (NotificationPublishService.REJECTED == result) {
ntfError++;
} else {
@@
-39,6
+38,7
@@
public class NtfbenchNonblockingProducer extends AbstractNtfbenchProducer {
lastOkFuture = result;
}
} catch (final Exception e) {
lastOkFuture = result;
}
} catch (final Exception e) {
+ LOG.debug("Failed to publish notification", e);
ntfError++;
}
}
ntfError++;
}
}
@@
-50,9
+50,8
@@
public class NtfbenchNonblockingProducer extends AbstractNtfbenchProducer {
try {
lastOkFuture.get();
} catch (InterruptedException | ExecutionException e) {
try {
lastOkFuture.get();
} catch (InterruptedException | ExecutionException e) {
- throw new
Runtim
eException(e);
+ throw new
IllegalStat
eException(e);
}
}
}
}
}
}
-
}
}