use of org.apache.commons.math.random.MersenneTwister in project hbase by apache.
the class GaussianFileListGenerator method iterator.
@Override
public Iterator<List<StoreFile>> iterator() {
return new Iterator<List<StoreFile>>() {
private GaussianRandomGenerator gen = new GaussianRandomGenerator(new MersenneTwister(random.nextInt()));
private int count = 0;
@Override
public boolean hasNext() {
return count < MAX_FILE_GEN_ITERS;
}
@Override
public List<StoreFile> next() {
count += 1;
ArrayList<StoreFile> files = new ArrayList<>(NUM_FILES_GEN);
for (int i = 0; i < NUM_FILES_GEN; i++) {
files.add(createMockStoreFile((int) Math.ceil(Math.max(0, gen.nextNormalizedDouble() * 32 + 32))));
}
return files;
}
@Override
public void remove() {
}
};
}
Aggregations