helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ka...@apache.org
Subject [2/2] git commit: Adds -maxChannelLifeMillis CLI argument to BenchmarkDriver, this closes #3
Date Thu, 11 Sep 2014 03:37:50 GMT
Adds -maxChannelLifeMillis CLI argument to BenchmarkDriver, this closes #3


Project: http://git-wip-us.apache.org/repos/asf/helix/repo
Commit: http://git-wip-us.apache.org/repos/asf/helix/commit/e8cf54e0
Tree: http://git-wip-us.apache.org/repos/asf/helix/tree/e8cf54e0
Diff: http://git-wip-us.apache.org/repos/asf/helix/diff/e8cf54e0

Branch: refs/heads/master
Commit: e8cf54e096afeef8b5669a593efd61c3b8b765d0
Parents: 126849d
Author: Kanak Biscuitwala <kanak.b@hotmail.com>
Authored: Wed Sep 10 20:37:28 2014 -0700
Committer: Kanak Biscuitwala <kanak.b@hotmail.com>
Committed: Wed Sep 10 20:37:28 2014 -0700

----------------------------------------------------------------------
 .../helix/ipc/benchmark/BenchmarkDriver.java    | 29 ++++++++------------
 1 file changed, 11 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/helix/blob/e8cf54e0/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java
----------------------------------------------------------------------
diff --git a/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java b/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java
index 13d9b3f..30b02ce 100644
--- a/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java
+++ b/helix-ipc/src/test/java/org/apache/helix/ipc/benchmark/BenchmarkDriver.java
@@ -70,12 +70,8 @@ public class BenchmarkDriver implements Runnable {
   private String localhost;
   private Thread[] trafficThreads;
 
-  public BenchmarkDriver(int port,
-                         int numPartitions,
-                         int numThreads,
-                         int messageSize,
-                         int numConnections,
-                         long maxChannelLifeMillis) {
+  public BenchmarkDriver(int port, int numPartitions, int numThreads, int messageSize,
+      int numConnections, long maxChannelLifeMillis) {
     this.port = port;
     this.numPartitions = numPartitions;
     this.isShutdown = new AtomicBoolean(true);
@@ -111,10 +107,8 @@ public class BenchmarkDriver implements Runnable {
       localhost = InetAddress.getLocalHost().getCanonicalHostName();
       ipcService =
           new NettyHelixIPCService(new NettyHelixIPCService.Config()
-              .setInstanceName(localhost + "_" + port)
-              .setPort(port)
-              .setNumConnections(numConnections)
-              .setMaxChannelLifeMillis(maxChannelLifeMillis));
+              .setInstanceName(localhost + "_" + port).setPort(port)
+              .setNumConnections(numConnections).setMaxChannelLifeMillis(maxChannelLifeMillis));
 
       // Counts number of messages received, and ack them
       ipcService.registerCallback(MESSAGE_TYPE, new HelixIPCCallback() {
@@ -201,7 +195,8 @@ public class BenchmarkDriver implements Runnable {
     options.addOption("threads", true, "Number of threads");
     options.addOption("messageSize", true, "Message size in bytes");
     options.addOption("numConnections", true, "Number of connections between nodes");
-    options.addOption("maxChannelLifeMillis", true, "Maximum length of time to keep Netty
Channel open");
+    options.addOption("maxChannelLifeMillis", true,
+        "Maximum length of time to keep Netty Channel open");
 
     CommandLine commandLine = new GnuParser().parse(options, args);
 
@@ -220,13 +215,11 @@ public class BenchmarkDriver implements Runnable {
       }
     });
 
-    new BenchmarkDriver(
-            Integer.parseInt(commandLine.getArgs()[0]),
-            Integer.parseInt(commandLine.getOptionValue("partitions", "1")),
-            Integer.parseInt(commandLine.getOptionValue("threads", "1")),
-            Integer.parseInt(commandLine.getOptionValue("messageSize", "1024")),
-            Integer.parseInt(commandLine.getOptionValue("numConnections", "1")),
-            Long.parseLong(commandLine.getOptionValue("maxChannelLifeMillis", "5000"))).run();
+    new BenchmarkDriver(Integer.parseInt(commandLine.getArgs()[0]), Integer.parseInt(commandLine
+        .getOptionValue("partitions", "1")), Integer.parseInt(commandLine.getOptionValue("threads",
+        "1")), Integer.parseInt(commandLine.getOptionValue("messageSize", "1024")),
+        Integer.parseInt(commandLine.getOptionValue("numConnections", "1")),
+        Long.parseLong(commandLine.getOptionValue("maxChannelLifeMillis", "5000"))).run();
 
     latch.await();
   }


Mime
View raw message