提交 c7687784 authored 作者: Thomas Mueller's avatar Thomas Mueller

The spatial index now works in MVCC mode when using the MVStore storage.

上级 6d915060
......@@ -505,7 +505,8 @@ public class Recover extends Tool implements DataHandler {
null, this, null);
ValueDataType valueType = new ValueDataType(
null, this, null);
TransactionMap<Value, Value> dataMap = store.begin().openMap(mapName, keyType, valueType);
TransactionMap<Value, Value> dataMap = store.begin().openMap(
mapName, keyType, valueType);
Iterator<Value> dataIt = dataMap.keyIterator(null);
boolean init = false;
while (dataIt.hasNext()) {
......
......@@ -47,12 +47,31 @@ public class TestMVRTree extends TestMVStore {
FileUtils.deleteRecursive(getBaseDir(), true);
FileUtils.createDirectories(getBaseDir());
testSpatialKey();
testExample();
testMany();
testSimple();
testRandom();
testRandomFind();
}
private void testSpatialKey() {
SpatialKey a0 = new SpatialKey(0, 1, 2, 3, 4);
SpatialKey a1 = new SpatialKey(0, 1, 2, 3, 4);
SpatialKey b0 = new SpatialKey(1, 1, 2, 3, 4);
SpatialKey c0 = new SpatialKey(1, 1.1f, 2.2f, 3.3f, 4.4f);
assertEquals(0, a0.hashCode());
assertEquals(1, b0.hashCode());
assertTrue(a0.equals(a0));
assertTrue(a0.equals(a1));
assertFalse(a0.equals(b0));
assertTrue(a0.equalsIgnoringId(b0));
assertFalse(b0.equals(c0));
assertFalse(b0.equalsIgnoringId(c0));
assertEquals("0: (1.0/2.0, 3.0/4.0)", a0.toString());
assertEquals("1: (1.0/2.0, 3.0/4.0)", b0.toString());
assertEquals("1: (1.1/2.2, 3.3/4.4)", c0.toString());
}
private void testExample() {
// create an in-memory store
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论