Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 84429f4

Browse files
pmenonapavlo
authored andcommitted
ART index tests
1 parent c0ab1b2 commit 84429f4

File tree

4 files changed

+404
-93
lines changed

4 files changed

+404
-93
lines changed

src/include/common/internal_types.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,8 @@ enum class IndexType {
467467
INVALID = INVALID_TYPE_ID, // invalid index type
468468
BWTREE = 1, // bwtree
469469
HASH = 2, // hash
470-
SKIPLIST = 3 // skiplist
470+
SKIPLIST = 3, // skiplist
471+
ART = 4, // ART
471472
};
472473
std::string IndexTypeToString(IndexType type);
473474
IndexType StringToIndexType(const std::string &str);

test/include/index/testing_index_util.h

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,51 +30,45 @@ class TestingIndexUtil {
3030
// Test Cases
3131
//===--------------------------------------------------------------------===//
3232

33-
static void BasicTest(const IndexType index_type);
33+
static void BasicTest(IndexType index_type);
3434

35-
static void MultiMapInsertTest(const IndexType index_type);
35+
static void MultiMapInsertTest(IndexType index_type);
3636

37-
static void UniqueKeyInsertTest(const IndexType index_type);
37+
static void UniqueKeyInsertTest(IndexType index_type);
3838

39-
static void UniqueKeyDeleteTest(const IndexType index_type);
39+
static void UniqueKeyDeleteTest(IndexType index_type);
4040

41-
static void NonUniqueKeyDeleteTest(const IndexType index_type);
41+
static void NonUniqueKeyDeleteTest(IndexType index_type);
4242

43-
static void MultiThreadedInsertTest(const IndexType index_type);
43+
static void MultiThreadedInsertTest(IndexType index_type);
4444

45-
static void UniqueKeyMultiThreadedTest(const IndexType index_type);
45+
static void UniqueKeyMultiThreadedTest(IndexType index_type);
4646

47-
static void NonUniqueKeyMultiThreadedTest(const IndexType index_type);
47+
static void NonUniqueKeyMultiThreadedTest(IndexType index_type);
4848

49-
static void NonUniqueKeyMultiThreadedStressTest(const IndexType index_type);
49+
static void NonUniqueKeyMultiThreadedStressTest(IndexType index_type);
5050

51-
static void NonUniqueKeyMultiThreadedStressTest2(const IndexType index_type);
51+
static void NonUniqueKeyMultiThreadedStressTest2(IndexType index_type);
5252

5353
//===--------------------------------------------------------------------===//
5454
// Utility Methods
5555
//===--------------------------------------------------------------------===//
5656

57-
/**
58-
* Builds an index with 4 columns, the first 2 being indexed
59-
*/
60-
static index::Index *BuildIndex(const IndexType index_type,
61-
const bool unique_keys);
57+
// Builds an index with 4 columns, the first 2 being indexed
58+
static std::unique_ptr<index::IndexMetadata> BuildTestIndexMetadata(
59+
const IndexType index_type, const bool unique_keys);
60+
61+
static index::Index *BuildIndex(IndexType index_type, bool unique_keys);
6262

6363
static void DestroyIndex(index::Index *index);
6464

65-
/**
66-
* Insert helper function
67-
*/
65+
// Insert helper function
6866
static void InsertHelper(index::Index *index, type::AbstractPool *pool,
69-
size_t scale_factor,
70-
UNUSED_ATTRIBUTE uint64_t thread_itr);
67+
size_t scale_factor, uint64_t thread_itr);
7168

72-
/**
73-
* Delete helper function
74-
*/
69+
// Delete helper function
7570
static void DeleteHelper(index::Index *index, type::AbstractPool *pool,
76-
size_t scale_factor,
77-
UNUSED_ATTRIBUTE uint64_t thread_itr);
71+
size_t scale_factor, uint64_t thread_itr);
7872

7973
static std::shared_ptr<ItemPointer> item0;
8074
static std::shared_ptr<ItemPointer> item1;

0 commit comments

Comments
 (0)