remove unnecessary internal_comparator param in newIterator
Summary: solved https://github.com/facebook/rocksdb/issues/2604 Closes https://github.com/facebook/rocksdb/pull/2648 Differential Revision: D5504875 Pulled By: lightmark fbshipit-source-id: c14bb62ccbdc9e7bda9cd914cae4ea0765d882ee
This commit is contained in:
parent
7f6d012d70
commit
8f553d3c52
@ -225,8 +225,7 @@ InternalIterator* TableCache::NewIterator(
|
|||||||
}
|
}
|
||||||
InternalIterator* result = nullptr;
|
InternalIterator* result = nullptr;
|
||||||
if (s.ok()) {
|
if (s.ok()) {
|
||||||
result =
|
result = table_reader->NewIterator(options, arena, skip_filters);
|
||||||
table_reader->NewIterator(options, arena, &icomparator, skip_filters);
|
|
||||||
if (create_new_table_reader) {
|
if (create_new_table_reader) {
|
||||||
assert(handle == nullptr);
|
assert(handle == nullptr);
|
||||||
result->RegisterCleanup(&DeleteTableReader, table_reader, nullptr);
|
result->RegisterCleanup(&DeleteTableReader, table_reader, nullptr);
|
||||||
|
@ -1545,11 +1545,12 @@ bool BlockBasedTable::PrefixMayMatch(const Slice& internal_key) {
|
|||||||
return may_match;
|
return may_match;
|
||||||
}
|
}
|
||||||
|
|
||||||
InternalIterator* BlockBasedTable::NewIterator(
|
InternalIterator* BlockBasedTable::NewIterator(const ReadOptions& read_options,
|
||||||
const ReadOptions& read_options, Arena* arena,
|
Arena* arena,
|
||||||
const InternalKeyComparator* icomp, bool skip_filters) {
|
bool skip_filters) {
|
||||||
return NewTwoLevelIterator(
|
return NewTwoLevelIterator(
|
||||||
new BlockEntryIteratorState(this, read_options, icomp, skip_filters),
|
new BlockEntryIteratorState(this, read_options,
|
||||||
|
&rep_->internal_comparator, skip_filters),
|
||||||
NewIndexIterator(read_options), arena);
|
NewIndexIterator(read_options), arena);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,6 @@ class BlockBasedTable : public TableReader {
|
|||||||
// @param skip_filters Disables loading/accessing the filter block
|
// @param skip_filters Disables loading/accessing the filter block
|
||||||
InternalIterator* NewIterator(
|
InternalIterator* NewIterator(
|
||||||
const ReadOptions&, Arena* arena = nullptr,
|
const ReadOptions&, Arena* arena = nullptr,
|
||||||
const InternalKeyComparator* icomparator = nullptr,
|
|
||||||
bool skip_filters = false) override;
|
bool skip_filters = false) override;
|
||||||
|
|
||||||
InternalIterator* NewRangeTombstoneIterator(
|
InternalIterator* NewRangeTombstoneIterator(
|
||||||
|
@ -364,8 +364,7 @@ extern InternalIterator* NewErrorInternalIterator(const Status& status,
|
|||||||
Arena* arena);
|
Arena* arena);
|
||||||
|
|
||||||
InternalIterator* CuckooTableReader::NewIterator(
|
InternalIterator* CuckooTableReader::NewIterator(
|
||||||
const ReadOptions& read_options, Arena* arena,
|
const ReadOptions& read_options, Arena* arena, bool skip_filters) {
|
||||||
const InternalKeyComparator* icomp, bool skip_filters) {
|
|
||||||
if (!status().ok()) {
|
if (!status().ok()) {
|
||||||
return NewErrorInternalIterator(
|
return NewErrorInternalIterator(
|
||||||
Status::Corruption("CuckooTableReader status is not okay."), arena);
|
Status::Corruption("CuckooTableReader status is not okay."), arena);
|
||||||
|
@ -47,7 +47,6 @@ class CuckooTableReader: public TableReader {
|
|||||||
|
|
||||||
InternalIterator* NewIterator(
|
InternalIterator* NewIterator(
|
||||||
const ReadOptions&, Arena* arena = nullptr,
|
const ReadOptions&, Arena* arena = nullptr,
|
||||||
const InternalKeyComparator* icomparator = nullptr,
|
|
||||||
bool skip_filters = false) override;
|
bool skip_filters = false) override;
|
||||||
void Prepare(const Slice& target) override;
|
void Prepare(const Slice& target) override;
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ stl_wrappers::KVMap MakeMockFile(
|
|||||||
|
|
||||||
InternalIterator* MockTableReader::NewIterator(const ReadOptions&,
|
InternalIterator* MockTableReader::NewIterator(const ReadOptions&,
|
||||||
Arena* arena,
|
Arena* arena,
|
||||||
const InternalKeyComparator*,
|
|
||||||
bool skip_filters) {
|
bool skip_filters) {
|
||||||
return new MockTableIterator(table_);
|
return new MockTableIterator(table_);
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,6 @@ class MockTableReader : public TableReader {
|
|||||||
|
|
||||||
InternalIterator* NewIterator(const ReadOptions&,
|
InternalIterator* NewIterator(const ReadOptions&,
|
||||||
Arena* arena,
|
Arena* arena,
|
||||||
const InternalKeyComparator* = nullptr,
|
|
||||||
bool skip_filters = false) override;
|
bool skip_filters = false) override;
|
||||||
|
|
||||||
Status Get(const ReadOptions&, const Slice& key, GetContext* get_context,
|
Status Get(const ReadOptions&, const Slice& key, GetContext* get_context,
|
||||||
|
@ -191,7 +191,6 @@ void PlainTableReader::SetupForCompaction() {
|
|||||||
|
|
||||||
InternalIterator* PlainTableReader::NewIterator(const ReadOptions& options,
|
InternalIterator* PlainTableReader::NewIterator(const ReadOptions& options,
|
||||||
Arena* arena,
|
Arena* arena,
|
||||||
const InternalKeyComparator*,
|
|
||||||
bool skip_filters) {
|
bool skip_filters) {
|
||||||
bool use_prefix_seek = !IsTotalOrderMode() && !options.total_order_seek;
|
bool use_prefix_seek = !IsTotalOrderMode() && !options.total_order_seek;
|
||||||
if (arena == nullptr) {
|
if (arena == nullptr) {
|
||||||
|
@ -71,7 +71,7 @@ class PlainTableReader: public TableReader {
|
|||||||
public:
|
public:
|
||||||
static Status Open(const ImmutableCFOptions& ioptions,
|
static Status Open(const ImmutableCFOptions& ioptions,
|
||||||
const EnvOptions& env_options,
|
const EnvOptions& env_options,
|
||||||
const InternalKeyComparator& icomparator,
|
const InternalKeyComparator& internal_comparator,
|
||||||
unique_ptr<RandomAccessFileReader>&& file,
|
unique_ptr<RandomAccessFileReader>&& file,
|
||||||
uint64_t file_size, unique_ptr<TableReader>* table,
|
uint64_t file_size, unique_ptr<TableReader>* table,
|
||||||
const int bloom_bits_per_key, double hash_table_ratio,
|
const int bloom_bits_per_key, double hash_table_ratio,
|
||||||
@ -80,7 +80,6 @@ class PlainTableReader: public TableReader {
|
|||||||
|
|
||||||
InternalIterator* NewIterator(const ReadOptions&,
|
InternalIterator* NewIterator(const ReadOptions&,
|
||||||
Arena* arena = nullptr,
|
Arena* arena = nullptr,
|
||||||
const InternalKeyComparator* = nullptr,
|
|
||||||
bool skip_filters = false) override;
|
bool skip_filters = false) override;
|
||||||
|
|
||||||
void Prepare(const Slice& target) override;
|
void Prepare(const Slice& target) override;
|
||||||
|
@ -40,7 +40,6 @@ class TableReader {
|
|||||||
// option is effective only for block-based table format.
|
// option is effective only for block-based table format.
|
||||||
virtual InternalIterator* NewIterator(const ReadOptions&,
|
virtual InternalIterator* NewIterator(const ReadOptions&,
|
||||||
Arena* arena = nullptr,
|
Arena* arena = nullptr,
|
||||||
const InternalKeyComparator* = nullptr,
|
|
||||||
bool skip_filters = false) = 0;
|
bool skip_filters = false) = 0;
|
||||||
|
|
||||||
virtual InternalIterator* NewRangeTombstoneIterator(
|
virtual InternalIterator* NewRangeTombstoneIterator(
|
||||||
|
Loading…
Reference in New Issue
Block a user