/// <exception cref="System.Exception"></exception> public virtual void Test2() { if (!isLocal) { return; } string baseName = GetBaseName(); NeoDatis.Btree.IBTreePersister persister = GetPersister(baseName); NeoDatis.Btree.IBTree tree = new NeoDatis.Odb.Impl.Core.Btree.ODBBTreeMultiple("test2" , 2, persister); for (int i = 0; i < Size; i++) { tree.Insert(i + 1, "value " + (i + 1)); } AssertEquals(Size, tree.GetSize()); System.Collections.IEnumerator iterator = tree.Iterator(NeoDatis.Odb.Core.OrderByConstants .OrderByDesc); int j = 0; while (iterator.MoveNext()) { object o = iterator.Current; // println(o); j++; if (j == Size) { AssertEquals("value " + 1, o); } } persister.Close(); DeleteBase(baseName); }
/// <exception cref="System.Exception"></exception> public virtual void Test1() { if (!isLocal) { return; } string baseName = GetBaseName(); NeoDatis.Btree.IBTreePersister persister = GetPersister(baseName); NeoDatis.Btree.IBTree tree = new NeoDatis.Odb.Impl.Core.Btree.ODBBTreeMultiple("test1" , 2, persister); long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs(); for (int i = 0; i < Size; i++) { tree.Insert(i + 1, "value " + (i + 1)); } long end = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs(); Println(end - start); if (testPerformance) { AssertTrue((end - start) < 0.34 * Size); } // println("insert of "+SIZE+" elements in BTREE = " + // (end-start)+"ms"); // persister.close(); // persister = getPersister(); AssertEquals(Size, tree.GetSize()); System.Collections.IEnumerator iterator = tree.Iterator(NeoDatis.Odb.Core.OrderByConstants .OrderByAsc); int j = 0; while (iterator.MoveNext()) { object o = iterator.Current; AssertEquals("value " + (j + 1), o); j++; if (j % 1000 == 0) { Println(j); } } persister.Close(); DeleteBase(baseName); }
public virtual void Test01() { if (!isLocal) { return; } string baseName = GetBaseName(); DeleteBase(baseName); NeoDatis.Btree.IBTreePersister persister = GetPersister(baseName); NeoDatis.Btree.IBTree tree = new NeoDatis.Odb.Impl.Core.Btree.ODBBTreeMultiple("test1" , 2, persister); long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs(); for (int i = 0; i < Size; i++) { tree.Insert(i + 1, "value " + (i + 1)); } // println(i); // println(new BTreeDisplay().build(tree,true)); long end = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs(); Println("time/object=" + (float)(end - start) / (float)Size); AssertTrue((end - start) < 0.34 * Size); // println("insert of "+SIZE+" elements in BTREE = " + // (end-start)+"ms"); // persister.close(); // persister = getPersister(); AssertEquals(Size, tree.GetSize()); System.Collections.IEnumerator iterator = tree.Iterator(NeoDatis.Odb.Core.OrderByConstants .OrderByAsc); int j = 0; while (iterator.MoveNext()) { object o = iterator.Current; AssertEquals("value " + (j + 1), o); j++; if (j % 1000 == 0) { Println(j); } } persister.Close(); DeleteBase(baseName); }
/// <exception cref="System.Exception"></exception> public virtual void Test1a() { if (!isLocal) { return; } string baseName = GetBaseName(); // Configuration.setInPlaceUpdate(true); NeoDatis.Btree.IBTreePersister persister = GetPersister(baseName); NeoDatis.Btree.IBTree tree = new NeoDatis.Odb.Impl.Core.Btree.ODBBTreeMultiple("test1a" , 2, persister); for (int i = 0; i < Size; i++) { tree.Insert(i + 1, "value " + (i + 1)); } // println(new BTreeDisplay().build(tree,true).toString()); persister.Close(); persister = GetPersister(baseName); tree = persister.LoadBTree(tree.GetId()); // println(new BTreeDisplay().build(tree,true).toString()); AssertEquals(Size, tree.GetSize()); System.Collections.IEnumerator iterator = tree.Iterator(NeoDatis.Odb.Core.OrderByConstants .OrderByAsc); int j = 0; while (iterator.MoveNext()) { object o = iterator.Current; AssertEquals("value " + (j + 1), o); j++; if (j == Size) { AssertEquals("value " + Size, o); } } persister.Close(); DeleteBase(baseName); }
public virtual void Test2() { if (!isLocal) { return; } string baseName = GetBaseName(); NeoDatis.Btree.IBTreePersister persister = GetPersister(baseName); NeoDatis.Btree.IBTree tree = new NeoDatis.Odb.Impl.Core.Btree.ODBBTreeMultiple("test2" , 2, persister); for (int i = 0; i < Size; i++) { tree.Insert(i + 1, "value " + (i + 1)); } AssertEquals(Size, tree.GetSize()); System.Collections.IEnumerator iterator = tree.Iterator(NeoDatis.Odb.Core.OrderByConstants .OrderByDesc); int j = 0; while (iterator.MoveNext()) { object o = iterator.Current; // println(o); j++; if (j == Size) { AssertEquals("value " + 1, o); } } persister.Close(); DeleteBase(baseName); }
public virtual void Test1a() { if (!isLocal) { return; } string baseName = GetBaseName(); // Configuration.setInPlaceUpdate(true); NeoDatis.Btree.IBTreePersister persister = GetPersister(baseName); NeoDatis.Btree.IBTree tree = new NeoDatis.Odb.Impl.Core.Btree.ODBBTreeMultiple("test1a" , 2, persister); for (int i = 0; i < Size; i++) { tree.Insert(i + 1, "value " + (i + 1)); } // println(new BTreeDisplay().build(tree,true).toString()); persister.Close(); persister = GetPersister(baseName); tree = persister.LoadBTree(tree.GetId()); // println(new BTreeDisplay().build(tree,true).toString()); AssertEquals(Size, tree.GetSize()); System.Collections.IEnumerator iterator = tree.Iterator(NeoDatis.Odb.Core.OrderByConstants .OrderByAsc); int j = 0; while (iterator.MoveNext()) { object o = iterator.Current; AssertEquals("value " + (j + 1), o); j++; if (j == Size) { AssertEquals("value " + Size, o); } } persister.Close(); DeleteBase(baseName); }
public virtual void TestLazyCache() { if (!isLocal) { return; } string baseName = GetBaseName(); NeoDatis.Btree.IBTreePersister persister = GetPersister(baseName); NeoDatis.Btree.IBTree tree = new NeoDatis.Odb.Impl.Core.Btree.ODBBTreeMultiple("test1" , 2, persister); long start = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs(); for (int i = 0; i < Size; i++) { tree.Insert(i + 1, "value " + (i + 1)); } long end = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs(); if (testPerformance) { AssertTrue((end - start) < 0.34 * Size); } // println("insert of "+SIZE+" elements in BTREE = " + // (end-start)+"ms"); // persister.close(); // persister = getPersister(); // /assertEquals(SIZE,tree.size()); System.Collections.IEnumerator iterator = tree.Iterator(NeoDatis.Odb.Core.OrderByConstants .OrderByAsc); int j = 0; while (iterator.MoveNext()) { object o = iterator.Current; j++; if (j == Size) { AssertEquals("value " + Size, o); } } persister.Close(); DeleteBase(baseName); }