// ========================================================================
private static final String DIRECTORY = "testfiles";
- private static final String FILE_NAMES[] = { "Test-10", "Test-1K", "Test-10K", "Test-100K" };
- private static final int FILE_SIZES[] = { 10 , 1000 , 10000 , 100000 };
+// private static final String FILE_NAMES[] = { "Test-10", "Test-1K", "Test-10K", "Test-100K" };
+// private static final int FILE_SIZES[] = { 10 , 1000 , 10000 , 100000 };
+ private static final String FILE_NAMES[] = { "Test-10K" };
+ private static final int FILE_SIZES[] = { 10000 };
private static final int NB_SOURCES = 15;
private static final int NB_TYPES = 7;
for (int i = 0; i < FILE_SIZES.length; i++) {
try {
- createTestFile("testfiles" + File.separator + "M-" + FILE_NAMES[i], FILE_SIZES[i], true);
- createTestFile("testfiles" + File.separator + "R-" + FILE_NAMES[i], FILE_SIZES[i], false);
+ createTestFile("testfiles" + File.separator + "O-" + FILE_NAMES[i], FILE_SIZES[i], true, true);
+ createTestFile("testfiles" + File.separator + "E-" + FILE_NAMES[i], FILE_SIZES[i], true, false);
+ createTestFile("testfiles" + File.separator + "R-" + FILE_NAMES[i], FILE_SIZES[i], false, false);
} catch (Exception e) {
}
}
* @throws FileNotFoundException
* @throws IOException
*/
- private static void createTestFile(String file, int size, boolean monotonic) throws FileNotFoundException, IOException {
+ private static void createTestFile(String file, int size, boolean monotonic, boolean odd) throws FileNotFoundException, IOException {
DataOutputStream out;
System.out.println("Creating " + file);
out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
Random generator = new Random(19580427 + size);
- long ts = 0;
+ long ts = (monotonic && odd) ? -1 : 0;
for (int i = 0; i < size; i++) {
- ts += monotonic ? 1 : generator.nextInt(10);
+ ts += monotonic ? 2 : generator.nextInt(10);
int sourceIndex = i % NB_SOURCES;
int typeIndex = i % NB_TYPES;
out.writeLong(ts); // Timestamp