-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathconstants.h
More file actions
44 lines (34 loc) · 1.43 KB
/
constants.h
File metadata and controls
44 lines (34 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#pragma once
#include <cstdint>
namespace fishstore {
namespace core {
struct Constants {
inline static void SetAvgRecordSize(uint64_t size) {
avg_rec_size = size;
}
/// Size of cache line in bytes
static constexpr uint32_t kCacheLineBytes = 64;
/// We issue 256 writes to disk, to checkpoint the hash table.
static constexpr uint32_t kNumMergeChunks = 256;
// Default batch size for reserving space in batch insert.
// Reserve this much batch size for the vector of insert contexts;
static constexpr size_t kDefaultBatchSize = 1;
/// Utilities for Adaptive prefecthing.
// Total number of IO levels.
static uint32_t kIoLevels;
// Scan offset bit for each different IO level.
static constexpr uint32_t address_offset_bit[5] = { 0, 12, 14, 16, 18 };
// The gap threshold that we are happy to burn this much IO bandwidth to save an IO.
static constexpr uint32_t gap_thres = 138240;
// The average record size we rely on to calculate the gap between the end of
// previous record to the current record. Note that the gap between two key pointers
// in the hash chain also includes the size of payload for first record.
static uint64_t avg_rec_size;
};
uint64_t Constants::avg_rec_size = 600;
uint32_t Constants::kIoLevels = 5;
constexpr uint32_t Constants::address_offset_bit[5];
}
} // namespace fishstore::cire