public class TestHTree extends AbstractHTreeTestCase
HTree
.TestCase2.MyProperties, TestCase2.RandomType
_randomType, log
Modifier and Type | Method and Description |
---|---|
void |
test_distinctBits() |
void |
test_example1_addressBits2_insert_1_2_3_4()
Test of basic operations using a TWO (2) bit address space inserting the
key sequence {1,2,3,4}.
|
void |
test_example1_splitDir_addressBits2_1_2_3_4_5()
A unit test which continues the scenario begun above (insert 1,2,3,4),
working through the structural changes required until we can finally
insert the key (5) into the
HTree . |
void |
test_overflowPage()
FIXME Write a unit test in which we insert duplicate tuples forcing the
overflow of a bucket page.
|
void |
testInsertAndLookupDups()
Insert data into the BTRee, making sure that data previously
inserted is found in later stages when looking it up.
|
assertSameHTree, assertSameIterator, assertSameIteratorAnyOrder, assertSameIteratorAnyOrder, assertSameOrderIterator, getHTree, getHTree, getHTree
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEqualsWithinUlps, assertSameArray, assertSameArray, assertSameBigDecimal, assertSameBigDecimal, assertSameBigInteger, assertSameBigInteger, assertSameIterator, assertSameIterator, assertSameIteratorAnyOrder, assertSameIteratorAnyOrder, assertSameValue, assertSameValue, assertZeroUlps, assertZeroUlps, fail, getInnerCause, getNormalInt, getProjectBuildPath, getProperties, getRandomObject, getRandomObject, getRandomOrder, getRandomString, getTestInputStream, getTestResource, getTestResource, getUlps, getUlps, isDEBUG, isDEBUG, isINFO, isINFO, isInnerCause, logProperties
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
public TestHTree()
public TestHTree(String name)
name
- public void test_example1_addressBits2_insert_1_2_3_4()
Note: This test stops after the 4th tuple insert. At that point the
HTree
is in a state where inserting the next tuple in the
sequence (5) will force a new directory page to be introduced. The next
two unit tests examine in depth the logic which introduces that directory
page. They are followed by another unit test which picks up on this same
insert sequences and goes beyond the introduction of the new directory
page.
bigdata/src/architecture/htree.xls#example1
,
#test_example1_splitDir_addressBits2_splitBits1()
,
#test_example1_splitDir_addressBits2_splitBits2()
public void test_example1_splitDir_addressBits2_1_2_3_4_5()
HTree
. This test uses high level
insert operations when they do not cause structural changes and low level
operations when structural changes are required. This allows us to view
as many of the intermediate states of the HTree
as possible by
taking the control logic "out of the loop" as it were.
In order to insert the key (5) we will need to split (a). However, the prefix length for (a) is only THREE (3) bits and we need a prefix length of 5 bits before we can split (a). This prefix length requirement arises because we can not split (a) until the prefix bits considered are sufficient to redistribute the tuples between (a) and its siblings (children of the same parent directory page). The first such split will occur when we have a prefix length of 5 bits and therefore can make a distinction among the keys in (a), which are:
key|bits ---+-------- 1 00000001 2 00000010 3 00000011 4 00000100 ---+-------- |01234567Consulting the table immediately above, the first non-zero bit is bit 5 of the key whose value is FOUR (4).
public void test_overflowPage()
UnsupportedOperationException
to be thrown. The test
will be used to work through the handling of page overflow. The basic
approach to page overflow is to double the address space on the page.
This is conceptually simple. However, this means that the address space
of the page will not be the same as the address space of the other pages
and that could violate various assumptions in the existing control logic.public void test_distinctBits()
public void testInsertAndLookupDups()
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.