use of org.apache.accumulo.tserver.NativeMap in project accumulo by apache.
the class NativeMapIT method test7.
@Test
public void test7() {
NativeMap nm = new NativeMap();
insertAndVerify(nm, 1, 10, 0);
nm.delete();
try {
nm.delete();
assertTrue(false);
} catch (IllegalStateException e) {
}
}
use of org.apache.accumulo.tserver.NativeMap in project accumulo by apache.
the class NativeMapIT method test4.
@Test
public void test4() {
NativeMap nm = new NativeMap();
insertAndVerifyExhaustive(nm, 3, 0);
insertAndVerifyExhaustive(nm, 3, 1);
nm.delete();
}
use of org.apache.accumulo.tserver.NativeMap in project accumulo by apache.
the class NativeMapIT method test8.
@Test
public void test8() {
// test verifies that native map sorts keys sharing some common prefix properly
NativeMap nm = new NativeMap();
TreeMap<Key, Value> tm = new TreeMap<>();
tm.put(new Key(new Text("fo")), new Value(new byte[] { '0' }));
tm.put(new Key(new Text("foo")), new Value(new byte[] { '1' }));
tm.put(new Key(new Text("foo1")), new Value(new byte[] { '2' }));
tm.put(new Key(new Text("foo2")), new Value(new byte[] { '3' }));
for (Entry<Key, Value> entry : tm.entrySet()) {
nm.put(entry.getKey(), entry.getValue());
}
Iterator<Entry<Key, Value>> iter = nm.iterator();
for (Entry<Key, Value> entry : tm.entrySet()) {
assertTrue(iter.hasNext());
Entry<Key, Value> entry2 = iter.next();
assertEquals(entry.getKey(), entry2.getKey());
assertEquals(entry.getValue(), entry2.getValue());
}
assertFalse(iter.hasNext());
nm.delete();
}
Aggregations