提交 cc97aef8 编写于 作者: Z ZhaoMing 提交者: 奏之章

More details for table_file_creation

上级 98a5c0aa
......@@ -215,7 +215,7 @@ ColumnFamilyOptions SanitizeOptions(const ImmutableDBOptions& db_options,
if (result.compaction_style != CompactionStyle::kCompactionStyleLevel ||
!result.enable_lazy_compaction) {
result.optimize_filters_for_hits = false;
result.optimize_range_deletion = false;
}
if (result.max_write_buffer_number < 2) {
......
......@@ -6,6 +6,7 @@
#include "db/event_helpers.h"
#include "rocksdb/terark_namespace.h"
#include "util/string_util.h"
namespace TERARKDB_NAMESPACE {
......@@ -101,6 +102,34 @@ void EventHelpers::LogAndNotifyTableFileCreationFinished(
<< "num_data_blocks" << table_properties.num_data_blocks
<< "num_entries" << table_properties.num_entries
<< "filter_policy_name" << table_properties.filter_policy_name;
if (!table_properties.dependence.empty()) {
jwriter << "dependence";
auto& dependence = table_properties.dependence;
jwriter.StartArray();
for (size_t i = 0; i < dependence.size(); ++i) {
if (i < 100) {
jwriter << dependence[i].file_number;
} else {
jwriter << "...(" + ToString(dependence.size() - i) + ")";
break;
}
}
jwriter.EndArray();
}
if (!table_properties.inheritance_tree.empty()) {
jwriter << "inheritance_tree";
jwriter.StartArray();
auto& inheritance_tree = table_properties.inheritance_tree;
for (size_t i = 0; i < inheritance_tree.size(); ++i) {
if (i < 100) {
jwriter << inheritance_tree[i];
} else {
jwriter << "...(" + ToString(inheritance_tree.size() - i) + ")";
break;
}
}
jwriter.EndArray();
}
// user collected properties
for (const auto& prop : table_properties.readable_properties) {
......
......@@ -18,10 +18,7 @@
#include <algorithm>
#include <atomic>
#include <functional>
#include <map>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
......@@ -33,6 +30,7 @@
#include "rocksdb/terark_namespace.h"
#include "util/c_style_callback.h"
#include "util/chash_map.h"
#include "util/chash_set.h"
#define ROCKS_VERSION_BUILDER_DEBUG 0
......@@ -147,7 +145,7 @@ struct VersionBuilderContextImpl : VersionBuilder::Context {
}
TableCache* table_cache;
std::unordered_map<uint64_t, FileMetaData*>* levels;
chash_map<uint64_t, FileMetaData*>* levels;
size_t dependence_version;
size_t new_deleted_files;
chash_map<uint64_t, DependenceItem> dependence_map;
......@@ -196,7 +194,7 @@ class VersionBuilder::Rep {
// storing them in levels to avoid regression in case there are no files
// on invalid levels. The version is not consistent if in the end the files
// on invalid levels don't cancel out.
std::map<int, std::unordered_set<uint64_t>> invalid_levels_;
chash_map<int, chash_set<uint64_t>> invalid_levels_;
// Whether there are invalid new files or invalid deletion on levels larger
// than num_levels_.
bool has_invalid_levels_;
......@@ -589,8 +587,7 @@ class VersionBuilder::Rep {
auto base_context = base_vstorage_->ReleaseVersionBuilderContext();
if (base_context == nullptr) {
context_.reset(new VersionBuilderContextImpl());
context_->levels =
new std::unordered_map<uint64_t, FileMetaData*>[num_levels_];
context_->levels = new chash_map<uint64_t, FileMetaData*>[num_levels_];
context_->table_cache = table_cache_;
for (int level = -1; level < num_levels_; level++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册