Changeset View
Changeset View
Standalone View
Standalone View
src/leveldb/table/filter_block.cc
// Copyright (c) 2012 The LevelDB Authors. All rights reserved. | // Copyright (c) 2012 The LevelDB Authors. All rights reserved. | ||||
// Use of this source code is governed by a BSD-style license that can be | // Use of this source code is governed by a BSD-style license that can be | ||||
// found in the LICENSE file. See the AUTHORS file for names of contributors. | // found in the LICENSE file. See the AUTHORS file for names of contributors. | ||||
#include "table/filter_block.h" | #include "table/filter_block.h" | ||||
#include "leveldb/filter_policy.h" | #include "leveldb/filter_policy.h" | ||||
#include "util/coding.h" | #include "util/coding.h" | ||||
namespace leveldb { | namespace leveldb { | ||||
// See doc/table_format.txt for an explanation of the filter block format. | // See doc/table_format.md for an explanation of the filter block format. | ||||
// Generate new filter every 2KB of data | // Generate new filter every 2KB of data | ||||
static const size_t kFilterBaseLg = 11; | static const size_t kFilterBaseLg = 11; | ||||
static const size_t kFilterBase = 1 << kFilterBaseLg; | static const size_t kFilterBase = 1 << kFilterBaseLg; | ||||
FilterBlockBuilder::FilterBlockBuilder(const FilterPolicy* policy) | FilterBlockBuilder::FilterBlockBuilder(const FilterPolicy* policy) | ||||
: policy_(policy) { | : policy_(policy) { | ||||
} | } | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |