[CP] Limit the memory use of bloom filter to 2g
This commit is contained in:
committed by
wangzelin.wzl
parent
b1b4631c04
commit
fa87d1117c
@ -25,7 +25,7 @@ using namespace sql;
|
|||||||
using namespace obrpc;
|
using namespace obrpc;
|
||||||
|
|
||||||
#define MIN_FILTER_SIZE 256
|
#define MIN_FILTER_SIZE 256
|
||||||
#define MAX_BIT_COUNT 4611686018427387904 // 2^62
|
#define MAX_BIT_COUNT 17179869184// 2^34 due to the memory single alloc limit
|
||||||
#define BF_BLOCK_SIZE 256L
|
#define BF_BLOCK_SIZE 256L
|
||||||
#define BLOCK_MASK 255L // = size of block - 1
|
#define BLOCK_MASK 255L // = size of block - 1
|
||||||
#define CACHE_LINE_SIZE 64 // 64 bytes
|
#define CACHE_LINE_SIZE 64 // 64 bytes
|
||||||
|
|||||||
@ -43,7 +43,16 @@ public:
|
|||||||
inline void set_filter_id(int64_t filter_id) { filter_id_ = filter_id; }
|
inline void set_filter_id(int64_t filter_id) { filter_id_ = filter_id; }
|
||||||
inline int64_t get_filter_id() const { return filter_id_; }
|
inline int64_t get_filter_id() const { return filter_id_; }
|
||||||
inline bool is_create_filter() { return is_create_; }
|
inline bool is_create_filter() { return is_create_; }
|
||||||
inline void set_filter_length(int64_t filter_len) { filter_len_ = filter_len; }
|
inline void set_filter_length(double filter_len)
|
||||||
|
{
|
||||||
|
if (filter_len <= 0) {
|
||||||
|
filter_len_ = 1;
|
||||||
|
} else if (filter_len > INT64_MAX) {
|
||||||
|
filter_len_ = INT64_MAX;
|
||||||
|
} else {
|
||||||
|
filter_len_ = filter_len;
|
||||||
|
}
|
||||||
|
}
|
||||||
inline int64_t get_filter_length() const { return filter_len_; }
|
inline int64_t get_filter_length() const { return filter_len_; }
|
||||||
inline void set_is_use_filter_shuffle(bool flag) { is_use_filter_shuffle_ = flag; }
|
inline void set_is_use_filter_shuffle(bool flag) { is_use_filter_shuffle_ = flag; }
|
||||||
inline bool is_use_filter_shuffle() { return is_use_filter_shuffle_; }
|
inline bool is_use_filter_shuffle() { return is_use_filter_shuffle_; }
|
||||||
|
|||||||
Reference in New Issue
Block a user