// Path: java/client/src/main/java/jp/co/rakuten/rit/roma/client/commands/TimeoutFilter.java
// public class TimeoutFilter extends AbstractCommand {
//   // The maximum time to wait (millis)
//   public static long timeout = Long.parseLong(Config.DEFAULT_TIMEOUT_PERIOD);
//   public static int numOfThreads = Integer
//       .parseInt(Config.DEFAULT_NUM_OF_THREADS);
// 
//   public TimeoutFilter(Command next) {
//     super(next);
//   }
// 
//   // public static void shutdown() { }
// 
//   public TimeoutFilter() {
//   }
// 
//   @Override
//   public boolean execute(CommandContext context) throws ClientException {
//     int commandID = (Integer) context.get(CommandContext.COMMAND_ID);
//     Node node = null;
//     ConnectionPool connPool = null;
//     Connection conn = null;
//     Throwable t = null;
//     boolean ret = false;
//     boolean usepool = commandID != CommandID.ROUTING_DUMP;
//     try {
//       node = (Node) context.get(CommandContext.NODE);
//       if (usepool) { // general commands
//         connPool = (ConnectionPool) context.get(CommandContext.CONNECTION_POOL);
//         conn = connPool.get(node);
//         conn.setTimeout((int) timeout);
//         context.put(CommandContext.CONNECTION, conn);
//       } else { // routingdump, routingmkh
//         Socket sock = new Socket(node.getHost(), node.getPort());
//         conn = new Connection(sock);
//         conn.setTimeout((int) timeout);
//         context.put(CommandContext.CONNECTION, conn);
//       }
//       ret = next.execute(context);
// 
//       if (conn != null) {
//         if (usepool) { // general commands
//           conn.setTimeout(0);
//           connPool.put(node, conn);
//         } else { // routingdump, routingmkh
//           try {
//             if (conn != null)
//               conn.close();
//           } catch (IOException e1) {
//           }
//         }
//       }
//       return ret;
//     } catch (java.net.SocketTimeoutException e) {
//       t = e;
//     } catch (IOException e) {
//       t = e;
//     }
// 
//     if (usepool) { // general commands
//       connPool.delete(node, conn);
//     } else { // routingdump, routingmkh
//       try {
//         if (conn != null)
//           conn.close();
//       } catch (IOException e1) {
//       }
//     }
//     throw new ClientException(new TimeoutException(t));
//   }
// 
//   @Override
//   protected void create(CommandContext context) throws ClientException {
//     throw new UnsupportedOperationException();
//   }
// 
//   @Override
//   protected boolean parseResult(CommandContext context) throws ClientException {
//     throw new UnsupportedOperationException();
//   }
// 
//   @Override
//   protected void sendAndReceive(CommandContext context) throws IOException,
//       ClientException {
//     throw new UnsupportedOperationException();
//   }
// }


import java.util.Properties;
import jp.co.rakuten.rit.roma.client.commands.TimeoutFilter;
import junit.framework.TestCase;

        }
      };
    }
    for (int i = 0; i < threads.length; ++i) {
      threads[i].start();
    }

    while (true) {
      Thread.sleep(1000);
    }
  }

  private void big_loop() throws Exception {
    int count = 0;
    while (count < BIG_LOOP_COUNT) {
      small_loop(count);
      count++;
    }
  }

  private void small_loop(int big_count) throws Exception {
    int count = 0;
    int count_threshold = 0;
    String dummy_prefix = makeDummyPrefix();
    long time0 = System.currentTimeMillis();
    while (count < SMALL_LOOP_COUNT) {
      if (count % 1000 == 0) {
        System.out.println("count: " + count);
      }
      try {

// Path: java/client/src/main/java/jp/co/rakuten/rit/roma/client/commands/TimeoutFilter.java
// public class TimeoutFilter extends AbstractCommand {
//   // The maximum time to wait (millis)
//   public static long timeout = Long.parseLong(Config.DEFAULT_TIMEOUT_PERIOD);
//   public static int numOfThreads = Integer
//       .parseInt(Config.DEFAULT_NUM_OF_THREADS);
// 
//   public TimeoutFilter(Command next) {
//     super(next);
//   }
// 
//   // public static void shutdown() { }
// 
//   public TimeoutFilter() {
//   }
// 
//   @Override
//   public boolean execute(CommandContext context) throws ClientException {
//     int commandID = (Integer) context.get(CommandContext.COMMAND_ID);
//     Node node = null;
//     ConnectionPool connPool = null;
//     Connection conn = null;
//     Throwable t = null;
//     boolean ret = false;
//     boolean usepool = commandID != CommandID.ROUTING_DUMP;
//     try {
//       node = (Node) context.get(CommandContext.NODE);
//       if (usepool) { // general commands
//         connPool = (ConnectionPool) context.get(CommandContext.CONNECTION_POOL);
//         conn = connPool.get(node);
//         conn.setTimeout((int) timeout);
//         context.put(CommandContext.CONNECTION, conn);
//       } else { // routingdump, routingmkh
//         Socket sock = new Socket(node.getHost(), node.getPort());
//         conn = new Connection(sock);
//         conn.setTimeout((int) timeout);
//         context.put(CommandContext.CONNECTION, conn);
//       }
//       ret = next.execute(context);
// 
//       if (conn != null) {
//         if (usepool) { // general commands
//           conn.setTimeout(0);
//           connPool.put(node, conn);
//         } else { // routingdump, routingmkh
//           try {
//             if (conn != null)
//               conn.close();
//           } catch (IOException e1) {
//           }
//         }
//       }
//       return ret;
//     } catch (java.net.SocketTimeoutException e) {
//       t = e;
//     } catch (IOException e) {
//       t = e;
//     }
// 
//     if (usepool) { // general commands
//       connPool.delete(node, conn);
//     } else { // routingdump, routingmkh
//       try {
//         if (conn != null)
//           conn.close();
//       } catch (IOException e1) {
//       }
//     }
//     throw new ClientException(new TimeoutException(t));
//   }
// 
//   @Override
//   protected void create(CommandContext context) throws ClientException {
//     throw new UnsupportedOperationException();
//   }
// 
//   @Override
//   protected boolean parseResult(CommandContext context) throws ClientException {
//     throw new UnsupportedOperationException();
//   }
// 
//   @Override
//   protected void sendAndReceive(CommandContext context) throws IOException,
//       ClientException {
//     throw new UnsupportedOperationException();
//   }
// }


// Path: java/client/src/test/java/jp/co/rakuten/rit/roma/client/RomaClientImplPerfTest.java
import java.util.Properties;
import jp.co.rakuten.rit.roma.client.commands.TimeoutFilter;
import junit.framework.TestCase;

        }
      };
    }
    for (int i = 0; i < threads.length; ++i) {
      threads[i].start();
    }

    while (true) {
      Thread.sleep(1000);
    }
  }

  private void big_loop() throws Exception {
    int count = 0;
    while (count < BIG_LOOP_COUNT) {
      small_loop(count);
      count++;
    }
  }

  private void small_loop(int big_count) throws Exception {
    int count = 0;
    int count_threshold = 0;
    String dummy_prefix = makeDummyPrefix();
    long time0 = System.currentTimeMillis();
    while (count < SMALL_LOOP_COUNT) {
      if (count % 1000 == 0) {
        System.out.println("count: " + count);
      }
      try {

        long time = System.currentTimeMillis();
