|
17 | 17 | #include "velox/common/base/tests/GTestUtils.h"
|
18 | 18 | #include "velox/common/caching/FileIds.h"
|
19 | 19 | #include "velox/common/caching/tests/CacheTestUtil.h"
|
| 20 | +#include "velox/common/config/GlobalConfig.h" |
20 | 21 | #include "velox/common/file/FileSystems.h"
|
21 | 22 | #include "velox/common/file/tests/FaultyFileSystem.h"
|
22 | 23 | #include "velox/common/memory/Memory.h"
|
@@ -73,7 +74,7 @@ class SsdFileTest : public testing::Test {
|
73 | 74 | bool disableFileCow = false,
|
74 | 75 | bool enableFaultInjection = false) {
|
75 | 76 | // tmpfs does not support O_DIRECT, so turn this off for testing.
|
76 |
| - FLAGS_ssd_odirect = false; |
| 77 | + config::globalConfig().useSsdODirect = false; |
77 | 78 | cache_ = AsyncDataCache::create(memory::memoryManager()->allocator());
|
78 | 79 | cacheHelper_ =
|
79 | 80 | std::make_unique<test::AsyncDataCacheTestHelper>(cache_.get());
|
@@ -327,7 +328,7 @@ TEST_F(SsdFileTest, writeAndRead) {
|
327 | 328 | constexpr int64_t kSsdSize = 16 * SsdFile::kRegionSize;
|
328 | 329 | std::vector<TestEntry> allEntries;
|
329 | 330 | initializeCache(kSsdSize);
|
330 |
| - FLAGS_ssd_verify_write = true; |
| 331 | + config::globalConfig().verifySsdWrite = true; |
331 | 332 | for (auto startOffset = 0; startOffset <= kSsdSize - SsdFile::kRegionSize;
|
332 | 333 | startOffset += SsdFile::kRegionSize) {
|
333 | 334 | auto pins =
|
@@ -402,7 +403,7 @@ TEST_F(SsdFileTest, checkpoint) {
|
402 | 403 | constexpr int64_t kSsdSize = 16 * SsdFile::kRegionSize;
|
403 | 404 | const uint64_t checkpointIntervalBytes = 5 * SsdFile::kRegionSize;
|
404 | 405 | const auto fileNameAlt = StringIdLease(fileIds(), "fileInStorageAlt");
|
405 |
| - FLAGS_ssd_verify_write = true; |
| 406 | + config::globalConfig().verifySsdWrite = true; |
406 | 407 | initializeCache(kSsdSize, checkpointIntervalBytes);
|
407 | 408 |
|
408 | 409 | std::vector<TestEntry> allEntries;
|
@@ -498,7 +499,7 @@ TEST_F(SsdFileTest, checkpoint) {
|
498 | 499 | TEST_F(SsdFileTest, fileCorruption) {
|
499 | 500 | constexpr int64_t kSsdSize = 16 * SsdFile::kRegionSize;
|
500 | 501 | const uint64_t checkpointIntervalBytes = 5 * SsdFile::kRegionSize;
|
501 |
| - FLAGS_ssd_verify_write = true; |
| 502 | + config::globalConfig().verifySsdWrite = true; |
502 | 503 |
|
503 | 504 | const auto populateCache = [&](std::vector<TestEntry>& entries) {
|
504 | 505 | entries.clear();
|
@@ -570,7 +571,7 @@ TEST_F(SsdFileTest, fileCorruption) {
|
570 | 571 | TEST_F(SsdFileTest, recoverFromCheckpointWithChecksum) {
|
571 | 572 | constexpr int64_t kSsdSize = 4 * SsdFile::kRegionSize;
|
572 | 573 | const uint64_t checkpointIntervalBytes = 3 * SsdFile::kRegionSize;
|
573 |
| - FLAGS_ssd_verify_write = true; |
| 574 | + config::globalConfig().verifySsdWrite = true; |
574 | 575 |
|
575 | 576 | // Test if cache data can be recovered with different settings.
|
576 | 577 | struct {
|
|
0 commit comments