Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Fix bplustree.h redefined constant shared with bwtree.h. #1496

Merged
merged 4 commits into from
Feb 26, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 5 additions & 15 deletions src/include/storage/index/bplustree.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,12 @@
#include <vector>

#include "common/shared_latch.h"
#include "loggers/index_logger.h"
#include "storage/index/index.h"
#include "storage/index/index_defs.h"

#include "loggers/index_logger.h"

namespace noisepage::storage::index {

// If node size goes above this then we split it
// Thresholds for Inner Node
#define INNER_NODE_SIZE_UPPER_THRESHOLD ((int)128)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should have been constexpr but I guess we missed that on review. We'll do a #define sweep of the codebase again at a later date.

#define INNER_NODE_SIZE_LOWER_THRESHOLD ((int)64)

// Thresholds for Leaf Node
#define LEAF_NODE_SIZE_UPPER_THRESHOLD ((int)128)
#define LEAF_NODE_SIZE_LOWER_THRESHOLD ((int)64)

/**
* Base class for BPlusTree that stores common data, inherited by the BPlusTree class. This
* class stores the threshold parameters specific to the B+ Tree.
Expand Down Expand Up @@ -81,14 +71,14 @@ class BPlusTreeBase {

protected:
/** upper size threshold for inner node split */
int inner_node_size_upper_threshold_ = INNER_NODE_SIZE_UPPER_THRESHOLD;
int inner_node_size_upper_threshold_ = ((int)128);
/** lower size threshold for inner node removal */
int inner_node_size_lower_threshold_ = INNER_NODE_SIZE_LOWER_THRESHOLD;
int inner_node_size_lower_threshold_ = ((int)64);

/** upper size threshold for leaf node split */
int leaf_node_size_upper_threshold_ = LEAF_NODE_SIZE_UPPER_THRESHOLD;
int leaf_node_size_upper_threshold_ = ((int)128);
/** lower size threshold for leaf node removal */
int leaf_node_size_lower_threshold_ = LEAF_NODE_SIZE_LOWER_THRESHOLD;
int leaf_node_size_lower_threshold_ = ((int)64);

public:
/**
Expand Down