소스 검색

Merge pull request #945 from xiong-ang:master

PiperOrigin-RevId: 420645727
naive_version
Victor Costan 2 년 전
부모
커밋
56f2394250
1개의 변경된 파일6개의 추가작업 그리고 5개의 파일을 삭제
  1. +6
    -5
      doc/index.md

+ 6
- 5
doc/index.md 파일 보기

@ -369,6 +369,7 @@ leveldb::Iterator* it = db->NewIterator(options);
for (it->SeekToFirst(); it->Valid(); it->Next()) {
...
}
delete it;
```
### Key Layout
@ -424,21 +425,21 @@ spaces. For example:
```c++
class CustomFilterPolicy : public leveldb::FilterPolicy {
private:
FilterPolicy* builtin_policy_;
leveldb::FilterPolicy* builtin_policy_;
public:
CustomFilterPolicy() : builtin_policy_(NewBloomFilterPolicy(10)) {}
CustomFilterPolicy() : builtin_policy_(leveldb::NewBloomFilterPolicy(10)) {}
~CustomFilterPolicy() { delete builtin_policy_; }
const char* Name() const { return "IgnoreTrailingSpacesFilter"; }
void CreateFilter(const Slice* keys, int n, std::string* dst) const {
void CreateFilter(const leveldb::Slice* keys, int n, std::string* dst) const {
// Use builtin bloom filter code after removing trailing spaces
std::vector<Slice> trimmed(n);
std::vector<leveldb::Slice> trimmed(n);
for (int i = 0; i < n; i++) {
trimmed[i] = RemoveTrailingSpaces(keys[i]);
}
return builtin_policy_->CreateFilter(trimmed.data(), n, dst);
builtin_policy_->CreateFilter(trimmed.data(), n, dst);
}
};
```

불러오는 중...
취소
저장