-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrocksdb_config.cpp
More file actions
573 lines (528 loc) · 23.6 KB
/
rocksdb_config.cpp
File metadata and controls
573 lines (528 loc) · 23.6 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
/**
* Copyright (C) 2025 EloqData Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under either of the following two licenses:
* 1. GNU Affero General Public License, version 3, as published by the Free
* Software Foundation.
* 2. GNU General Public License as published by the Free Software
* Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License or GNU General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License
* and GNU General Public License V2 along with this program. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "rocksdb_config.h"
#include <ctime>
#include <iomanip>
#include <regex>
#include <sstream>
#include <string>
#include <string_view>
#include "glog/logging.h"
#include "store_handler/kv_store.h"
#if (defined(ROCKSDB_CLOUD_FS_TYPE) && \
(ROCKSDB_CLOUD_FS_TYPE == ROCKSDB_CLOUD_FS_TYPE_S3 || \
ROCKSDB_CLOUD_FS_TYPE == ROCKSDB_CLOUD_FS_TYPE_GCS))
#define ROCKSDB_CLOUD_FS 1
#endif
#if ROCKSDB_CLOUD_FS
#include "rocksdb/cloud/db_cloud.h"
#endif
DEFINE_string(rocksdb_info_log_level, "INFO", "RocksDB store info log level");
DEFINE_bool(rocksdb_enable_stats, false, "RocksDB store enable stats");
DEFINE_uint32(rocksdb_stats_dump_period_sec,
600,
"RocksDB stats dump period sec");
DEFINE_string(rocksdb_storage_path, "", "RocksDB store storage path");
DEFINE_uint32(rocksdb_max_write_buffer_number,
8,
"RocksDB store max write buffer number");
DEFINE_uint32(rocksdb_max_background_jobs,
4,
"RocksDB store max background jobs");
DEFINE_uint32(rocksdb_max_background_flush,
0, /*Given 0, RocksDB will automatically adjust*/
"RocksDB store max background flush");
DEFINE_uint32(rocksdb_max_background_compaction,
0, /*Given 0, RocksDB will automatically adjust*/
"RocksDB store max background compaction");
DEFINE_string(rocksdb_target_file_size_base,
"64MB", /*Given 0, RocksDB will use default value 64MB*/
"RocksDB store target file size base");
DEFINE_uint32(rocksdb_target_file_size_multiplier,
1, /*Given 0, RocksDB will use default value 1*/
"RocksDB store target file size multiplier");
DEFINE_string(rocksdb_write_buffer_size,
"64MB", /*Given 0, RocksDB will use default value 64MB*/
"RocksDB store write buffer size");
DEFINE_bool(rocksdb_use_direct_io_for_flush_and_compaction,
false,
"RocksDB store use direct io for flush and compaction");
DEFINE_bool(rocksdb_use_direct_io_for_read,
false,
"RocksDB store use direct io for read");
DEFINE_uint32(rocksdb_level0_stop_writes_trigger,
36, /*Given 0, RocksDB will use its default value 36*/
"RocksDB store level0 stop writes trigger");
DEFINE_uint32(rocksdb_level0_slowdown_writes_trigger,
20, /*Given 0, RocksDB will use its default value 20*/
"RocksDB store level0 slowdown writes trigger");
DEFINE_uint32(rocksdb_level0_file_num_compaction_trigger,
4, /*Given 0, RocksDB will use its default value 4*/
"RocksDB store level0 file num compaction trigger");
DEFINE_string(rocksdb_max_bytes_for_level_base,
"256MB", /*Given 0, RocksDB will use default value 256MB*/
"RocksDB store max bytes for level base");
DEFINE_uint32(rocksdb_max_bytes_for_level_multiplier,
10, /*Given 0, RocksDB will use default value 10*/
"RocksDB store max bytes for level multiplier");
DEFINE_string(rocksdb_compaction_style,
"level",
"RocksDB store compaction style");
DEFINE_string(rocksdb_soft_pending_compaction_bytes_limit,
"64GB", /*Given 0, RocksDB will use default value 64GB*/
"RocksDB store soft pending compaction bytes limit");
DEFINE_string(rocksdb_hard_pending_compaction_bytes_limit,
"256GB", /*Given 0, RocksDB will use default value 256GB*/
"RocksDB store hard pending compaction bytes limit");
DEFINE_uint32(rocksdb_max_subcompactions,
1, /*Given 0, RocksDB will use default value 1*/
"RocksDB store max subcompactions");
DEFINE_string(rocksdb_write_rate_limit,
"0MB", /*Given 0, RocksDB will not have write limit*/
"RocksDB store write_rate limit (bytes per second)");
DEFINE_uint32(rocksdb_query_worker_num, 16, "RocksDB async query worker num");
DEFINE_string(
rocksdb_batch_write_size,
"1MB", /*Adjust for balancing the memory footprint and throughput*/
"RocksDB batch write size when doing checkpoint");
DECLARE_uint32(snapshot_sync_worker_num);
DEFINE_uint32(
rocksdb_periodic_compaction_seconds,
24 * 60 * 60, /*sst files older than 1 day will be pick up for compaction*/
"RocksDB periodic compaction seconds");
static std::tm parseTime(const std::string &timeStr)
{
std::tm tm = {};
std::istringstream ss(timeStr);
ss >> std::get_time(&tm, "%H:%M");
return tm;
}
inline bool is_number(const std::string &str)
{
// regular expression for matching number format
std::regex pattern("^[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?$");
return std::regex_match(str, pattern);
}
inline std::string_view remove_last_two(const std::string_view &str)
{
if (str.length() <= 2)
{
return "";
}
return std::string_view(str.data(), str.size() - 2);
}
inline std::string_view get_last_two(const std::string_view &str)
{
if (str.length() <= 2)
{
return "";
}
return std::string_view(str.data() + str.size() - 2, 2);
}
inline uint64_t unit_num(const std::string_view &unit_str)
{
if (unit_str == "MB" || unit_str == "mb")
{
return 1024 * 1024L;
}
else if (unit_str == "GB" || unit_str == "gb")
{
return 1024 * 1024 * 1024L;
}
else if (unit_str == "TB" || unit_str == "tb")
{
return 1024 * 1024 * 1024 * 1024L;
}
return 1L;
}
inline bool ends_with(const std::string_view &str,
const std::string_view &suffix)
{
if (str.compare(str.size() - suffix.size(), suffix.size(), suffix) != 0)
{
return false;
}
return true;
}
inline bool is_valid_size(const std::string_view &size_str_v)
{
bool is_right_end =
ends_with(size_str_v, "MB") || ends_with(size_str_v, "mb") ||
ends_with(size_str_v, "GB") || ends_with(size_str_v, "gb") ||
ends_with(size_str_v, "TB") || ends_with(size_str_v, "tb");
if (!is_right_end)
{
return false;
}
std::string num_str;
num_str = remove_last_two(size_str_v);
if (!is_number(num_str))
{
return false;
}
return true;
}
inline uint64_t parse_size(const std::string &size_str)
{
std::string_view size_str_v(size_str);
assert(is_valid_size(size_str_v));
std::string_view unit_str = get_last_two(size_str_v);
uint64_t unit = unit_num(unit_str);
std::string_view num_str = remove_last_two(size_str_v);
uint64_t num = std::stoull(std::string(num_str));
return num * unit;
}
static int getTimeZoneOffset()
{
std::time_t now = std::time(nullptr);
std::tm local_tm = *std::localtime(&now);
std::tm utc_tm = *std::gmtime(&now);
int offset =
std::difftime(std::mktime(&local_tm), std::mktime(&utc_tm)) / 60;
return offset;
}
static std::tm toUTC(const std::tm &localTime, int offsetMinutes)
{
std::tm utcTime = localTime;
std::time_t localEpoch = std::mktime(&utcTime);
localEpoch -= offsetMinutes * 60; // Convert offset to seconds and adjust
utcTime = *std::gmtime(&localEpoch);
return utcTime;
}
static std::string formatTime(const std::tm &time)
{
std::ostringstream ss;
ss << std::put_time(&time, "%H:%M");
return ss.str();
}
static std::string GetDefaultOffPeakTimeUtc()
{
const std::string dialy_offpeak_time_start = "00:00";
const std::string dialy_offpeak_time_end = "05:00";
std::tm start_tm = parseTime(dialy_offpeak_time_start);
std::tm end_tm = parseTime(dialy_offpeak_time_end);
int tz_offset = getTimeZoneOffset();
std::tm start_tm_utc = toUTC(start_tm, tz_offset);
std::tm end_tm_utc = toUTC(end_tm, tz_offset);
return formatTime(start_tm_utc) + "-" + formatTime(end_tm_utc);
};
DEFINE_string(rocksdb_dialy_offpeak_time_utc,
GetDefaultOffPeakTimeUtc(),
"RocksDB dialy offpeak time in UTC in HH:mm-HH:mm format. The "
"default value is 00:00-05:00 of local time zone");
#if ROCKSDB_CLOUD_FS
DEFINE_string(rocksdb_cloud_bucket_name,
"rocksdb-cloud-test",
"RocksDB cloud bucket name");
DEFINE_string(rocksdb_cloud_bucket_prefix,
"eloqkv-",
"RocksDB cloud bucket prefix");
DEFINE_string(rocksdb_cloud_region, "ap-northeast-1", "RocksDB cloud region");
DEFINE_string(rocksdb_cloud_sst_file_cache_size,
"20GB",
"RocksDB cloud sst file cache size");
DEFINE_uint32(rocksdb_cloud_db_ready_timeout_sec,
10,
"RocksDB cloud db ready timeout us");
DEFINE_uint32(rocksdb_cloud_db_file_deletion_delay_sec,
3600,
"RocksDB cloud db file deletion delay");
DEFINE_uint32(rocksdb_cloud_warm_up_thread_num,
1,
"Rocksdb cloud warm up thread number");
DECLARE_string(aws_access_key_id);
DECLARE_string(aws_secret_key);
#endif
DEFINE_bool(rocksdb_io_uring_enabled,
false,
"If true, enable the use of IO uring if the platform supports it");
extern "C" bool RocksDbIOUringEnable()
{
return FLAGS_rocksdb_io_uring_enabled;
}
DEFINE_string(rocksdb_cloud_s3_endpoint_url,
"",
"S3 compatible object store (e.g. minio) endpoint URL only for "
"development purpose");
namespace EloqShare
{
bool CheckCommandLineFlagIsDefault(const char *name)
{
gflags::CommandLineFlagInfo flag_info;
bool flag_found = gflags::GetCommandLineFlagInfo(name, &flag_info);
// Make sure the flag is declared.
assert(flag_found);
(void) flag_found;
// Return `true` if the flag has the default value and has not been set
// explicitly from the cmdline or via SetCommandLineOption
return flag_info.is_default;
}
RocksDBConfig::RocksDBConfig(const INIReader &config,
const std::string &eloq_data_path)
{
info_log_level_ = !CheckCommandLineFlagIsDefault("rocksdb_info_log_level")
? FLAGS_rocksdb_info_log_level
: config.GetString("store",
"rocksdb_info_log_level",
FLAGS_rocksdb_info_log_level);
enable_stats_ =
!CheckCommandLineFlagIsDefault("rocksdb_enable_stats")
? FLAGS_rocksdb_enable_stats
: config.GetBoolean(
"store", "rocksdb_enable_stats", FLAGS_rocksdb_enable_stats);
stats_dump_period_sec_ =
!CheckCommandLineFlagIsDefault("rocksdb_stats_dump_period_sec")
? FLAGS_rocksdb_stats_dump_period_sec
: config.GetInteger("store",
"rocksdb_stats_dump_period_sec",
FLAGS_rocksdb_stats_dump_period_sec);
storage_path_ =
!CheckCommandLineFlagIsDefault("rocksdb_storage_path")
? FLAGS_rocksdb_storage_path
: config.GetString(
"store", "rocksdb_storage_path", FLAGS_rocksdb_storage_path);
if (storage_path_.empty())
{
storage_path_.append(eloq_data_path);
storage_path_.append("/rocksdb_data");
}
max_write_buffer_number_ =
!CheckCommandLineFlagIsDefault("rocksdb_max_write_buffer_number")
? FLAGS_rocksdb_max_write_buffer_number
: config.GetInteger("store",
"rocksdb_max_write_buffer_number",
FLAGS_rocksdb_max_write_buffer_number);
max_background_jobs_ =
!CheckCommandLineFlagIsDefault("rocksdb_max_background_jobs")
? FLAGS_rocksdb_max_background_jobs
: config.GetInteger("store",
"rocksdb_max_background_jobs",
FLAGS_rocksdb_max_background_jobs);
max_background_flush_ =
!CheckCommandLineFlagIsDefault("rocksdb_max_background_flush")
? FLAGS_rocksdb_max_background_flush
: config.GetInteger("store",
"rocksdb_max_background_flush",
FLAGS_rocksdb_max_background_flush);
max_background_compaction_ =
!CheckCommandLineFlagIsDefault("rocksdb_max_background_compaction")
? FLAGS_rocksdb_max_background_compaction
: config.GetInteger("store",
"rocksdb_max_background_compaction",
FLAGS_rocksdb_max_background_compaction);
std::string rocksdb_target_file_size_base =
!CheckCommandLineFlagIsDefault("rocksdb_target_file_size_base")
? FLAGS_rocksdb_target_file_size_base
: config.GetString("store",
"rocksdb_target_file_size_base",
FLAGS_rocksdb_target_file_size_base);
target_file_size_base_bytes_ = parse_size(rocksdb_target_file_size_base);
target_file_size_multiplier_ =
!CheckCommandLineFlagIsDefault("rocksdb_target_file_size_multiplier")
? FLAGS_rocksdb_target_file_size_multiplier
: config.GetInteger("store",
"rocksdb_target_file_size_multiplier",
FLAGS_rocksdb_target_file_size_multiplier);
std::string rocksdb_write_buffer_size =
!CheckCommandLineFlagIsDefault("rocksdb_write_buffer_size")
? FLAGS_rocksdb_write_buffer_size
: config.GetString("store",
"rocksdb_write_buffer_size",
FLAGS_rocksdb_write_buffer_size);
write_buffer_size_bytes_ = parse_size(rocksdb_write_buffer_size);
use_direct_io_for_flush_and_compaction_ = !CheckCommandLineFlagIsDefault(
"rocksdb_use_direct_io_for_flush_and_compaction");
use_direct_io_for_read_ =
!CheckCommandLineFlagIsDefault("rocksdb_use_direct_io_for_read");
level0_stop_writes_trigger_ =
!CheckCommandLineFlagIsDefault("rocksdb_level0_stop_writes_trigger")
? FLAGS_rocksdb_level0_stop_writes_trigger
: config.GetInteger("store",
"rocksdb_level0_stop_writes_trigger",
FLAGS_rocksdb_level0_stop_writes_trigger);
level0_slowdown_writes_trigger_ =
!CheckCommandLineFlagIsDefault("rocksdb_level0_slowdown_writes_trigger")
? FLAGS_rocksdb_level0_slowdown_writes_trigger
: config.GetInteger("store",
"rocksdb_level0_slowdown_writes_trigger",
FLAGS_rocksdb_level0_slowdown_writes_trigger);
level0_file_num_compaction_trigger_ =
!CheckCommandLineFlagIsDefault(
"rocksdb_level0_file_num_compaction_trigger")
? FLAGS_rocksdb_level0_file_num_compaction_trigger
: config.GetInteger(
"store",
"rocksdb_level0_file_num_compaction_trigger",
FLAGS_rocksdb_level0_file_num_compaction_trigger);
std::string rocksdb_max_bytes_for_level_base =
!CheckCommandLineFlagIsDefault("rocksdb_max_bytes_for_level_base")
? FLAGS_rocksdb_max_bytes_for_level_base
: config.GetString("store",
"rocksdb_max_bytes_for_level_base",
FLAGS_rocksdb_max_bytes_for_level_base);
max_bytes_for_level_base_bytes_ =
parse_size(rocksdb_max_bytes_for_level_base);
max_bytes_for_level_multiplier_ =
!CheckCommandLineFlagIsDefault("rocksdb_max_bytes_for_level_multiplier")
? FLAGS_rocksdb_max_bytes_for_level_multiplier
: config.GetInteger("store",
"rocksdb_max_bytes_for_level_multiplier",
FLAGS_rocksdb_max_bytes_for_level_multiplier);
compaction_style_ =
!CheckCommandLineFlagIsDefault("rocksdb_compaction_style")
? FLAGS_rocksdb_compaction_style
: config.GetString("store",
"rocksdb_compaction_style",
FLAGS_rocksdb_compaction_style);
std::string rocksdb_soft_pending_compaction_bytes_limit =
!CheckCommandLineFlagIsDefault(
"rocksdb_soft_pending_compaction_bytes_limit")
? FLAGS_rocksdb_soft_pending_compaction_bytes_limit
: config.GetString(
"store",
"rocksdb_soft_pending_compaction_bytes_limit",
FLAGS_rocksdb_soft_pending_compaction_bytes_limit);
soft_pending_compaction_bytes_limit_bytes_ =
parse_size(rocksdb_soft_pending_compaction_bytes_limit);
std::string rocksdb_hard_pending_compaction_bytes_limit =
!CheckCommandLineFlagIsDefault(
"rocksdb_hard_pending_compaction_bytes_limit")
? FLAGS_rocksdb_hard_pending_compaction_bytes_limit
: config.GetString(
"store",
"rocksdb_hard_pending_compaction_bytes_limit",
FLAGS_rocksdb_hard_pending_compaction_bytes_limit);
hard_pending_compaction_bytes_limit_bytes_ =
parse_size(rocksdb_hard_pending_compaction_bytes_limit);
max_subcompactions_ =
!CheckCommandLineFlagIsDefault("rocksdb_max_subcompactions")
? FLAGS_rocksdb_max_subcompactions
: config.GetInteger("store",
"rocksdb_max_subcompactions",
FLAGS_rocksdb_max_subcompactions);
std::string rocksdb_write_rate_limit =
!CheckCommandLineFlagIsDefault("rocksdb_write_rate_limit")
? FLAGS_rocksdb_write_rate_limit
: config.GetString("store",
"rocksdb_write_rate_limit",
FLAGS_rocksdb_write_rate_limit);
write_rate_limit_bytes_ = parse_size(rocksdb_write_rate_limit.c_str());
query_worker_num_ =
!CheckCommandLineFlagIsDefault("rocksdb_query_worker_num")
? FLAGS_rocksdb_query_worker_num
: config.GetInteger("store",
"rocksdb_query_worker_num",
FLAGS_rocksdb_query_worker_num);
std::string batch_write_size =
!CheckCommandLineFlagIsDefault("rocksdb_batch_write_size")
? FLAGS_rocksdb_batch_write_size
: config.GetString("store",
"rocksdb_batch_write_size",
FLAGS_rocksdb_batch_write_size);
batch_write_size_ = parse_size(batch_write_size);
snapshot_sync_worker_num_ =
!CheckCommandLineFlagIsDefault("snapshot_sync_worker_num")
? FLAGS_snapshot_sync_worker_num
: config.GetInteger("store",
"snapshot_sync_worker_num",
FLAGS_snapshot_sync_worker_num);
periodic_compaction_seconds_ =
!CheckCommandLineFlagIsDefault("rocksdb_periodic_compaction_seconds")
? FLAGS_rocksdb_periodic_compaction_seconds
: config.GetInteger("store",
"rocksdb_periodic_compaction_seconds",
FLAGS_rocksdb_periodic_compaction_seconds);
dialy_offpeak_time_utc_ =
!CheckCommandLineFlagIsDefault("rocksdb_dialy_offpeak_time_utc")
? FLAGS_rocksdb_dialy_offpeak_time_utc
: config.GetString("store",
"rocksdb_dialy_offpeak_time_utc",
FLAGS_rocksdb_dialy_offpeak_time_utc);
};
#if ROCKSDB_CLOUD_FS
RocksDBCloudConfig::RocksDBCloudConfig(const INIReader &config)
{
#if ROCKSDB_CLOUD_FS_TYPE == ROCKSDB_CLOUD_FS_TYPE_S3
aws_access_key_id_ =
!CheckCommandLineFlagIsDefault("aws_access_key_id")
? FLAGS_aws_access_key_id
: config.GetString(
"store", "aws_access_key_id", FLAGS_aws_access_key_id);
aws_secret_key_ =
!CheckCommandLineFlagIsDefault("aws_secret_key")
? FLAGS_aws_secret_key
: config.GetString("store", "aws_secret_key", FLAGS_aws_secret_key);
#endif
bucket_name_ = !CheckCommandLineFlagIsDefault("rocksdb_cloud_bucket_name")
? FLAGS_rocksdb_cloud_bucket_name
: config.GetString("store",
"rocksdb_cloud_bucket_name",
FLAGS_rocksdb_cloud_bucket_name);
bucket_prefix_ =
!CheckCommandLineFlagIsDefault("rocksdb_cloud_bucket_prefix")
? FLAGS_rocksdb_cloud_bucket_prefix
: config.GetString("store",
"rocksdb_cloud_bucket_prefix",
FLAGS_rocksdb_cloud_bucket_prefix);
region_ =
!CheckCommandLineFlagIsDefault("rocksdb_cloud_region")
? FLAGS_rocksdb_cloud_region
: config.GetString(
"store", "rocksdb_cloud_region", FLAGS_rocksdb_cloud_region);
std::string rocksdb_cloud_sst_file_cache_size =
!CheckCommandLineFlagIsDefault("rocksdb_cloud_sst_file_cache_size")
? FLAGS_rocksdb_cloud_sst_file_cache_size
: config.GetString("store",
"rocksdb_cloud_sst_file_cache_size",
FLAGS_rocksdb_cloud_sst_file_cache_size);
uint32_t rocksdb_cloud_db_ready_timeout_sec =
!CheckCommandLineFlagIsDefault("rocksdb_cloud_db_ready_timeout_sec")
? FLAGS_rocksdb_cloud_db_ready_timeout_sec
: config.GetInteger("store",
"rocksdb_cloud_db_ready_timeout_sec",
FLAGS_rocksdb_cloud_db_ready_timeout_sec);
uint32_t rocksdb_cloud_db_file_deletion_delay_sec =
!CheckCommandLineFlagIsDefault(
"rocksdb_cloud_db_file_deletion_delay_sec")
? FLAGS_rocksdb_cloud_db_file_deletion_delay_sec
: config.GetInteger("store",
"rocksdb_cloud_db_file_deletion_delay_sec",
FLAGS_rocksdb_cloud_db_file_deletion_delay_sec);
sst_file_cache_size_ =
parse_size(rocksdb_cloud_sst_file_cache_size.c_str());
db_ready_timeout_us_ = rocksdb_cloud_db_ready_timeout_sec * 1000000;
db_file_deletion_delay_ = rocksdb_cloud_db_file_deletion_delay_sec;
s3_endpoint_url_ =
!CheckCommandLineFlagIsDefault("rocksdb_cloud_s3_endpoint_url")
? FLAGS_rocksdb_cloud_s3_endpoint_url
: config.GetString("store",
"rocksdb_cloud_s3_endpoint_url",
FLAGS_rocksdb_cloud_s3_endpoint_url);
warm_up_thread_num_ =
!CheckCommandLineFlagIsDefault("rocksdb_cloud_warm_up_thread_num")
? FLAGS_rocksdb_cloud_warm_up_thread_num
: config.GetInteger("store",
"rocksdb_cloud_warm_up_thread_num",
FLAGS_rocksdb_cloud_warm_up_thread_num);
}
#endif
} // namespace EloqShare