Browse Source

@23023120

git-svn-id: https://leveldb.googlecode.com/svn/trunk@47 62dab493-f737-651d-591e-8d6aee1b9529
xry
dgrogan@chromium.org 13 years ago
parent
commit
a05525d13b
3 changed files with 7 additions and 7 deletions
  1. +1
    -1
      db/db_impl.cc
  2. +5
    -5
      db/version_set.cc
  3. +1
    -1
      util/cache.cc

+ 1
- 1
db/db_impl.cc View File

@ -1141,7 +1141,7 @@ bool DBImpl::GetProperty(const Slice& property, std::string* value) {
in.remove_prefix(strlen("num-files-at-level")); in.remove_prefix(strlen("num-files-at-level"));
uint64_t level; uint64_t level;
bool ok = ConsumeDecimalNumber(&in, &level) && in.empty(); bool ok = ConsumeDecimalNumber(&in, &level) && in.empty();
if (!ok || level < 0 || level >= config::kNumLevels) {
if (!ok || level >= config::kNumLevels) {
return false; return false;
} else { } else {
char buf[100]; char buf[100];

+ 5
- 5
db/version_set.cc View File

@ -103,7 +103,7 @@ bool SomeFileOverlapsRange(
const Slice& largest_user_key) { const Slice& largest_user_key) {
// Find the earliest possible internal key for smallest_user_key // Find the earliest possible internal key for smallest_user_key
InternalKey small(smallest_user_key, kMaxSequenceNumber, kValueTypeForSeek); InternalKey small(smallest_user_key, kMaxSequenceNumber, kValueTypeForSeek);
const int index = FindFile(icmp, files, small.Encode());
const uint32_t index = FindFile(icmp, files, small.Encode());
return ((index < files.size()) && return ((index < files.size()) &&
icmp.user_comparator()->Compare( icmp.user_comparator()->Compare(
largest_user_key, files[index]->smallest.user_key()) >= 0); largest_user_key, files[index]->smallest.user_key()) >= 0);
@ -266,7 +266,7 @@ Status Version::Get(const ReadOptions& options,
// Level-0 files may overlap each other. Find all files that // Level-0 files may overlap each other. Find all files that
// overlap user_key and process them in order from newest to oldest. // overlap user_key and process them in order from newest to oldest.
tmp.reserve(num_files); tmp.reserve(num_files);
for (int i = 0; i < num_files; i++) {
for (uint32_t i = 0; i < num_files; i++) {
FileMetaData* f = files[i]; FileMetaData* f = files[i];
if (ucmp->Compare(user_key, f->smallest.user_key()) >= 0 && if (ucmp->Compare(user_key, f->smallest.user_key()) >= 0 &&
ucmp->Compare(user_key, f->largest.user_key()) <= 0) { ucmp->Compare(user_key, f->largest.user_key()) <= 0) {
@ -297,7 +297,7 @@ Status Version::Get(const ReadOptions& options,
} }
} }
for (int i = 0; i < num_files; ++i) {
for (uint32_t i = 0; i < num_files; ++i) {
if (last_file_read != NULL && stats->seek_file == NULL) { if (last_file_read != NULL && stats->seek_file == NULL) {
// We have had more than one seek for this read. Charge the 1st file. // We have had more than one seek for this read. Charge the 1st file.
stats->seek_file = last_file_read; stats->seek_file = last_file_read;
@ -442,7 +442,7 @@ class VersionSet::Builder {
to_unref.push_back(*it); to_unref.push_back(*it);
} }
delete added; delete added;
for (int i = 0; i < to_unref.size(); i++) {
for (uint32_t i = 0; i < to_unref.size(); i++) {
FileMetaData* f = to_unref[i]; FileMetaData* f = to_unref[i];
f->refs--; f->refs--;
if (f->refs <= 0) { if (f->refs <= 0) {
@ -533,7 +533,7 @@ class VersionSet::Builder {
#ifndef NDEBUG #ifndef NDEBUG
// Make sure there is no overlap in levels > 0 // Make sure there is no overlap in levels > 0
if (level > 0) { if (level > 0) {
for (int i = 1; i < v->files_[level].size(); i++) {
for (uint32_t i = 1; i < v->files_[level].size(); i++) {
const InternalKey& prev_end = v->files_[level][i-1]->largest; const InternalKey& prev_end = v->files_[level][i-1]->largest;
const InternalKey& this_begin = v->files_[level][i]->smallest; const InternalKey& this_begin = v->files_[level][i]->smallest;
if (vset_->icmp_.Compare(prev_end, this_begin) >= 0) { if (vset_->icmp_.Compare(prev_end, this_begin) >= 0) {

+ 1
- 1
util/cache.cc View File

@ -112,7 +112,7 @@ class HandleTable {
LRUHandle** new_list = new LRUHandle*[new_length]; LRUHandle** new_list = new LRUHandle*[new_length];
memset(new_list, 0, sizeof(new_list[0]) * new_length); memset(new_list, 0, sizeof(new_list[0]) * new_length);
uint32_t count = 0; uint32_t count = 0;
for (int i = 0; i < length_; i++) {
for (uint32_t i = 0; i < length_; i++) {
LRUHandle* h = list_[i]; LRUHandle* h = list_[i];
while (h != NULL) { while (h != NULL) {
LRUHandle* next = h->next_hash; LRUHandle* next = h->next_hash;

Loading…
Cancel
Save