Summary: * Dump blob db options to info log * Remove BlobDBOptionsImpl to disallow dynamic cast *BlobDBOptions into *BlobDBOptionsImpl. Move options there to be constants or into BlobDBOptions. The dynamic cast is broken after #2645 * Change some of the default options * Remove blob_db_options.min_blob_size, which is unimplemented. Will implement it soon. Closes https://github.com/facebook/rocksdb/pull/2671 Differential Revision: D5529912 Pulled By: yiwu-arbug fbshipit-source-id: dcd58ca981db5bcc7f123b65a0d6f6ae0dc703c7main
parent
3218edc573
commit
1900771bd2
@ -1,69 +0,0 @@ |
||||
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
||||
// This source code is licensed under both the GPLv2 (found in the
|
||||
// COPYING file in the root directory) and Apache 2.0 License
|
||||
// (found in the LICENSE.Apache file in the root directory).
|
||||
#ifndef ROCKSDB_LITE |
||||
|
||||
#include "utilities/blob_db/blob_db_options_impl.h" |
||||
|
||||
namespace rocksdb { |
||||
|
||||
namespace blob_db { |
||||
|
||||
BlobDBOptionsImpl::BlobDBOptionsImpl(const BlobDBOptions& in) |
||||
: BlobDBOptions(in), |
||||
deletion_check_period_millisecs(2 * 1000), |
||||
gc_file_pct(20), |
||||
gc_check_period_millisecs(60 * 1000), |
||||
sanity_check_period_millisecs(20 * 60 * 1000), |
||||
open_files_trigger(100), |
||||
wa_num_stats_periods(24), |
||||
wa_stats_period_millisecs(3600 * 1000), |
||||
partial_expiration_gc_range_secs(4 * 3600), |
||||
partial_expiration_pct(75), |
||||
fsync_files_period_millisecs(10 * 1000), |
||||
reclaim_of_period_millisecs(1 * 1000), |
||||
delete_obsf_period_millisecs(10 * 1000), |
||||
check_seqf_period_millisecs(10 * 1000), |
||||
disable_background_tasks(false) {} |
||||
|
||||
BlobDBOptionsImpl::BlobDBOptionsImpl() |
||||
: deletion_check_period_millisecs(2 * 1000), |
||||
gc_file_pct(20), |
||||
gc_check_period_millisecs(60 * 1000), |
||||
sanity_check_period_millisecs(20 * 60 * 1000), |
||||
open_files_trigger(100), |
||||
wa_num_stats_periods(24), |
||||
wa_stats_period_millisecs(3600 * 1000), |
||||
partial_expiration_gc_range_secs(4 * 3600), |
||||
partial_expiration_pct(75), |
||||
fsync_files_period_millisecs(10 * 1000), |
||||
reclaim_of_period_millisecs(1 * 1000), |
||||
delete_obsf_period_millisecs(10 * 1000), |
||||
check_seqf_period_millisecs(10 * 1000), |
||||
disable_background_tasks(false) {} |
||||
|
||||
BlobDBOptionsImpl& BlobDBOptionsImpl::operator=(const BlobDBOptionsImpl& in) { |
||||
BlobDBOptions::operator=(in); |
||||
if (this != &in) { |
||||
deletion_check_period_millisecs = in.deletion_check_period_millisecs; |
||||
gc_file_pct = in.gc_file_pct; |
||||
gc_check_period_millisecs = in.gc_check_period_millisecs; |
||||
sanity_check_period_millisecs = in.sanity_check_period_millisecs; |
||||
open_files_trigger = in.open_files_trigger; |
||||
wa_num_stats_periods = in.wa_num_stats_periods; |
||||
wa_stats_period_millisecs = in.wa_stats_period_millisecs; |
||||
partial_expiration_gc_range_secs = in.partial_expiration_gc_range_secs; |
||||
partial_expiration_pct = in.partial_expiration_pct; |
||||
fsync_files_period_millisecs = in.fsync_files_period_millisecs; |
||||
reclaim_of_period_millisecs = in.reclaim_of_period_millisecs; |
||||
delete_obsf_period_millisecs = in.delete_obsf_period_millisecs; |
||||
check_seqf_period_millisecs = in.check_seqf_period_millisecs; |
||||
disable_background_tasks = in.disable_background_tasks; |
||||
} |
||||
return *this; |
||||
} |
||||
|
||||
} // namespace blob_db
|
||||
} // namespace rocksdb
|
||||
#endif // ROCKSDB_LITE
|
@ -1,76 +0,0 @@ |
||||
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
||||
// This source code is licensed under both the GPLv2 (found in the
|
||||
// COPYING file in the root directory) and Apache 2.0 License
|
||||
// (found in the LICENSE.Apache file in the root directory).
|
||||
|
||||
#pragma once |
||||
|
||||
#ifndef ROCKSDB_LITE |
||||
|
||||
#include "utilities/blob_db/blob_db.h" |
||||
|
||||
namespace rocksdb { |
||||
|
||||
namespace blob_db { |
||||
|
||||
struct BlobDBOptionsImpl : public BlobDBOptions { |
||||
// deletions check period
|
||||
uint32_t deletion_check_period_millisecs; |
||||
|
||||
// gc percentage each check period
|
||||
uint32_t gc_file_pct; |
||||
|
||||
// gc period
|
||||
uint32_t gc_check_period_millisecs; |
||||
|
||||
// sanity check task
|
||||
uint32_t sanity_check_period_millisecs; |
||||
|
||||
// how many random access open files can we tolerate
|
||||
uint32_t open_files_trigger; |
||||
|
||||
// how many periods of stats do we keep.
|
||||
uint32_t wa_num_stats_periods; |
||||
|
||||
// what is the length of any period
|
||||
uint32_t wa_stats_period_millisecs; |
||||
|
||||
// we will garbage collect blob files in
|
||||
// which entire files have expired. However if the
|
||||
// ttl_range of files is very large say a day, we
|
||||
// would have to wait for the entire day, before we
|
||||
// recover most of the space.
|
||||
uint32_t partial_expiration_gc_range_secs; |
||||
|
||||
// this should be based on allowed Write Amplification
|
||||
// if 50% of the space of a blob file has been deleted/expired,
|
||||
uint32_t partial_expiration_pct; |
||||
|
||||
// how often should we schedule a job to fsync open files
|
||||
uint32_t fsync_files_period_millisecs; |
||||
|
||||
// how often to schedule reclaim open files.
|
||||
uint32_t reclaim_of_period_millisecs; |
||||
|
||||
// how often to schedule delete obs files periods
|
||||
uint32_t delete_obsf_period_millisecs; |
||||
|
||||
// how often to schedule check seq files period
|
||||
uint32_t check_seqf_period_millisecs; |
||||
|
||||
// Disable all background job.
|
||||
bool disable_background_tasks; |
||||
|
||||
// default constructor
|
||||
BlobDBOptionsImpl(); |
||||
|
||||
explicit BlobDBOptionsImpl(const BlobDBOptions& in); |
||||
|
||||
BlobDBOptionsImpl& operator=(const BlobDBOptionsImpl& in); |
||||
}; |
||||
|
||||
} // namespace blob_db
|
||||
|
||||
} // namespace rocksdb
|
||||
|
||||
#endif // endif ROCKSDB
|
Loading…
Reference in new issue