Fix rebase issues and new code warnings.

main
Dmitri Smirnov 9 years ago
parent 3fa68af316
commit a6fbdd64e0
  1. 2
      db/compaction_job_stats_test.cc
  2. 4
      db/db_test.cc
  3. 13
      db/internal_stats.cc
  4. 15
      db/version_set.cc
  5. 1
      include/rocksdb/delete_scheduler.h

@ -553,7 +553,7 @@ uint64_t EstimatedFileSize(
uint64_t data_size = uint64_t data_size =
static_cast<uint64_t>( static_cast<uint64_t>(
num_records * (key_size + value_size * compression_ratio + num_records * (key_size + value_size * compression_ratio +
kPerKeyOverhead)); kPerKeyOverhead));
return data_size + kFooterSize return data_size + kFooterSize
+ num_records * bloom_bits_per_key / 8 // filter block + num_records * bloom_bits_per_key / 8 // filter block

@ -5243,11 +5243,11 @@ class RecoveryTestHelper {
int fd = open(filename.c_str(), O_RDWR); int fd = open(filename.c_str(), O_RDWR);
ASSERT_GT(fd, 0); ASSERT_GT(fd, 0);
ASSERT_EQ(offset, lseek(fd, offset, SEEK_SET)); ASSERT_EQ(offset, lseek(fd, static_cast<long>(offset), SEEK_SET));
void* buf = alloca(len); void* buf = alloca(len);
memset(buf, 'a', len); memset(buf, 'a', len);
ASSERT_EQ(len, write(fd, buf, len)); ASSERT_EQ(len, write(fd, buf, static_cast<unsigned int>(len)));
close(fd); close(fd);
} }

@ -43,9 +43,9 @@ void PrintLevelStatsHeader(char* buf, size_t len, const std::string& cf_name) {
} }
void PrintLevelStats(char* buf, size_t len, const std::string& name, void PrintLevelStats(char* buf, size_t len, const std::string& name,
int num_files, int being_compacted, double total_file_size, int num_files, int being_compacted, double total_file_size,
double score, double w_amp, double score, double w_amp,
const InternalStats::CompactionStats& stats) { const InternalStats::CompactionStats& stats) {
uint64_t bytes_read = uint64_t bytes_read =
stats.bytes_read_non_output_levels + stats.bytes_read_output_level; stats.bytes_read_non_output_levels + stats.bytes_read_output_level;
int64_t bytes_new = int64_t bytes_new =
@ -69,8 +69,8 @@ void PrintLevelStats(char* buf, size_t len, const std::string& name,
"%9.0f " /* Comp(sec) */ "%9.0f " /* Comp(sec) */
"%9d " /* Comp(cnt) */ "%9d " /* Comp(cnt) */
"%8.3f " /* Avg(sec) */ "%8.3f " /* Avg(sec) */
"%7s " /* KeyIn */ "%7s " /* KeyIn */
"%6s\n", /* KeyDrop */ "%6s\n", /* KeyDrop */
name.c_str(), name.c_str(),
num_files, being_compacted, total_file_size / kMB, score, num_files, being_compacted, total_file_size / kMB, score,
bytes_read / kGB, stats.bytes_read_non_output_levels / kGB, bytes_read / kGB, stats.bytes_read_non_output_levels / kGB,
@ -687,7 +687,8 @@ void InternalStats::DumpCFStats(std::string* value) {
comp_stats_[level].bytes_read_non_output_levels; comp_stats_[level].bytes_read_non_output_levels;
PrintLevelStats(buf, sizeof(buf), "L" + ToString(level), files, PrintLevelStats(buf, sizeof(buf), "L" + ToString(level), files,
files_being_compacted[level], files_being_compacted[level],
vstorage->NumLevelBytes(level), compaction_score[level], static_cast<double>(vstorage->NumLevelBytes(level)),
compaction_score[level],
w_amp, comp_stats_[level]); w_amp, comp_stats_[level]);
value->append(buf); value->append(buf);
} }

@ -871,20 +871,17 @@ Version::Version(ColumnFamilyData* column_family_data, VersionSet* vset,
refs_(0), refs_(0),
version_number_(version_number) {} version_number_(version_number) {}
void Version::Get(const ReadOptions& read_options, const LookupKey& k, void Version::Get(const ReadOptions& read_options,
std::string* value, Status* status, const LookupKey& k,
MergeContext* merge_context, bool* value_found, std::string* value,
bool* key_exists, SequenceNumber* seq) { Status* status,
MergeContext* merge_context,
bool* value_found) {
Slice ikey = k.internal_key(); Slice ikey = k.internal_key();
Slice user_key = k.user_key(); Slice user_key = k.user_key();
assert(status->ok() || status->IsMergeInProgress()); assert(status->ok() || status->IsMergeInProgress());
if (key_exists != nullptr) {
// will falsify below if not found
*key_exists = true;
}
GetContext get_context( GetContext get_context(
user_comparator(), merge_operator_, info_log_, db_statistics_, user_comparator(), merge_operator_, info_log_, db_statistics_,
status->ok() ? GetContext::kNotFound : GetContext::kMerge, user_key, status->ok() ? GetContext::kNotFound : GetContext::kMerge, user_key,

@ -7,6 +7,7 @@
#include <map> #include <map>
#include <string> #include <string>
#include <memory>
#include "rocksdb/status.h" #include "rocksdb/status.h"

Loading…
Cancel
Save