05e8854085
Summary: This diff introduces a new Merge operation into rocksdb. The purpose of this review is mostly getting feedback from the team (everyone please) on the design. Please focus on the four files under include/leveldb/, as they spell the client visible interface change. include/leveldb/db.h include/leveldb/merge_operator.h include/leveldb/options.h include/leveldb/write_batch.h Please go over local/my_test.cc carefully, as it is a concerete use case. Please also review the impelmentation files to see if the straw man implementation makes sense. Note that, the diff does pass all make check and truly supports forward iterator over db and a version of Get that's based on iterator. Future work: - Integration with compaction - A raw Get implementation I am working on a wiki that explains the design and implementation choices, but coding comes just naturally and I think it might be a good idea to share the code earlier. The code is heavily commented. Test Plan: run all local tests Reviewers: dhruba, heyongqiang Reviewed By: dhruba CC: leveldb, zshao, sheki, emayanke, MarkCallaghan Differential Revision: https://reviews.facebook.net/D9651
28 lines
833 B
C++
28 lines
833 B
C++
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
|
|
// 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.
|
|
|
|
#ifndef STORAGE_LEVELDB_DB_DB_ITER_H_
|
|
#define STORAGE_LEVELDB_DB_DB_ITER_H_
|
|
|
|
#include <stdint.h>
|
|
#include "leveldb/db.h"
|
|
#include "db/dbformat.h"
|
|
|
|
namespace leveldb {
|
|
|
|
// Return a new iterator that converts internal keys (yielded by
|
|
// "*internal_iter") that were live at the specified "sequence" number
|
|
// into appropriate user keys.
|
|
extern Iterator* NewDBIterator(
|
|
const std::string* dbname,
|
|
Env* env,
|
|
const Options& options,
|
|
const Comparator *user_key_comparator,
|
|
Iterator* internal_iter,
|
|
const SequenceNumber& sequence);
|
|
|
|
} // namespace leveldb
|
|
|
|
#endif // STORAGE_LEVELDB_DB_DB_ITER_H_
|