use of org.h2.mvstore.type.ObjectDataType in project h2database by h2database.
the class TestMVStore method testLargeImport.
private void testLargeImport() {
String fileName = getBaseDir() + "/" + getTestName();
FileUtils.delete(fileName);
int len = 1000;
for (int j = 0; j < 5; j++) {
FileUtils.delete(fileName);
MVStore s = openStore(fileName, 40);
MVMap<Integer, Object[]> m = s.openMap("data", new MVMap.Builder<Integer, Object[]>().valueType(new RowDataType(new DataType[] { new ObjectDataType(), StringDataType.INSTANCE, StringDataType.INSTANCE })));
// long t = System.nanoTime();
for (int i = 0; i < len; ) {
Object[] o = new Object[3];
o[0] = i;
o[1] = "Hello World";
o[2] = "World";
m.put(i, o);
i++;
if (i % 10000 == 0) {
s.commit();
}
}
s.close();
// System.out.println(prof.getTop(5));
// System.out.println("store time " +
// TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - t));
// System.out.println("store size " +
// FileUtils.size(fileName));
}
}
Aggregations