示例#1
0
 /** Test specific setup */
 public static void setupTestEnv() {
   // during the tests we run with 100K prealloc in the logs.
   // on windows systems prealloc of 64M was seen to take ~15seconds
   // resulting in test Assert.failure (client timeout on first session).
   // set env and directly in order to handle static init/gc issues
   System.setProperty("zookeeper.preAllocSize", "100");
   FileTxnLog.setPreallocSize(100 * 1024);
 }
  // / XXX: From o.a.zk.t.ClientBase
  private static void setupTestEnv() {
    // during the tests we run with 100K prealloc in the logs.
    // on windows systems prealloc of 64M was seen to take ~15seconds
    // resulting in test failure (client timeout on first session).
    // set env and directly in order to handle static init/gc issues

    // Lily change: make preAllocSize larger again: otherwise, on the next restart, ZooKeeper
    // FileTxnLog
    // throw a CRC error reading the log. Not sure why, as this pre-allocation should only be an
    // optimization.
    System.setProperty("zookeeper.preAllocSize", String.valueOf(8192 * 1024));
    FileTxnLog.setPreallocSize(8192 * 1024);
  }