* 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) {
@Override
+ @SuppressWarnings("checkstyle:illegalCatch")
public void run() {
int ntfOk = 0;
int ntfError = 0;
lastOkFuture = result;
}
} catch (final Exception e) {
+ LOG.debug("Failed to publish notification", e);
ntfError++;
}
}
try {
lastOkFuture.get();
} catch (InterruptedException | ExecutionException e) {
- throw Throwables.propagate(e);
+ throw new RuntimeException(e);
}
}
}