rpcbenchmark: use lambdas
[controller.git] / benchmark / rpcbenchmark / src / main / java / rpcbenchmark / impl / RpcbenchmarkProvider.java
index 14358eac0e174000d56109dc0c9ee6f85f67a8fc..503bd170a50fd29e3fb4d8cfe4091e2ac5ab4f33 100644 (file)
@@ -50,8 +50,8 @@ public class RpcbenchmarkProvider implements BindingAwareProvider, AutoCloseable
     private RpcProviderRegistry providerRegistry;
 
     @Override
-    public void onSessionInitiated(ProviderContext session) {
-        LOG.info("RpcbenchmarkProvider Session Initiated");
+    public void onSessionInitiated(final ProviderContext session) {
+        LOG.debug("RpcbenchmarkProvider Session Initiated");
         consumerRegistry = session.getSALService(RpcConsumerRegistry.class);
         providerRegistry = session.getSALService(RpcProviderRegistry.class);
 
@@ -63,12 +63,12 @@ public class RpcbenchmarkProvider implements BindingAwareProvider, AutoCloseable
 
     @Override
     public void close() throws Exception {
-        LOG.info("RpcbenchmarkProvider Closed");
+        LOG.debug("RpcbenchmarkProvider Closed");
     }
 
     @Override
     public Future<RpcResult<StartTestOutput>> startTest(final StartTestInput input) {
-        LOG.info("startTest {}", input);
+        LOG.debug("startTest {}", input);
 
         final RTCClient client;
         final List<RoutedRpcRegistration<?>> rpcRegs = new ArrayList<>();
@@ -105,12 +105,7 @@ public class RpcbenchmarkProvider implements BindingAwareProvider, AutoCloseable
         try {
             ExecutorService executor = Executors.newFixedThreadPool(input.getNumClients().intValue());
 
-            final Runnable testRun = new Runnable() {
-                @Override
-                public void run() {
-                    client.runTest(input.getIterations().intValue());
-                }
-            };
+            final Runnable testRun = () -> client.runTest(input.getIterations().intValue());
 
             LOG.info("Test Started");
             long startTime = System.nanoTime();
@@ -122,7 +117,7 @@ public class RpcbenchmarkProvider implements BindingAwareProvider, AutoCloseable
             executor.shutdown();
             try {
                 executor.awaitTermination(testTimeout, TimeUnit.MINUTES);
-            } catch (InterruptedException e) {
+            } catch (final InterruptedException e) {
                 LOG.error("Out of time: test did not finish within the {} min deadline ", testTimeout); 
             }