示例#1
0
 public LuceneManagedDirectoryService(Random random, boolean preventDoubleWrite) {
   super(new ShardId("fake", 1), ImmutableSettings.EMPTY);
   this.dirs = new Directory[1 + random.nextInt(5)];
   for (int i = 0; i < dirs.length; i++) {
     dirs[i] = newDirectory(random);
     if (dirs[i] instanceof MockDirectoryWrapper) {
       ((MockDirectoryWrapper) dirs[i]).setPreventDoubleWrite(preventDoubleWrite);
       // TODO: fix this test to handle virus checker
       ((MockDirectoryWrapper) dirs[i]).setEnableVirusScanner(false);
     }
   }
   this.random = random;
 }
示例#2
0
 @Override
 public long throttleTimeInNanos() {
   return random.nextInt(1000);
 }