Merge branch 'master' into columnfamilies

main
Igor Canadi 11 years ago
commit 328ac7ee02
  1. 12
      db/memtable.cc
  2. 2
      include/rocksdb/env.h
  3. 2
      table/filter_block.cc
  4. 4
      tools/db_repl_stress.cc
  5. 7
      util/crc32c.cc
  6. 2
      util/ldb_cmd.cc

@ -149,7 +149,7 @@ void MemTable::Add(SequenceNumber s, ValueType type,
p += 8; p += 8;
p = EncodeVarint32(p, val_size); p = EncodeVarint32(p, val_size);
memcpy(p, value.data(), val_size); memcpy(p, value.data(), val_size);
assert((p + val_size) - buf == (unsigned)encoded_len); assert((unsigned)(p + val_size - buf) == (unsigned)encoded_len);
table_->Insert(buf); table_->Insert(buf);
// The first sequence number inserted into the memtable // The first sequence number inserted into the memtable
@ -303,13 +303,9 @@ bool MemTable::Update(SequenceNumber seq, ValueType type,
value.size()); value.size());
WriteLock wl(GetLock(lkey.user_key())); WriteLock wl(GetLock(lkey.user_key()));
memcpy(p, value.data(), value.size()); memcpy(p, value.data(), value.size());
assert( assert((unsigned)((p + value.size()) - entry) ==
(p + value.size()) - entry == (unsigned)(VarintLength(key_length) + key_length +
(unsigned) (VarintLength(key_length) + VarintLength(value.size()) + value.size()));
key_length +
VarintLength(value.size()) +
value.size())
);
return true; return true;
} }
} }

@ -438,7 +438,7 @@ class WritableFile {
// This asks the OS to initiate flushing the cached data to disk, // This asks the OS to initiate flushing the cached data to disk,
// without waiting for completion. // without waiting for completion.
// Default implementation does nothing. // Default implementation does nothing.
virtual Status RangeSync(off_t offset, off_t nbytes) { virtual Status RangeSync(off64_t offset, off64_t nbytes) {
return Status::OK(); return Status::OK();
} }

@ -173,7 +173,7 @@ bool FilterBlockReader::MayMatch(uint64_t block_offset, const Slice& entry) {
if (index < num_) { if (index < num_) {
uint32_t start = DecodeFixed32(offset_ + index*4); uint32_t start = DecodeFixed32(offset_ + index*4);
uint32_t limit = DecodeFixed32(offset_ + index*4 + 4); uint32_t limit = DecodeFixed32(offset_ + index*4 + 4);
if (start <= limit && limit <= (offset_ - data_)) { if (start <= limit && limit <= (uint32_t)(offset_ - data_)) {
Slice filter = Slice(data_ + start, limit - start); Slice filter = Slice(data_ + start, limit - start);
return policy_->KeyMayMatch(entry, filter); return policy_->KeyMayMatch(entry, filter);
} else if (start == limit) { } else if (start == limit) {

@ -125,8 +125,8 @@ int main(int argc, const char** argv) {
replThread.stop.Release_Store(nullptr); replThread.stop.Release_Store(nullptr);
if (replThread.no_read < dataPump.no_records) { if (replThread.no_read < dataPump.no_records) {
// no. read should be => than inserted. // no. read should be => than inserted.
fprintf(stderr, "No. of Record's written and read not same\nRead : %ld" fprintf(stderr, "No. of Record's written and read not same\nRead : %zu"
" Written : %ld\n", replThread.no_read, dataPump.no_records); " Written : %zu\n", replThread.no_read, dataPump.no_records);
exit(1); exit(1);
} }
fprintf(stderr, "Successful!\n"); fprintf(stderr, "Successful!\n");

@ -333,17 +333,14 @@ static bool isSSE42() {
} }
typedef void (*Function)(uint64_t*, uint8_t const**); typedef void (*Function)(uint64_t*, uint8_t const**);
static Function func = nullptr;
static inline Function Choose_CRC32() { static inline Function Choose_CRC32() {
return isSSE42() ? Fast_CRC32 : Slow_CRC32; return isSSE42() ? Fast_CRC32 : Slow_CRC32;
} }
static Function func = Choose_CRC32();
static inline void CRC32(uint64_t* l, uint8_t const **p) { static inline void CRC32(uint64_t* l, uint8_t const **p) {
if (func != nullptr) {
return func(l, p);
}
func = Choose_CRC32();
func(l, p); func(l, p);
} }

@ -1004,7 +1004,7 @@ Options ReduceDBLevelsCommand::PrepareOptionsForOpenDB() {
opt.num_levels = old_levels_; opt.num_levels = old_levels_;
opt.max_bytes_for_level_multiplier_additional.resize(opt.num_levels, 1); opt.max_bytes_for_level_multiplier_additional.resize(opt.num_levels, 1);
// Disable size compaction // Disable size compaction
opt.max_bytes_for_level_base = 1UL << 50; opt.max_bytes_for_level_base = 1ULL << 50;
opt.max_bytes_for_level_multiplier = 1; opt.max_bytes_for_level_multiplier = 1;
opt.max_mem_compaction_level = 0; opt.max_mem_compaction_level = 0;
return opt; return opt;

Loading…
Cancel
Save