11
11
#include " main/client_context.h"
12
12
#include " main/db_config.h"
13
13
#include " main/settings.h"
14
- #include " storage/db_file_id.h"
15
14
16
15
namespace kuzu {
17
16
namespace storage {
18
17
19
- class StorageManager ;
20
-
21
- struct DBFileIDAndName {
22
- DBFileID dbFileID;
23
- std::string fName ;
24
-
25
- DBFileIDAndName (DBFileID dbFileID, std::string fName )
26
- : dbFileID{dbFileID}, fName {std::move (fName )} {};
27
- };
28
-
29
18
struct PageCursor {
30
19
PageCursor (common::page_idx_t pageIdx, uint32_t posInPage)
31
20
: pageIdx{pageIdx}, elemPosInPage{posInPage} {};
@@ -49,10 +38,11 @@ struct PageUtils {
49
38
auto numBytesPerNullEntry = common::NullMask::NUM_BITS_PER_NULL_ENTRY >> 3 ;
50
39
auto numNullEntries =
51
40
hasNull ?
52
- (uint32_t )ceil ((double )common::KUZU_PAGE_SIZE /
53
- (double )(((uint64_t )elementSize
41
+ static_cast <uint32_t >(ceil (
42
+ static_cast <double >(common::KUZU_PAGE_SIZE) /
43
+ static_cast <double >((static_cast <uint64_t >(elementSize)
54
44
<< common::NullMask::NUM_BITS_PER_NULL_ENTRY_LOG2) +
55
- numBytesPerNullEntry)) :
45
+ numBytesPerNullEntry))) :
56
46
0 ;
57
47
return (common::KUZU_PAGE_SIZE - (numNullEntries * numBytesPerNullEntry)) / elementSize;
58
48
}
@@ -82,7 +72,7 @@ class StorageUtils {
82
72
// TODO: Constrain T1 and T2 to numerics.
83
73
template <typename T1, typename T2>
84
74
static uint64_t divideAndRoundUpTo (T1 v1, T2 v2) {
85
- return std::ceil (( double )v1 / ( double )v2 );
75
+ return std::ceil (static_cast < double >(v1) / static_cast < double >(v2) );
86
76
}
87
77
88
78
static std::string getColumnName (const std::string& propertyName, ColumnType type,
@@ -101,10 +91,6 @@ class StorageUtils {
101
91
return std::make_pair (nodeGroupIdx, offsetInChunk);
102
92
}
103
93
104
- static std::string getNodeIndexFName (const common::VirtualFileSystem* vfs,
105
- const std::string& directory, const common::table_id_t & tableID,
106
- common::FileVersionType dbFileType);
107
-
108
94
static std::string getDataFName (common::VirtualFileSystem* vfs, const std::string& directory) {
109
95
return vfs->joinPath (directory, common::StorageConstants::DATA_FILE_NAME);
110
96
}
@@ -116,17 +102,6 @@ class StorageUtils {
116
102
common::StorageConstants::METADATA_FILE_NAME_FOR_WAL);
117
103
}
118
104
119
- static DBFileIDAndName getNodeIndexIDAndFName (common::VirtualFileSystem* vfs,
120
- const std::string& directory, common::table_id_t tableID) {
121
- auto fName = getNodeIndexFName (vfs, directory, tableID, common::FileVersionType::ORIGINAL);
122
- return {DBFileID::newPKIndexFileID (tableID), fName };
123
- }
124
-
125
- static std::string getOverflowFileName (const std::string& fName ) {
126
- return appendSuffixOrInsertBeforeWALSuffix (fName ,
127
- common::StorageConstants::OVERFLOW_FILE_SUFFIX);
128
- }
129
-
130
105
static std::string getCatalogFilePath (common::VirtualFileSystem* vfs,
131
106
const std::string& directory, common::FileVersionType dbFileType) {
132
107
return vfs->joinPath (directory, dbFileType == common::FileVersionType::ORIGINAL ?
0 commit comments