}
public void testBplusTreeUniq() throws IOException, DbException {
File tmpFile = File.createTempFile("btree", ".tmp");
tmpFile.deleteOnExit();
BTree btree = new BTree(tmpFile, false);
btree.create(false);
List<byte[]> list = new ArrayList<byte[]>(REPEAT);
Random random = new Random(54552542345L);
StopWatch sw1 = new StopWatch("[BplusTreeUniq] Index Construction of " + REPEAT);
for(int i = 0; i < REPEAT; i++) {
long v = random.nextLong();
byte[] b = Primitives.toBytes(v);
Value k = new Value(b);
Assert.assertTrue(btree.addValue(k, v) == -1);
list.add(b);
}
System.err.println(sw1);
btree.flush(true, true);
StopWatch sw2 = new StopWatch("[BplusTreeUniq] Index Search of " + (REPEAT / 2));
for(int i = REPEAT - 1; i >= 0; i -= 2) {
byte[] b = list.get(i);
Assert.assertEquals("#" + i, Primitives.getLong(b), btree.findValue(new Key(b)));
}
System.err.println(sw2);
System.err.println("[BplusTreeUniq] " + tmpFile.getAbsolutePath() + " - size: "
+ tmpFile.length());
btree.drop();
}