Class BPlusTreeTest
java.lang.Object
org.apache.ignite.internal.persistence.tree.BPlusTreeTest
- Direct Known Subclasses:
BPlusTreeWithReuseListTest
B+Tree test.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ReuseListCreates reuse list.voidsetUp()voidtearDown()voidvoidvoidvoidTest checks a rare case when, after a parallel removal from the b+tree (cleaning), an empty leaf could remain.voidtestFind()voidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidvoidThe test verifies thatBPlusTree.put(T),BPlusTree.remove(L),BPlusTree.find(L, L), andBPlusTree.size()run concurrently, perform correctly and report correct values.voidVerifies that in case for threads concurrently calling put and remove on a tree with 1-3 pages, the size() method performs correctly.voidThe test forcesBPlusTree.size()method to run into a livelock: during single run the method is picking up new pages which are concurrently added to the tree until the new pages are not added anymore.voidvoidvoidvoidvoidvoidVerifies thatBPlusTree.size()andBPlusTree.size()methods behave correctly on single-threaded addition and removal of elements in random order.voidvoidVerifies thatBPlusTree.size()method behaves correctly when run concurrently withBPlusTree.put(T),BPlusTree.remove(L)methods.voidVerifies that concurrent running ofBPlusTree.put(T)+BPlusTree.remove(L)sequence andBPlusTree.size()methods results in correct calculation of tree size.voidVerifies that concurrent running ofBPlusTree.put(T)+BPlusTree.remove(L)sequence andBPlusTree.size()methods results in correct calculation of tree size.voidvoidvoidvoidvoidvoid
-
Constructor Details
-
BPlusTreeTest
public BPlusTreeTest()
-
-
Method Details
-
setUp
public void setUp() -
tearDown
- Throws:
IgniteCheckedException
-
testFind
- Throws:
IgniteCheckedException- If failed.
-
testRetries
- Throws:
IgniteCheckedException- If failed.
-
testIsEmpty
- Throws:
Exception- if failed.
-
testFindWithClosure
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_1_20_mm_1
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_1_20_mm_0
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_1_20_pm_1
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_1_20_pm_0
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_1_20_pp_1
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_1_20_pp_0
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_1_20_mp_1
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_1_20_mp_0
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_2_40_mm_1
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_2_40_mm_0
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_2_40_pm_1
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_2_40_pm_0
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_2_40_pp_1
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_2_40_pp_0
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_2_40_mp_1
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_2_40_mp_0
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_3_60_mm_1
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_3_60_mm_0
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_3_60_pm_1
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_3_60_pm_0
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_3_60_pp_1
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_3_60_pp_0
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_3_60_mp_1
- Throws:
IgniteCheckedException- If failed.
-
testPutRemove_3_60_mp_0
- Throws:
IgniteCheckedException- If failed.
-
testRandomInvoke_1_30_1
- Throws:
IgniteCheckedException- If failed.
-
testRandomInvoke_1_30_0
- Throws:
IgniteCheckedException- If failed.
-
testRandomPutRemove_1_30_0
- Throws:
IgniteCheckedException- If failed.
-
testRandomPutRemove_1_30_1
- Throws:
IgniteCheckedException- If failed.
-
testMassiveRemove3_false
- Throws:
Exception- If failed.
-
testMassiveRemove3_true
- Throws:
Exception- If failed.
-
testMassiveRemove2_false
- Throws:
Exception- If failed.
-
testMassiveRemove2_true
- Throws:
Exception- If failed.
-
testMassiveRemove1_false
- Throws:
Exception- If failed.
-
testMassiveRemove1_true
- Throws:
Exception- If failed.
-
testMassivePut1_true
- Throws:
Exception- If failed.
-
testMassivePut1_false
- Throws:
Exception- If failed.
-
testMassivePut2_true
- Throws:
Exception- If failed.
-
testMassivePut2_false
- Throws:
Exception
-
testMassivePut3_true
- Throws:
Exception- If failed.
-
testMassivePut3_false
- Throws:
Exception
-
testEmptyCursors
- Throws:
IgniteCheckedException- If failed.
-
testCursorConcurrentMerge
- Throws:
IgniteCheckedException- If failed.
-
testSizeForPutRmvSequential
Verifies thatBPlusTree.size()andBPlusTree.size()methods behave correctly on single-threaded addition and removal of elements in random order.- Throws:
IgniteCheckedException- If failed.
-
testSizeForRandomPutRmvMultithreaded_5_4
Verifies thatBPlusTree.size()method behaves correctly when run concurrently withBPlusTree.put(T),BPlusTree.remove(L)methods. Please see details indoTestSizeForRandomPutRmvMultithreaded(int, int, int).- Throws:
Exception- If failed.
-
testSizeForRandomPutRmvMultithreaded_3_256
- Throws:
Exception
-
testSizeForRandomPutRmvMultithreadedAsync_16
Verifies that concurrent running ofBPlusTree.put(T)+BPlusTree.remove(L)sequence andBPlusTree.size()methods results in correct calculation of tree size.- Throws:
Exception- See Also:
-
doTestSizeForRandomPutRmvMultithreadedAsync() for details.
-
testSizeForRandomPutRmvMultithreadedAsync_3
Verifies that concurrent running ofBPlusTree.put(T)+BPlusTree.remove(L)sequence andBPlusTree.size()methods results in correct calculation of tree size.- Throws:
Exception- See Also:
-
doTestSizeForRandomPutRmvMultithreadedAsync() for details.
-
testPutSizeLivelock
The test forcesBPlusTree.size()method to run into a livelock: during single run the method is picking up new pages which are concurrently added to the tree until the new pages are not added anymore. Test verifies that despite livelock condition a size from a valid range is returned. NB: This test has to be changed with the integration of IGNITE-3478.- Throws:
Exception- if test failed
-
testPutRmvSizeSinglePageContention
Verifies that in case for threads concurrently calling put and remove on a tree with 1-3 pages, the size() method performs correctly.- Throws:
Exception- If failed.
-
testPutRmvFindSizeMultithreaded
The test verifies thatBPlusTree.put(T),BPlusTree.remove(L),BPlusTree.find(L, L), andBPlusTree.size()run concurrently, perform correctly and report correct values. A sliding window of numbers is maintainted in the tests. NB: This test has to be changed with the integration of IGNITE-3478.- Throws:
Exception- If failed.
-
testTestRandomPutRemoveMultithreaded_1_30_0
- Throws:
Exception- If failed.
-
testTestRandomPutRemoveMultithreaded_1_30_1
- Throws:
Exception- If failed.
-
testTestRandomPutRemoveMultithreaded_2_50_0
- Throws:
Exception- If failed.
-
testTestRandomPutRemoveMultithreaded_2_50_1
- Throws:
Exception- If failed.
-
testTestRandomPutRemoveMultithreaded_3_70_0
- Throws:
Exception- If failed.
-
testTestRandomPutRemoveMultithreaded_3_70_1
- Throws:
Exception- If failed.
-
testFindFirstAndLast
- Throws:
IgniteCheckedException- If failed.
-
testIterate
- Throws:
Exception- If failed.
-
testIterateConcurrentPutRemove
- Throws:
Exception- If failed.
-
testIterateConcurrentPutRemove_1
- Throws:
Exception- If failed.
-
testIterateConcurrentPutRemove_2
- Throws:
Exception- If failed.
-
testIteratePutRemove_10
- Throws:
Exception- If failed.
-
testConcurrentGrowDegenerateTreeAndConcurrentRemove
- Throws:
Exception- If failed.
-
testEmptyLeafAfterConcurrentRemoves
Test checks a rare case when, after a parallel removal from the b+tree (cleaning), an empty leaf could remain. Schematically, this can happen like this: B+tree before clearing: [ 2 ] / \ [ 1 ] [ 3 | 4 ] / \ / | \ [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] Parallel deletions of keys: Remove 2: [ 1 ] / \ [ ] [ 3 | 4 ] | / | \ [ 1 ] [ 3 ] [ 4 ] [ 5 ] Remove 5: [ 1 ] / \ [ ] [ 3 ] | / \ [ 1 ] [ 3 ] [ 4 ] Remove 4: [ 1 ] / \ [ ] [ ] | | [ 1 ] [ 3 ] Remove 3: [ 1 ] | [ ] | [ 1 ] Remove 1 before cutting root and inner node: [ ] | [ ] ^^^ An empty leaf remains so that this does not happen when "1" is removed, an empty root and an inner node remain, which we will cut off (BPlusTree.Remove#cutRoot). Remove 1 after cutting root and inner node: [ ]- Throws:
Exception- If failed.
-
createReuseList
Creates reuse list.- Returns:
- the created list or
null.
-