Migrate names of properties from 'leveldb' prefix to 'rocksdb' prefix.
Summary: Migrate names of properties from 'leveldb' prefix to 'rocksdb' prefix. Test Plan: make check Reviewers: emayanke, haobo Reviewed By: haobo CC: leveldb Differential Revision: https://reviews.facebook.net/D13311
This commit is contained in:
parent
bf89edf78b
commit
4463b11cad
@ -20,7 +20,7 @@ if [ "$?" = 0 ]; then
|
|||||||
BEGIN {
|
BEGIN {
|
||||||
print "#include \"build_version.h\"\n"
|
print "#include \"build_version.h\"\n"
|
||||||
}
|
}
|
||||||
{ print "const char* leveldb_build_git_sha = \"leveldb_build_git_sha:" $0"\";" }
|
{ print "const char* rocksdb_build_git_sha = \"rocksdb_build_git_sha:" $0"\";" }
|
||||||
' > ${VFILE}
|
' > ${VFILE}
|
||||||
else
|
else
|
||||||
echo "git not found" |
|
echo "git not found" |
|
||||||
@ -28,13 +28,13 @@ else
|
|||||||
BEGIN {
|
BEGIN {
|
||||||
print "#include \"build_version.h\""
|
print "#include \"build_version.h\""
|
||||||
}
|
}
|
||||||
{ print "const char* leveldb_build_git_sha = \"leveldb_build_git_sha:git not found\";" }
|
{ print "const char* rocksdb_build_git_sha = \"rocksdb_build_git_sha:git not found\";" }
|
||||||
' > ${VFILE}
|
' > ${VFILE}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "const char* leveldb_build_git_datetime = \"leveldb_build_git_datetime:$(date)\";" >> ${VFILE}
|
echo "const char* rocksdb_build_git_datetime = \"rocksdb_build_git_datetime:$(date)\";" >> ${VFILE}
|
||||||
echo "const char* leveldb_build_compile_date = __DATE__;" >> ${VFILE}
|
echo "const char* rocksdb_build_compile_date = __DATE__;" >> ${VFILE}
|
||||||
echo "const char* leveldb_build_compile_time = __TIME__;" >> ${VFILE}
|
echo "const char* rocksdb_build_compile_time = __TIME__;" >> ${VFILE}
|
||||||
|
|
||||||
OUTFILE=$ROCKSDB_ROOT/util/build_version.cc
|
OUTFILE=$ROCKSDB_ROOT/util/build_version.cc
|
||||||
if [ ! -e $OUTFILE ] || ! cmp -s $VFILE $OUTFILE; then
|
if [ ! -e $OUTFILE ] || ! cmp -s $VFILE $OUTFILE; then
|
||||||
|
@ -1,86 +0,0 @@
|
|||||||
#!/bin/bash -e
|
|
||||||
function print_usage {
|
|
||||||
echo "Usage: $0 [build | release | bump_version version ]"
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_env {
|
|
||||||
if [ -z $LEVELDB_HOME ] ; then
|
|
||||||
echo "Expect LEVELDB_HOME to be SET"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [ -z $JAVA_HOME ] ; then
|
|
||||||
export JAVA_HOME=/usr/local/jdk-6u14-64/
|
|
||||||
echo "JAVA_HOME not set. Assuming JAVA_HOME=$JAVA_HOME"
|
|
||||||
fi
|
|
||||||
if [ -z $LEVELDBJNI_HOME ] ; then
|
|
||||||
export LEVELDBJNI_HOME=$LEVELDB_HOME/java/leveldbjni/
|
|
||||||
echo "LEVELDBJNI_HOME not set. Assuming LEVELDBJNI_HOME=$LEVELDBJNI_HOME"
|
|
||||||
fi
|
|
||||||
if [ -z $SNAPPY_HOME ] ; then
|
|
||||||
export SNAPPY_HOME="/home/dhruba/snappy-1.0.5"
|
|
||||||
echo "SNAPPY_HOME not set. Assuming SNAPPY_HOME=$SNAPPY_HOME"
|
|
||||||
fi
|
|
||||||
if [ -z $LEVELDB_PATCH ] ; then
|
|
||||||
LEVELDB_PATCH=$LEVELDB_HOME/java/leveldbjni/db.h.patch
|
|
||||||
echo "LEVELDB_PATCH not set. Assuming LEVELDB_PATCH=$LEVELDB_PATCH"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function build {
|
|
||||||
cd $LEVELDB_HOME
|
|
||||||
git apply $LEVELDB_PATCH
|
|
||||||
make clean libleveldb.a
|
|
||||||
cd $LEVELDB_HOME/java/leveldb/leveldb-api
|
|
||||||
mvn clean package
|
|
||||||
cd $LEVELDBJNI_HOME
|
|
||||||
mvn clean install -P linux64
|
|
||||||
cd $LEVELDB_HOME
|
|
||||||
git checkout $LEVELDB_HOME/include/leveldb/db.h
|
|
||||||
}
|
|
||||||
|
|
||||||
function release {
|
|
||||||
cd $LEVELDB_HOME
|
|
||||||
git apply $LEVELDB_PATCH
|
|
||||||
make clean libleveldb.a
|
|
||||||
cd $LEVELDB_HOME/java/leveldb/leveldb-api
|
|
||||||
mvn clean package
|
|
||||||
cd $LEVELDBJNI_HOME
|
|
||||||
mvn deploy -P linux64 -DskipTests
|
|
||||||
cd $LEVELDB_HOME
|
|
||||||
git checkout $LEVELDB_HOME/include/leveldb/db.h
|
|
||||||
}
|
|
||||||
|
|
||||||
CMD=$1
|
|
||||||
if [ -z $CMD ]; then
|
|
||||||
print_usage
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "$CMD" in
|
|
||||||
build)
|
|
||||||
check_env
|
|
||||||
build
|
|
||||||
;;
|
|
||||||
bump_version)
|
|
||||||
if [ -z $2 ] ; then
|
|
||||||
echo "bump_version requires a version.no parameter at the end"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
check_env
|
|
||||||
VERSION=$2
|
|
||||||
pushd $LEVELDBJNI_HOME
|
|
||||||
mvn versions:set -DnewVersion="$VERSION"
|
|
||||||
popd
|
|
||||||
echo "VERSION SET TO $VERSION"
|
|
||||||
;;
|
|
||||||
release)
|
|
||||||
check_env
|
|
||||||
pushd $LEVELDBJNI_HOME
|
|
||||||
release
|
|
||||||
popd
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
print_usage
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -1,10 +1,7 @@
|
|||||||
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
|
// Copyright (c) 2011 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.
|
||||||
|
#pragma once
|
||||||
#ifndef STORAGE_LEVELDB_DB_BUILDER_H_
|
|
||||||
#define STORAGE_LEVELDB_DB_BUILDER_H_
|
|
||||||
|
|
||||||
#include "rocksdb/comparator.h"
|
#include "rocksdb/comparator.h"
|
||||||
#include "rocksdb/status.h"
|
#include "rocksdb/status.h"
|
||||||
#include "rocksdb/types.h"
|
#include "rocksdb/types.h"
|
||||||
@ -37,5 +34,3 @@ extern Status BuildTable(const std::string& dbname,
|
|||||||
const SequenceNumber earliest_seqno_in_memtable);
|
const SequenceNumber earliest_seqno_in_memtable);
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_BUILDER_H_
|
|
||||||
|
@ -296,7 +296,7 @@ int main(int argc, char** argv) {
|
|||||||
{
|
{
|
||||||
char* prop = leveldb_property_value(db, "nosuchprop");
|
char* prop = leveldb_property_value(db, "nosuchprop");
|
||||||
CheckCondition(prop == NULL);
|
CheckCondition(prop == NULL);
|
||||||
prop = leveldb_property_value(db, "leveldb.stats");
|
prop = leveldb_property_value(db, "rocksdb.stats");
|
||||||
CheckCondition(prop != NULL);
|
CheckCondition(prop != NULL);
|
||||||
Free(&prop);
|
Free(&prop);
|
||||||
}
|
}
|
||||||
|
@ -298,7 +298,7 @@ TEST(CorruptionTest, CompactionInputError) {
|
|||||||
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
|
DBImpl* dbi = reinterpret_cast<DBImpl*>(db_);
|
||||||
dbi->TEST_CompactMemTable();
|
dbi->TEST_CompactMemTable();
|
||||||
const int last = dbi->MaxMemCompactionLevel();
|
const int last = dbi->MaxMemCompactionLevel();
|
||||||
ASSERT_EQ(1, Property("leveldb.num-files-at-level" + NumberToString(last)));
|
ASSERT_EQ(1, Property("rocksdb.num-files-at-level" + NumberToString(last)));
|
||||||
|
|
||||||
Corrupt(kTableFile, 100, 1);
|
Corrupt(kTableFile, 100, 1);
|
||||||
Check(9, 9);
|
Check(9, 9);
|
||||||
@ -324,7 +324,7 @@ TEST(CorruptionTest, CompactionInputErrorParanoid) {
|
|||||||
|
|
||||||
Build(10);
|
Build(10);
|
||||||
dbi->TEST_CompactMemTable();
|
dbi->TEST_CompactMemTable();
|
||||||
ASSERT_EQ(1, Property("leveldb.num-files-at-level0"));
|
ASSERT_EQ(1, Property("rocksdb.num-files-at-level0"));
|
||||||
|
|
||||||
Corrupt(kTableFile, 100, 1);
|
Corrupt(kTableFile, 100, 1);
|
||||||
Check(9, 9);
|
Check(9, 9);
|
||||||
|
@ -546,7 +546,7 @@ class Stats {
|
|||||||
|
|
||||||
if (FLAGS_stats_per_interval) {
|
if (FLAGS_stats_per_interval) {
|
||||||
std::string stats;
|
std::string stats;
|
||||||
if (db && db->GetProperty("leveldb.stats", &stats))
|
if (db && db->GetProperty("rocksdb.stats", &stats))
|
||||||
fprintf(stderr, "%s\n", stats.c_str());
|
fprintf(stderr, "%s\n", stats.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -985,11 +985,11 @@ class Benchmark {
|
|||||||
} else if (name == Slice("heapprofile")) {
|
} else if (name == Slice("heapprofile")) {
|
||||||
HeapProfile();
|
HeapProfile();
|
||||||
} else if (name == Slice("stats")) {
|
} else if (name == Slice("stats")) {
|
||||||
PrintStats("leveldb.stats");
|
PrintStats("rocksdb.stats");
|
||||||
} else if (name == Slice("levelstats")) {
|
} else if (name == Slice("levelstats")) {
|
||||||
PrintStats("leveldb.levelstats");
|
PrintStats("rocksdb.levelstats");
|
||||||
} else if (name == Slice("sstables")) {
|
} else if (name == Slice("sstables")) {
|
||||||
PrintStats("leveldb.sstables");
|
PrintStats("rocksdb.sstables");
|
||||||
} else {
|
} else {
|
||||||
if (name != Slice()) { // No error message for empty name
|
if (name != Slice()) { // No error message for empty name
|
||||||
fprintf(stderr, "unknown benchmark '%s'\n", name.ToString().c_str());
|
fprintf(stderr, "unknown benchmark '%s'\n", name.ToString().c_str());
|
||||||
|
@ -382,7 +382,7 @@ void DBImpl::MaybeDumpStats() {
|
|||||||
// period in rare cases.
|
// period in rare cases.
|
||||||
last_stats_dump_time_microsec_ = now_micros;
|
last_stats_dump_time_microsec_ = now_micros;
|
||||||
std::string stats;
|
std::string stats;
|
||||||
GetProperty("leveldb.stats", &stats);
|
GetProperty("rocksdb.stats", &stats);
|
||||||
Log(options_.info_log, "%s", stats.c_str());
|
Log(options_.info_log, "%s", stats.c_str());
|
||||||
PrintStatistics();
|
PrintStatistics();
|
||||||
}
|
}
|
||||||
@ -630,7 +630,7 @@ Status DBImpl::Recover(VersionEdit* edit, MemTable* external_table,
|
|||||||
//
|
//
|
||||||
// Note that PrevLogNumber() is no longer used, but we pay
|
// Note that PrevLogNumber() is no longer used, but we pay
|
||||||
// attention to it in case we are recovering a database
|
// attention to it in case we are recovering a database
|
||||||
// produced by an older version of leveldb.
|
// produced by an older version of rocksdb.
|
||||||
const uint64_t min_log = versions_->LogNumber();
|
const uint64_t min_log = versions_->LogNumber();
|
||||||
const uint64_t prev_log = versions_->PrevLogNumber();
|
const uint64_t prev_log = versions_->PrevLogNumber();
|
||||||
std::vector<std::string> filenames;
|
std::vector<std::string> filenames;
|
||||||
@ -2846,7 +2846,7 @@ bool DBImpl::GetProperty(const Slice& property, std::string* value) {
|
|||||||
|
|
||||||
MutexLock l(&mutex_);
|
MutexLock l(&mutex_);
|
||||||
Slice in = property;
|
Slice in = property;
|
||||||
Slice prefix("leveldb.");
|
Slice prefix("rocksdb.");
|
||||||
if (!in.starts_with(prefix)) return false;
|
if (!in.starts_with(prefix)) return false;
|
||||||
in.remove_prefix(prefix.size());
|
in.remove_prefix(prefix.size());
|
||||||
|
|
||||||
@ -3288,9 +3288,9 @@ Status DestroyDB(const std::string& dbname, const Options& options) {
|
|||||||
//
|
//
|
||||||
// A global method that can dump out the build version
|
// A global method that can dump out the build version
|
||||||
void dumpLeveldbBuildVersion(Logger * log) {
|
void dumpLeveldbBuildVersion(Logger * log) {
|
||||||
Log(log, "Git sha %s", leveldb_build_git_sha);
|
Log(log, "Git sha %s", rocksdb_build_git_sha);
|
||||||
Log(log, "Compile time %s %s",
|
Log(log, "Compile time %s %s",
|
||||||
leveldb_build_compile_time, leveldb_build_compile_date);
|
rocksdb_build_compile_time, rocksdb_build_compile_date);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
|
// Copyright (c) 2011 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.
|
||||||
|
#pragma once
|
||||||
#ifndef STORAGE_LEVELDB_DB_DB_IMPL_H_
|
|
||||||
#define STORAGE_LEVELDB_DB_DB_IMPL_H_
|
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <set>
|
#include <set>
|
||||||
@ -236,7 +233,7 @@ class DBImpl : public DB {
|
|||||||
|
|
||||||
void PrintStatistics();
|
void PrintStatistics();
|
||||||
|
|
||||||
// dump leveldb.stats to LOG
|
// dump rocksdb.stats to LOG
|
||||||
void MaybeDumpStats();
|
void MaybeDumpStats();
|
||||||
|
|
||||||
// Return the minimum empty level that could hold the total data in the
|
// Return the minimum empty level that could hold the total data in the
|
||||||
@ -441,5 +438,3 @@ extern Options SanitizeOptions(const std::string& db,
|
|||||||
const Options& src);
|
const Options& src);
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_DB_IMPL_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_DB_IMPL_READONLY_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_DB_IMPL_READONLY_H_
|
|
||||||
|
|
||||||
#include "db/db_impl.h"
|
#include "db/db_impl.h"
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
@ -73,5 +71,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_DB_ITER_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_DB_ITER_H_
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "rocksdb/db.h"
|
#include "rocksdb/db.h"
|
||||||
#include "db/dbformat.h"
|
#include "db/dbformat.h"
|
||||||
@ -23,5 +21,3 @@ extern Iterator* NewDBIterator(
|
|||||||
const SequenceNumber& sequence);
|
const SequenceNumber& sequence);
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_DB_ITER_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef LEVELDB_STORAGE_DB_DB_STATISTICS_H_
|
#pragma once
|
||||||
#define LEVELDB_STORAGE_DB_DB_STATISTICS_H_
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -60,5 +58,3 @@ std::shared_ptr<Statistics> CreateDBStatistics() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // LEVELDB_STORAGE_DB_DB_STATISTICS_H_
|
|
||||||
|
@ -489,7 +489,7 @@ class DBTest {
|
|||||||
int NumTableFilesAtLevel(int level) {
|
int NumTableFilesAtLevel(int level) {
|
||||||
std::string property;
|
std::string property;
|
||||||
ASSERT_TRUE(
|
ASSERT_TRUE(
|
||||||
db_->GetProperty("leveldb.num-files-at-level" + NumberToString(level),
|
db_->GetProperty("rocksdb.num-files-at-level" + NumberToString(level),
|
||||||
&property));
|
&property));
|
||||||
return atoi(property.c_str());
|
return atoi(property.c_str());
|
||||||
}
|
}
|
||||||
@ -574,7 +574,7 @@ class DBTest {
|
|||||||
|
|
||||||
std::string DumpSSTableList() {
|
std::string DumpSSTableList() {
|
||||||
std::string property;
|
std::string property;
|
||||||
db_->GetProperty("leveldb.sstables", &property);
|
db_->GetProperty("rocksdb.sstables", &property);
|
||||||
return property;
|
return property;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2802,7 +2802,7 @@ TEST(DBTest, L0_CompactionBug_Issue44_b) {
|
|||||||
TEST(DBTest, ComparatorCheck) {
|
TEST(DBTest, ComparatorCheck) {
|
||||||
class NewComparator : public Comparator {
|
class NewComparator : public Comparator {
|
||||||
public:
|
public:
|
||||||
virtual const char* Name() const { return "leveldb.NewComparator"; }
|
virtual const char* Name() const { return "rocksdb.NewComparator"; }
|
||||||
virtual int Compare(const Slice& a, const Slice& b) const {
|
virtual int Compare(const Slice& a, const Slice& b) const {
|
||||||
return BytewiseComparator()->Compare(a, b);
|
return BytewiseComparator()->Compare(a, b);
|
||||||
}
|
}
|
||||||
@ -4283,7 +4283,7 @@ std::string MakeKey(unsigned int num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BM_LogAndApply(int iters, int num_base_files) {
|
void BM_LogAndApply(int iters, int num_base_files) {
|
||||||
std::string dbname = test::TmpDir() + "/leveldb_test_benchmark";
|
std::string dbname = test::TmpDir() + "/rocksdb_test_benchmark";
|
||||||
DestroyDB(dbname, Options());
|
DestroyDB(dbname, Options());
|
||||||
|
|
||||||
DB* db = nullptr;
|
DB* db = nullptr;
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_FORMAT_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_FORMAT_H_
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "rocksdb/comparator.h"
|
#include "rocksdb/comparator.h"
|
||||||
#include "rocksdb/db.h"
|
#include "rocksdb/db.h"
|
||||||
@ -90,7 +88,7 @@ class InternalKeyComparator : public Comparator {
|
|||||||
std::string name_;
|
std::string name_;
|
||||||
public:
|
public:
|
||||||
explicit InternalKeyComparator(const Comparator* c) : user_comparator_(c),
|
explicit InternalKeyComparator(const Comparator* c) : user_comparator_(c),
|
||||||
name_("leveldb.InternalKeyComparator:" +
|
name_("rocksdb.InternalKeyComparator:" +
|
||||||
std::string(user_comparator_->Name())) {
|
std::string(user_comparator_->Name())) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,5 +222,3 @@ inline LookupKey::~LookupKey() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_FORMAT_H_
|
|
||||||
|
@ -4,9 +4,7 @@
|
|||||||
//
|
//
|
||||||
// File names used by DB code
|
// File names used by DB code
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_FILENAME_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_FILENAME_H_
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "rocksdb/slice.h"
|
#include "rocksdb/slice.h"
|
||||||
@ -79,7 +77,7 @@ extern std::string OldInfoLogFileName(const std::string& dbname, uint64_t ts,
|
|||||||
extern std::string MetaDatabaseName(const std::string& dbname,
|
extern std::string MetaDatabaseName(const std::string& dbname,
|
||||||
uint64_t number);
|
uint64_t number);
|
||||||
|
|
||||||
// If filename is a leveldb file, store the type of the file in *type.
|
// If filename is a rocksdb file, store the type of the file in *type.
|
||||||
// The number encoded in the filename is stored in *number. If the
|
// The number encoded in the filename is stored in *number. If the
|
||||||
// filename was successfully parsed, returns true. Else return false.
|
// filename was successfully parsed, returns true. Else return false.
|
||||||
extern bool ParseFileName(const std::string& filename,
|
extern bool ParseFileName(const std::string& filename,
|
||||||
@ -93,5 +91,3 @@ extern Status SetCurrentFile(Env* env, const std::string& dbname,
|
|||||||
|
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_FILENAME_H_
|
|
||||||
|
@ -5,9 +5,7 @@
|
|||||||
// Log format information shared by reader and writer.
|
// Log format information shared by reader and writer.
|
||||||
// See ../doc/log_format.txt for more detail.
|
// See ../doc/log_format.txt for more detail.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_LOG_FORMAT_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_LOG_FORMAT_H_
|
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
namespace log {
|
namespace log {
|
||||||
|
|
||||||
@ -31,5 +29,3 @@ static const int kHeaderSize = 4 + 1 + 2;
|
|||||||
|
|
||||||
} // namespace log
|
} // namespace log
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_LOG_FORMAT_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_LOG_READER_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_LOG_READER_H_
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@ -119,5 +117,3 @@ class Reader {
|
|||||||
|
|
||||||
} // namespace log
|
} // namespace log
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_LOG_READER_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_LOG_WRITER_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_LOG_WRITER_H_
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "db/log_format.h"
|
#include "db/log_format.h"
|
||||||
@ -50,5 +48,3 @@ class Writer {
|
|||||||
|
|
||||||
} // namespace log
|
} // namespace log
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_LOG_WRITER_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_MEMTABLE_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_MEMTABLE_H_
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
@ -147,5 +145,3 @@ class MemTable {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_MEMTABLE_H_
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) 2012 Facebook.
|
// Copyright (c) 2012 Facebook.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_MEMTABLELIST_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_MEMTABLELIST_H_
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
@ -100,5 +98,3 @@ class MemTableList {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_MEMTABLELIST_H_
|
|
||||||
|
@ -85,7 +85,7 @@ class Counters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// mapped to a leveldb Delete
|
// mapped to a rocksdb Delete
|
||||||
bool remove(const string& key) {
|
bool remove(const string& key) {
|
||||||
auto s = db_->Delete(delete_option_, key);
|
auto s = db_->Delete(delete_option_, key);
|
||||||
|
|
||||||
@ -97,7 +97,7 @@ class Counters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// mapped to a leveldb Get
|
// mapped to a rocksdb Get
|
||||||
bool get(const string& key, uint64_t *value) {
|
bool get(const string& key, uint64_t *value) {
|
||||||
string str;
|
string str;
|
||||||
auto s = db_->Get(get_option_, key, &str);
|
auto s = db_->Get(get_option_, key, &str);
|
||||||
@ -159,7 +159,7 @@ class MergeBasedCounters : public Counters {
|
|||||||
merge_option_() {
|
merge_option_() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// mapped to a leveldb Merge operation
|
// mapped to a rocksdb Merge operation
|
||||||
virtual bool add(const string& key, uint64_t value) override {
|
virtual bool add(const string& key, uint64_t value) override {
|
||||||
char encoded[sizeof(uint64_t)];
|
char encoded[sizeof(uint64_t)];
|
||||||
EncodeFixed64(encoded, value);
|
EncodeFixed64(encoded, value);
|
||||||
|
@ -224,7 +224,7 @@ TEST(PerfContextTest, KeyComparisonCount) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// make perf_context_test
|
// make perf_context_test
|
||||||
// export LEVELDB_TESTS=PerfContextTest.SeekKeyComparison
|
// export ROCKSDB_TESTS=PerfContextTest.SeekKeyComparison
|
||||||
// For one memtable:
|
// For one memtable:
|
||||||
// ./perf_context_test --write_buffer_size=500000 --total_keys=10000
|
// ./perf_context_test --write_buffer_size=500000 --total_keys=10000
|
||||||
// For two memtables:
|
// For two memtables:
|
||||||
|
@ -9,9 +9,7 @@
|
|||||||
// underlying iterator would if there happened to be no non-matching
|
// underlying iterator would if there happened to be no non-matching
|
||||||
// keys in the dataset.
|
// keys in the dataset.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_PREFIX_FILTER_ITERATOR_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_PREFIX_FILTER_ITERATOR_H_
|
|
||||||
|
|
||||||
#include "rocksdb/iterator.h"
|
#include "rocksdb/iterator.h"
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
@ -72,5 +70,3 @@ class PrefixFilterIterator : public Iterator {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -74,7 +74,7 @@ class Repairer {
|
|||||||
bytes += tables_[i].meta.file_size;
|
bytes += tables_[i].meta.file_size;
|
||||||
}
|
}
|
||||||
Log(options_.info_log,
|
Log(options_.info_log,
|
||||||
"**** Repaired leveldb %s; "
|
"**** Repaired rocksdb %s; "
|
||||||
"recovered %d files; %llu bytes. "
|
"recovered %d files; %llu bytes. "
|
||||||
"Some data may have been lost. "
|
"Some data may have been lost. "
|
||||||
"****",
|
"****",
|
||||||
|
@ -25,9 +25,7 @@
|
|||||||
// ... prev vs. next pointer ordering ...
|
// ... prev vs. next pointer ordering ...
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_SKIPLIST_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_SKIPLIST_H_
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "port/port.h"
|
#include "port/port.h"
|
||||||
@ -401,5 +399,3 @@ bool SkipList<Key,Comparator>::Contains(const Key& key) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_SKIPLIST_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_SNAPSHOT_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_SNAPSHOT_H_
|
|
||||||
|
|
||||||
#include "rocksdb/db.h"
|
#include "rocksdb/db.h"
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
@ -81,5 +79,3 @@ class SnapshotList {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_SNAPSHOT_H_
|
|
||||||
|
@ -4,9 +4,7 @@
|
|||||||
//
|
//
|
||||||
// Thread-safe (provides internal synchronization)
|
// Thread-safe (provides internal synchronization)
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_TABLE_CACHE_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_TABLE_CACHE_H_
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "db/dbformat.h"
|
#include "db/dbformat.h"
|
||||||
@ -73,5 +71,3 @@ class TableCache {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_TABLE_CACHE_H_
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
// Copyright 2008-present Facebook. All Rights Reserved.
|
// Copyright 2008-present Facebook. All Rights Reserved.
|
||||||
#ifndef STORAGE_LEVELDB_INCLUDE_WRITES_ITERATOR_IMPL_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_INCLUDE_WRITES_ITERATOR_IMPL_H_
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "rocksdb/env.h"
|
#include "rocksdb/env.h"
|
||||||
@ -96,8 +94,4 @@ class TransactionLogIteratorImpl : public TransactionLogIterator {
|
|||||||
void UpdateCurrentWriteBatch(const Slice& record);
|
void UpdateCurrentWriteBatch(const Slice& record);
|
||||||
Status OpenLogReader(const LogFile* file);
|
Status OpenLogReader(const LogFile* file);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_WRITES_ITERATOR_IMPL_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_VERSION_EDIT_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_VERSION_EDIT_H_
|
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -123,5 +121,3 @@ class VersionEdit {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_VERSION_EDIT_H_
|
|
||||||
|
@ -12,9 +12,7 @@
|
|||||||
// Version,VersionSet are thread-compatible, but require external
|
// Version,VersionSet are thread-compatible, but require external
|
||||||
// synchronization on all accesses.
|
// synchronization on all accesses.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_VERSION_SET_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_VERSION_SET_H_
|
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <set>
|
#include <set>
|
||||||
@ -628,5 +626,3 @@ class Compaction {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_VERSION_SET_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_
|
|
||||||
|
|
||||||
#include "rocksdb/types.h"
|
#include "rocksdb/types.h"
|
||||||
#include "rocksdb/write_batch.h"
|
#include "rocksdb/write_batch.h"
|
||||||
#include "rocksdb/db.h"
|
#include "rocksdb/db.h"
|
||||||
@ -52,6 +50,3 @@ class WriteBatchInternal {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
This directory contains the hdfs extensions needed to make leveldb store
|
This directory contains the hdfs extensions needed to make rocksdb store
|
||||||
files in HDFS.
|
files in HDFS.
|
||||||
|
|
||||||
The hdfs.h file is copied from the Apache Hadoop 1.0 source code.
|
The hdfs.h file is copied from the Apache Hadoop 1.0 source code.
|
||||||
@ -7,12 +7,12 @@ It defines the libhdfs library
|
|||||||
data in HDFS. The libhdfs.a is copied from the Apache Hadoop 1.0 build.
|
data in HDFS. The libhdfs.a is copied from the Apache Hadoop 1.0 build.
|
||||||
It implements the API defined in hdfs.h. If your hadoop cluster is running
|
It implements the API defined in hdfs.h. If your hadoop cluster is running
|
||||||
a different hadoop release, then install these two files manually from your
|
a different hadoop release, then install these two files manually from your
|
||||||
hadoop distribution and then recompile leveldb.
|
hadoop distribution and then recompile rocksdb.
|
||||||
|
|
||||||
The env_hdfs.h file defines the leveldb objects that are needed to talk to an
|
The env_hdfs.h file defines the rocksdb objects that are needed to talk to an
|
||||||
underlying filesystem.
|
underlying filesystem.
|
||||||
|
|
||||||
If you want to compile leveldb with hdfs support, please set the following
|
If you want to compile rocksdb with hdfs support, please set the following
|
||||||
enviroment variables appropriately:
|
enviroment variables appropriately:
|
||||||
USE_HDFS=1
|
USE_HDFS=1
|
||||||
JAVA_HOME=/usr/local/jdk-6u22-64
|
JAVA_HOME=/usr/local/jdk-6u22-64
|
||||||
|
@ -17,9 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
// Copyright (c) 2012 Facebook. All rights reserved.
|
// Copyright (c) 2012 Facebook. All rights reserved.
|
||||||
|
|
||||||
#ifndef LEVELDB_HDFS_FILE_H
|
#pragma once
|
||||||
#define LEVELDB_HDFS_FILE_H
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@ -55,7 +53,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// The HDFS environment for leveldb. This class overrides all the
|
// The HDFS environment for rocksdb. This class overrides all the
|
||||||
// file/dir access methods and delegates the thread-mgmt methods to the
|
// file/dir access methods and delegates the thread-mgmt methods to the
|
||||||
// default posix environment.
|
// default posix environment.
|
||||||
//
|
//
|
||||||
@ -227,7 +225,7 @@ class HdfsEnv : public Env {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
HdfsEnv(const std::string& fsname) {
|
HdfsEnv(const std::string& fsname) {
|
||||||
fprintf(stderr, "You have not build leveldb with HDFS support\n");
|
fprintf(stderr, "You have not build rocksdb with HDFS support\n");
|
||||||
fprintf(stderr, "Please see hdfs/README for details\n");
|
fprintf(stderr, "Please see hdfs/README for details\n");
|
||||||
throw new std::exception();
|
throw new std::exception();
|
||||||
}
|
}
|
||||||
@ -305,5 +303,3 @@ class HdfsEnv : public Env {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // USE_HDFS
|
#endif // USE_HDFS
|
||||||
|
|
||||||
#endif // LEVELDB_HDFS_FILE_H
|
|
||||||
|
@ -13,7 +13,7 @@ class Slice;
|
|||||||
|
|
||||||
// A Comparator object provides a total order across slices that are
|
// A Comparator object provides a total order across slices that are
|
||||||
// used as keys in an sstable or a database. A Comparator implementation
|
// used as keys in an sstable or a database. A Comparator implementation
|
||||||
// must be thread-safe since leveldb may invoke its methods concurrently
|
// must be thread-safe since rocksdb may invoke its methods concurrently
|
||||||
// from multiple threads.
|
// from multiple threads.
|
||||||
class Comparator {
|
class Comparator {
|
||||||
public:
|
public:
|
||||||
@ -33,7 +33,7 @@ class Comparator {
|
|||||||
// the comparator implementation changes in a way that will cause
|
// the comparator implementation changes in a way that will cause
|
||||||
// the relative ordering of any two keys to change.
|
// the relative ordering of any two keys to change.
|
||||||
//
|
//
|
||||||
// Names starting with "leveldb." are reserved and should not be used
|
// Names starting with "rocksdb." are reserved and should not be used
|
||||||
// by any clients of this package.
|
// by any clients of this package.
|
||||||
virtual const char* Name() const = 0;
|
virtual const char* Name() const = 0;
|
||||||
|
|
||||||
|
@ -175,11 +175,11 @@ class DB {
|
|||||||
//
|
//
|
||||||
// Valid property names include:
|
// Valid property names include:
|
||||||
//
|
//
|
||||||
// "leveldb.num-files-at-level<N>" - return the number of files at level <N>,
|
// "rocksdb.num-files-at-level<N>" - return the number of files at level <N>,
|
||||||
// where <N> is an ASCII representation of a level number (e.g. "0").
|
// where <N> is an ASCII representation of a level number (e.g. "0").
|
||||||
// "leveldb.stats" - returns a multi-line string that describes statistics
|
// "rocksdb.stats" - returns a multi-line string that describes statistics
|
||||||
// about the internal operation of the DB.
|
// about the internal operation of the DB.
|
||||||
// "leveldb.sstables" - returns a multi-line string that describes all
|
// "rocksdb.sstables" - returns a multi-line string that describes all
|
||||||
// of the sstables that make up the db contents.
|
// of the sstables that make up the db contents.
|
||||||
virtual bool GetProperty(const Slice& property, std::string* value) = 0;
|
virtual bool GetProperty(const Slice& property, std::string* value) = 0;
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// 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.
|
||||||
//
|
//
|
||||||
// An Env is an interface used by the leveldb implementation to access
|
// An Env is an interface used by the rocksdb implementation to access
|
||||||
// operating system functionality like the filesystem etc. Callers
|
// operating system functionality like the filesystem etc. Callers
|
||||||
// may wish to provide a custom Env object when opening a database to
|
// may wish to provide a custom Env object when opening a database to
|
||||||
// get fine gain control; e.g., to rate limit file system operations.
|
// get fine gain control; e.g., to rate limit file system operations.
|
||||||
@ -72,7 +72,7 @@ class Env {
|
|||||||
// system. Sophisticated users may wish to provide their own Env
|
// system. Sophisticated users may wish to provide their own Env
|
||||||
// implementation instead of relying on this default environment.
|
// implementation instead of relying on this default environment.
|
||||||
//
|
//
|
||||||
// The result of Default() belongs to leveldb and must never be deleted.
|
// The result of Default() belongs to rocksdb and must never be deleted.
|
||||||
static Env* Default();
|
static Env* Default();
|
||||||
|
|
||||||
// Create a brand new sequentially-readable file with the specified name.
|
// Create a brand new sequentially-readable file with the specified name.
|
||||||
|
@ -4,8 +4,8 @@
|
|||||||
//
|
//
|
||||||
// A database can be configured with a custom FilterPolicy object.
|
// A database can be configured with a custom FilterPolicy object.
|
||||||
// This object is responsible for creating a small filter from a set
|
// This object is responsible for creating a small filter from a set
|
||||||
// of keys. These filters are stored in leveldb and are consulted
|
// of keys. These filters are stored in rocksdb and are consulted
|
||||||
// automatically by leveldb to decide whether or not to read some
|
// automatically by rocksdb to decide whether or not to read some
|
||||||
// information from disk. In many cases, a filter can cut down the
|
// information from disk. In many cases, a filter can cut down the
|
||||||
// number of disk seeks form a handful to a single disk seek per
|
// number of disk seeks form a handful to a single disk seek per
|
||||||
// DB::Get() call.
|
// DB::Get() call.
|
||||||
|
@ -10,9 +10,6 @@ class LDBTool {
|
|||||||
void Run(int argc, char** argv, Options = Options());
|
void Run(int argc, char** argv, Options = Options());
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace leveldb = rocksdb;
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#include "rocksdb/rocksdb_to_leveldb.h"
|
#include "rocksdb/rocksdb_to_leveldb.h"
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
// The liberal use of assertions is encouraged to enforce (1).
|
// The liberal use of assertions is encouraged to enforce (1).
|
||||||
//
|
//
|
||||||
// The factory will be passed an Arena object when a new MemTableRep is
|
// The factory will be passed an Arena object when a new MemTableRep is
|
||||||
// requested. The API for this object is in leveldb/arena.h.
|
// requested. The API for this object is in rocksdb/arena.h.
|
||||||
//
|
//
|
||||||
// Users can implement their own memtable representations. We include four
|
// Users can implement their own memtable representations. We include four
|
||||||
// types built in:
|
// types built in:
|
||||||
@ -177,7 +177,7 @@ public:
|
|||||||
|
|
||||||
// TransformReps are backed by an unordered map of buffers to buckets. When
|
// TransformReps are backed by an unordered map of buffers to buckets. When
|
||||||
// looking up a key, the user key is extracted and a user-supplied transform
|
// looking up a key, the user key is extracted and a user-supplied transform
|
||||||
// function (see leveldb/slice_transform.h) is applied to get the key into the
|
// function (see rocksdb/slice_transform.h) is applied to get the key into the
|
||||||
// unordered map. This allows the user to bin user keys based on arbitrary
|
// unordered map. This allows the user to bin user keys based on arbitrary
|
||||||
// criteria. Two example implementations are UnsortedRepFactory and
|
// criteria. Two example implementations are UnsortedRepFactory and
|
||||||
// PrefixHashRepFactory.
|
// PrefixHashRepFactory.
|
||||||
|
@ -165,7 +165,7 @@ struct Options {
|
|||||||
// a block is the unit of reading from disk).
|
// a block is the unit of reading from disk).
|
||||||
|
|
||||||
// If non-NULL use the specified cache for blocks.
|
// If non-NULL use the specified cache for blocks.
|
||||||
// If NULL, leveldb will automatically create and use an 8MB internal cache.
|
// If NULL, rocksdb will automatically create and use an 8MB internal cache.
|
||||||
// Default: nullptr
|
// Default: nullptr
|
||||||
shared_ptr<Cache> block_cache;
|
shared_ptr<Cache> block_cache;
|
||||||
|
|
||||||
@ -497,7 +497,7 @@ struct Options {
|
|||||||
// Default: false
|
// Default: false
|
||||||
bool skip_log_error_on_recovery;
|
bool skip_log_error_on_recovery;
|
||||||
|
|
||||||
// if not zero, dump leveldb.stats to LOG every stats_dump_period_sec
|
// if not zero, dump rocksdb.stats to LOG every stats_dump_period_sec
|
||||||
// Default: 3600 (1 hour)
|
// Default: 3600 (1 hour)
|
||||||
unsigned int stats_dump_period_sec;
|
unsigned int stats_dump_period_sec;
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ class Slice {
|
|||||||
(memcmp(data_, x.data_, x.size_) == 0));
|
(memcmp(data_, x.data_, x.size_) == 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
// private: make these public for leveldbjni access
|
// private: make these public for rocksdbjni access
|
||||||
const char* data_;
|
const char* data_;
|
||||||
size_t size_;
|
size_t size_;
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ class Histogram {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A dumb ticker which keeps incrementing through its life time.
|
* A dumb ticker which keeps incrementing through its life time.
|
||||||
* Not thread safe. Locking is currently managed by external leveldb lock
|
* Thread safe. Locking managed by implementation of this interface.
|
||||||
*/
|
*/
|
||||||
class Ticker {
|
class Ticker {
|
||||||
public:
|
public:
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef LEVELDB_INCLUDE_UTILITIES_STACKABLE_DB_H_
|
#pragma once
|
||||||
#define LEVELDB_INCLUDE_UTILITIES_STACKABLE_DB_H_
|
|
||||||
|
|
||||||
#include "rocksdb/db.h"
|
#include "rocksdb/db.h"
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
@ -161,5 +159,3 @@ class StackableDB : public DB {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // LEVELDB_INCLUDE_UTILITIES_STACKABLE_DB_H_
|
|
||||||
|
@ -2,14 +2,12 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef LEVELDB_INCLUDE_UTILITIES_UTILITY_DB_H_
|
#pragma once
|
||||||
#define LEVELDB_INCLUDE_UTILITIES_UTILITY_DB_H_
|
|
||||||
|
|
||||||
#include "stackable_db.h"
|
#include "stackable_db.h"
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
|
|
||||||
// This class contains APIs to open leveldb with specific support eg. TTL
|
// This class contains APIs to open rocksdb with specific support eg. TTL
|
||||||
class UtilityDB {
|
class UtilityDB {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -50,5 +48,3 @@ class UtilityDB {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // LEVELDB_INCLUDE_UTILITIES_UTILITY_DB_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_TABLE_BLOCK_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_TABLE_BLOCK_H_
|
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "rocksdb/iterator.h"
|
#include "rocksdb/iterator.h"
|
||||||
@ -42,5 +40,3 @@ class Block {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_BLOCK_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@ -56,5 +54,3 @@ class BlockBuilder {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_
|
|
||||||
|
@ -6,9 +6,7 @@
|
|||||||
// filters (e.g., bloom filters) for all data blocks in the table combined
|
// filters (e.g., bloom filters) for all data blocks in the table combined
|
||||||
// into a single filter block.
|
// into a single filter block.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_TABLE_FILTER_BLOCK_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_TABLE_FILTER_BLOCK_H_
|
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -76,5 +74,3 @@ class FilterBlockReader {
|
|||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_FILTER_BLOCK_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_TABLE_FORMAT_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_TABLE_FORMAT_H_
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "rocksdb/slice.h"
|
#include "rocksdb/slice.h"
|
||||||
@ -105,5 +103,3 @@ inline BlockHandle::BlockHandle()
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_FORMAT_H_
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
// Copyright 2008-present Facebook. All Rights Reserved.
|
// Copyright 2008-present Facebook. All Rights Reserved.
|
||||||
#ifndef STORAGE_LEVELDB_ITER_HEAP_H_
|
|
||||||
#define STORAGE_LEVELDB_ITER_HEAP_H_
|
|
||||||
|
|
||||||
|
#pragma once
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
#include "rocksdb/comparator.h"
|
#include "rocksdb/comparator.h"
|
||||||
@ -59,5 +58,3 @@ MinIterHeap NewMinIterHeap(const Comparator* comparator) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_ITER_HEAP_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_TABLE_ITERATOR_WRAPPER_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_TABLE_ITERATOR_WRAPPER_H_
|
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
|
|
||||||
// A internal wrapper class with an interface similar to Iterator that
|
// A internal wrapper class with an interface similar to Iterator that
|
||||||
@ -59,5 +57,3 @@ class IteratorWrapper {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_ITERATOR_WRAPPER_H_
|
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_TABLE_MERGER_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_TABLE_MERGER_H_
|
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
|
|
||||||
@ -22,5 +21,3 @@ extern Iterator* NewMergingIterator(
|
|||||||
const Comparator* comparator, Iterator** children, int n);
|
const Comparator* comparator, Iterator** children, int n);
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_MERGER_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_INCLUDE_TABLE_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_INCLUDE_TABLE_H_
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "rocksdb/iterator.h"
|
#include "rocksdb/iterator.h"
|
||||||
@ -103,5 +101,3 @@ class Table {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_TABLE_H_
|
|
||||||
|
@ -38,7 +38,7 @@ namespace {
|
|||||||
class ReverseKeyComparator : public Comparator {
|
class ReverseKeyComparator : public Comparator {
|
||||||
public:
|
public:
|
||||||
virtual const char* Name() const {
|
virtual const char* Name() const {
|
||||||
return "leveldb.ReverseBytewiseComparator";
|
return "rocksdb.ReverseBytewiseComparator";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int Compare(const Slice& a, const Slice& b) const {
|
virtual int Compare(const Slice& a, const Slice& b) const {
|
||||||
@ -798,7 +798,7 @@ TEST(Harness, RandomizedLongDB) {
|
|||||||
for (int level = 0; level < db()->NumberLevels(); level++) {
|
for (int level = 0; level < db()->NumberLevels(); level++) {
|
||||||
std::string value;
|
std::string value;
|
||||||
char name[100];
|
char name[100];
|
||||||
snprintf(name, sizeof(name), "leveldb.num-files-at-level%d", level);
|
snprintf(name, sizeof(name), "rocksdb.num-files-at-level%d", level);
|
||||||
ASSERT_TRUE(db()->GetProperty(name, &value));
|
ASSERT_TRUE(db()->GetProperty(name, &value));
|
||||||
files += atoi(value.c_str());
|
files += atoi(value.c_str());
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
|
|
||||||
|
|
||||||
#include "rocksdb/iterator.h"
|
#include "rocksdb/iterator.h"
|
||||||
#include "rocksdb/env.h"
|
#include "rocksdb/env.h"
|
||||||
|
|
||||||
@ -35,5 +33,3 @@ extern Iterator* NewTwoLevelIterator(
|
|||||||
bool for_compaction = false);
|
bool for_compaction = false);
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
|
|
||||||
|
@ -10,7 +10,7 @@ import tempfile
|
|||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
# This python script runs db_stress multiple times. Some runs with
|
# This python script runs db_stress multiple times. Some runs with
|
||||||
# kill_random_test that causes leveldb to crash at various points in code.
|
# kill_random_test that causes rocksdb to crash at various points in code.
|
||||||
|
|
||||||
def main(argv):
|
def main(argv):
|
||||||
try:
|
try:
|
||||||
|
@ -156,7 +156,7 @@ static bool FLAGS_use_fsync = false;
|
|||||||
|
|
||||||
// If non-zero, kill at various points in source code with probability 1/this
|
// If non-zero, kill at various points in source code with probability 1/this
|
||||||
static int FLAGS_kill_random_test = 0;
|
static int FLAGS_kill_random_test = 0;
|
||||||
extern int leveldb_kill_odds;
|
extern int rocksdb_kill_odds;
|
||||||
|
|
||||||
// If true, do not write WAL for write.
|
// If true, do not write WAL for write.
|
||||||
static bool FLAGS_disable_wal = false;
|
static bool FLAGS_disable_wal = false;
|
||||||
@ -1262,7 +1262,7 @@ class StressTest {
|
|||||||
options.disableDataSync = FLAGS_disable_data_sync;
|
options.disableDataSync = FLAGS_disable_data_sync;
|
||||||
options.use_fsync = FLAGS_use_fsync;
|
options.use_fsync = FLAGS_use_fsync;
|
||||||
options.allow_mmap_reads = FLAGS_use_mmap_reads;
|
options.allow_mmap_reads = FLAGS_use_mmap_reads;
|
||||||
leveldb_kill_odds = FLAGS_kill_random_test;
|
rocksdb_kill_odds = FLAGS_kill_random_test;
|
||||||
options.target_file_size_base = FLAGS_target_file_size_base;
|
options.target_file_size_base = FLAGS_target_file_size_base;
|
||||||
options.target_file_size_multiplier = FLAGS_target_file_size_multiplier;
|
options.target_file_size_multiplier = FLAGS_target_file_size_multiplier;
|
||||||
options.max_bytes_for_level_base = FLAGS_max_bytes_for_level_base;
|
options.max_bytes_for_level_base = FLAGS_max_bytes_for_level_base;
|
||||||
|
@ -60,7 +60,7 @@ public:
|
|||||||
int FilesOnLevel(int level) {
|
int FilesOnLevel(int level) {
|
||||||
std::string property;
|
std::string property;
|
||||||
ASSERT_TRUE(
|
ASSERT_TRUE(
|
||||||
db_->GetProperty("leveldb.num-files-at-level" + NumberToString(level),
|
db_->GetProperty("rocksdb.num-files-at-level" + NumberToString(level),
|
||||||
&property));
|
&property));
|
||||||
return atoi(property.c_str());
|
return atoi(property.c_str());
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* class DBClientProxy maintains:
|
* class DBClientProxy maintains:
|
||||||
* 1. a connection to leveldb service
|
* 1. a connection to rocksdb service
|
||||||
* 2. a map from db names to opened db handles
|
* 2. a map from db names to opened db handles
|
||||||
*
|
*
|
||||||
* it's client codes' responsibility to catch all possible exceptions.
|
* it's client codes' responsibility to catch all possible exceptions.
|
||||||
|
@ -7,7 +7,7 @@ class ShellContext;
|
|||||||
/*
|
/*
|
||||||
* Currently, there are four types of state in total
|
* Currently, there are four types of state in total
|
||||||
* 1. start state: the first state the program enters
|
* 1. start state: the first state the program enters
|
||||||
* 2. connecting state: the program try to connnect to a leveldb server, whose
|
* 2. connecting state: the program try to connnect to a rocksdb server, whose
|
||||||
* previous states could be "start" or "connected" states
|
* previous states could be "start" or "connected" states
|
||||||
* 3. connected states: the program has already connected to a server, and is
|
* 3. connected states: the program has already connected to a server, and is
|
||||||
* processing user commands
|
* processing user commands
|
||||||
|
@ -6,9 +6,7 @@
|
|||||||
// it allocates a block with pre-defined block size. For a request of big
|
// it allocates a block with pre-defined block size. For a request of big
|
||||||
// size, it uses malloc to directly get the requested size.
|
// size, it uses malloc to directly get the requested size.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_ARENA_IMPL_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_ARENA_IMPL_H_
|
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -79,5 +77,3 @@ inline char* ArenaImpl::Allocate(size_t bytes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_ARENA_IMPL_H_
|
|
||||||
|
@ -5,9 +5,7 @@
|
|||||||
// Logger implementation that can be shared by all environments
|
// Logger implementation that can be shared by all environments
|
||||||
// where enough posix functionality is available.
|
// where enough posix functionality is available.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_AUTO_ROLL_LOGGER_H
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_AUTO_ROLL_LOGGER_H
|
|
||||||
|
|
||||||
#include "db/filename.h"
|
#include "db/filename.h"
|
||||||
#include "port/port.h"
|
#include "port/port.h"
|
||||||
#include "util/posix_logger.h"
|
#include "util/posix_logger.h"
|
||||||
@ -89,5 +87,3 @@ Status CreateLoggerFromOptions(
|
|||||||
std::shared_ptr<Logger>* logger);
|
std::shared_ptr<Logger>* logger);
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_AUTO_ROLL_LOGGER_H
|
|
||||||
|
@ -149,7 +149,7 @@ TEST(AutoRollLoggerTest, RollLogFileByTime) {
|
|||||||
TEST(AutoRollLoggerTest,
|
TEST(AutoRollLoggerTest,
|
||||||
OpenLogFilesMultipleTimesWithOptionLog_max_size) {
|
OpenLogFilesMultipleTimesWithOptionLog_max_size) {
|
||||||
// If only 'log_max_size' options is specified, then every time
|
// If only 'log_max_size' options is specified, then every time
|
||||||
// when leveldb is restarted, a new empty log file will be created.
|
// when rocksdb is restarted, a new empty log file will be created.
|
||||||
InitTestDb();
|
InitTestDb();
|
||||||
// WORKAROUND:
|
// WORKAROUND:
|
||||||
// avoid complier's complaint of "comparison between signed
|
// avoid complier's complaint of "comparison between signed
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
* @author Tudor Bosman (tudorb@facebook.com)
|
* @author Tudor Bosman (tudorb@facebook.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_BIT_SET_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_BIT_SET_H_
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
@ -71,5 +69,3 @@ class BitSet {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace facebook
|
} // namespace facebook
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_BIT_SET_H_
|
|
||||||
|
@ -40,7 +40,7 @@ class BloomFilterPolicy : public FilterPolicy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual const char* Name() const {
|
virtual const char* Name() const {
|
||||||
return "leveldb.BuiltinBloomFilter";
|
return "rocksdb.BuiltinBloomFilter";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void CreateFilter(const Slice* keys, int n, std::string* dst) const {
|
virtual void CreateFilter(const Slice* keys, int n, std::string* dst) const {
|
||||||
|
@ -1,13 +1,8 @@
|
|||||||
/*version.h*/
|
#pragma once
|
||||||
#ifndef VERSION_H_
|
|
||||||
#define VERSION_H_
|
|
||||||
|
|
||||||
// these variables tell us about the git config and time
|
// these variables tell us about the git config and time
|
||||||
extern const char* leveldb_build_git_sha;
|
extern const char* rocksdb_build_git_sha;
|
||||||
|
|
||||||
// these variables tell us when the compilation occured
|
// these variables tell us when the compilation occured
|
||||||
extern const char* leveldb_build_compile_time;
|
extern const char* rocksdb_build_compile_time;
|
||||||
extern const char* leveldb_build_compile_date;
|
extern const char* rocksdb_build_compile_date;
|
||||||
|
|
||||||
|
|
||||||
#endif /* VERSION_H_ */
|
|
||||||
|
@ -7,9 +7,7 @@
|
|||||||
// * In addition we support variable length "varint" encoding
|
// * In addition we support variable length "varint" encoding
|
||||||
// * Strings are encoded prefixed by their length in varint format
|
// * Strings are encoded prefixed by their length in varint format
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_CODING_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_CODING_H_
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -130,5 +128,3 @@ extern uint64_t BitStreamGetInt(const Slice* src, size_t offset,
|
|||||||
uint32_t bits);
|
uint32_t bits);
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_CODING_H_
|
|
||||||
|
@ -19,7 +19,7 @@ class BytewiseComparatorImpl : public Comparator {
|
|||||||
BytewiseComparatorImpl() { }
|
BytewiseComparatorImpl() { }
|
||||||
|
|
||||||
virtual const char* Name() const {
|
virtual const char* Name() const {
|
||||||
return "leveldb.BytewiseComparator";
|
return "rocksdb.BytewiseComparator";
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual int Compare(const Slice& a, const Slice& b) const {
|
virtual int Compare(const Slice& a, const Slice& b) const {
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_CRC32C_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_CRC32C_H_
|
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@ -41,5 +39,3 @@ inline uint32_t Unmask(uint32_t masked_crc) {
|
|||||||
|
|
||||||
} // namespace crc32c
|
} // namespace crc32c
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_CRC32C_H_
|
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
// Copyright (c) 2012 Facebook. All rights reserved.
|
// Copyright (c) 2012 Facebook. All rights reserved.
|
||||||
|
|
||||||
#ifdef USE_HDFS
|
#ifdef USE_HDFS
|
||||||
#ifndef LEVELDB_HDFS_FILE_C
|
#ifndef ROCKSDB_HDFS_FILE_C
|
||||||
#define LEVELDB_HDFS_FILE_C
|
#define ROCKSDB_HDFS_FILE_C
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -33,8 +33,8 @@
|
|||||||
#include "hdfs/env_hdfs.h"
|
#include "hdfs/env_hdfs.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
// This file defines an HDFS environment for leveldb. It uses the libhdfs
|
// This file defines an HDFS environment for rocksdb. It uses the libhdfs
|
||||||
// api to access HDFS. All HDFS files created by one instance of leveldb
|
// api to access HDFS. All HDFS files created by one instance of rocksdb
|
||||||
// will reside on the same HDFS cluster.
|
// will reside on the same HDFS cluster.
|
||||||
//
|
//
|
||||||
|
|
||||||
@ -507,7 +507,7 @@ Status HdfsEnv::NewLogger(const std::string& fname,
|
|||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // LEVELDB_HDFS_FILE_C
|
#endif // ROCKSDB_HDFS_FILE_C
|
||||||
|
|
||||||
#else // USE_HDFS
|
#else // USE_HDFS
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
|
|
||||||
// This is only set from db_stress.cc and for testing only.
|
// This is only set from db_stress.cc and for testing only.
|
||||||
// If non-zero, kill at various points in source code with probability 1/this
|
// If non-zero, kill at various points in source code with probability 1/this
|
||||||
int leveldb_kill_odds = 0;
|
int rocksdb_kill_odds = 0;
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
|
|
||||||
@ -65,7 +65,7 @@ static Status IOError(const std::string& context, int err_number) {
|
|||||||
|
|
||||||
#ifdef NDEBUG
|
#ifdef NDEBUG
|
||||||
// empty in release build
|
// empty in release build
|
||||||
#define TEST_KILL_RANDOM(leveldb_kill_odds)
|
#define TEST_KILL_RANDOM(rocksdb_kill_odds)
|
||||||
#else
|
#else
|
||||||
|
|
||||||
// Kill the process with probablity 1/odds for testing.
|
// Kill the process with probablity 1/odds for testing.
|
||||||
@ -88,9 +88,9 @@ static void TestKillRandom(int odds, const std::string& srcfile,
|
|||||||
#define REDUCE_ODDS 2
|
#define REDUCE_ODDS 2
|
||||||
#define REDUCE_ODDS2 4
|
#define REDUCE_ODDS2 4
|
||||||
|
|
||||||
#define TEST_KILL_RANDOM(leveldb_kill_odds) { \
|
#define TEST_KILL_RANDOM(rocksdb_kill_odds) { \
|
||||||
if (leveldb_kill_odds > 0) { \
|
if (rocksdb_kill_odds > 0) { \
|
||||||
TestKillRandom(leveldb_kill_odds, __FILE__, __LINE__); \
|
TestKillRandom(rocksdb_kill_odds, __FILE__, __LINE__); \
|
||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,7 +314,7 @@ class PosixMmapFile : public WritableFile {
|
|||||||
|
|
||||||
bool UnmapCurrentRegion() {
|
bool UnmapCurrentRegion() {
|
||||||
bool result = true;
|
bool result = true;
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
if (base_ != nullptr) {
|
if (base_ != nullptr) {
|
||||||
if (last_sync_ < limit_) {
|
if (last_sync_ < limit_) {
|
||||||
// Defer syncing this data until next Sync() call, if any
|
// Defer syncing this data until next Sync() call, if any
|
||||||
@ -340,21 +340,21 @@ class PosixMmapFile : public WritableFile {
|
|||||||
Status MapNewRegion() {
|
Status MapNewRegion() {
|
||||||
assert(base_ == nullptr);
|
assert(base_ == nullptr);
|
||||||
|
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
int alloc_status = posix_fallocate(fd_, file_offset_, map_size_);
|
int alloc_status = posix_fallocate(fd_, file_offset_, map_size_);
|
||||||
if (alloc_status != 0) {
|
if (alloc_status != 0) {
|
||||||
return Status::IOError("Error allocating space to file : " + filename_ +
|
return Status::IOError("Error allocating space to file : " + filename_ +
|
||||||
"Error : " + strerror(alloc_status));
|
"Error : " + strerror(alloc_status));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
void* ptr = mmap(nullptr, map_size_, PROT_READ | PROT_WRITE, MAP_SHARED,
|
void* ptr = mmap(nullptr, map_size_, PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||||
fd_, file_offset_);
|
fd_, file_offset_);
|
||||||
if (ptr == MAP_FAILED) {
|
if (ptr == MAP_FAILED) {
|
||||||
return Status::IOError("MMap failed on " + filename_);
|
return Status::IOError("MMap failed on " + filename_);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
|
|
||||||
base_ = reinterpret_cast<char*>(ptr);
|
base_ = reinterpret_cast<char*>(ptr);
|
||||||
limit_ = base_ + map_size_;
|
limit_ = base_ + map_size_;
|
||||||
@ -390,7 +390,7 @@ class PosixMmapFile : public WritableFile {
|
|||||||
virtual Status Append(const Slice& data) {
|
virtual Status Append(const Slice& data) {
|
||||||
const char* src = data.data();
|
const char* src = data.data();
|
||||||
size_t left = data.size();
|
size_t left = data.size();
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds * REDUCE_ODDS);
|
TEST_KILL_RANDOM(rocksdb_kill_odds * REDUCE_ODDS);
|
||||||
PrepareWrite(GetFileSize(), left);
|
PrepareWrite(GetFileSize(), left);
|
||||||
while (left > 0) {
|
while (left > 0) {
|
||||||
assert(base_ <= dst_);
|
assert(base_ <= dst_);
|
||||||
@ -402,7 +402,7 @@ class PosixMmapFile : public WritableFile {
|
|||||||
if (!s.ok()) {
|
if (!s.ok()) {
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -412,7 +412,7 @@ class PosixMmapFile : public WritableFile {
|
|||||||
src += n;
|
src += n;
|
||||||
left -= n;
|
left -= n;
|
||||||
}
|
}
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -420,7 +420,7 @@ class PosixMmapFile : public WritableFile {
|
|||||||
Status s;
|
Status s;
|
||||||
size_t unused = limit_ - dst_;
|
size_t unused = limit_ - dst_;
|
||||||
|
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
|
|
||||||
if (!UnmapCurrentRegion()) {
|
if (!UnmapCurrentRegion()) {
|
||||||
s = IOError(filename_, errno);
|
s = IOError(filename_, errno);
|
||||||
@ -431,7 +431,7 @@ class PosixMmapFile : public WritableFile {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
|
|
||||||
if (close(fd_) < 0) {
|
if (close(fd_) < 0) {
|
||||||
if (s.ok()) {
|
if (s.ok()) {
|
||||||
@ -446,7 +446,7 @@ class PosixMmapFile : public WritableFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual Status Flush() {
|
virtual Status Flush() {
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -455,12 +455,12 @@ class PosixMmapFile : public WritableFile {
|
|||||||
|
|
||||||
if (pending_sync_) {
|
if (pending_sync_) {
|
||||||
// Some unmapped data was not synced
|
// Some unmapped data was not synced
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
pending_sync_ = false;
|
pending_sync_ = false;
|
||||||
if (fdatasync(fd_) < 0) {
|
if (fdatasync(fd_) < 0) {
|
||||||
s = IOError(filename_, errno);
|
s = IOError(filename_, errno);
|
||||||
}
|
}
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds * REDUCE_ODDS);
|
TEST_KILL_RANDOM(rocksdb_kill_odds * REDUCE_ODDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dst_ > last_sync_) {
|
if (dst_ > last_sync_) {
|
||||||
@ -469,11 +469,11 @@ class PosixMmapFile : public WritableFile {
|
|||||||
size_t p1 = TruncateToPageBoundary(last_sync_ - base_);
|
size_t p1 = TruncateToPageBoundary(last_sync_ - base_);
|
||||||
size_t p2 = TruncateToPageBoundary(dst_ - base_ - 1);
|
size_t p2 = TruncateToPageBoundary(dst_ - base_ - 1);
|
||||||
last_sync_ = dst_;
|
last_sync_ = dst_;
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
if (msync(base_ + p1, p2 - p1 + page_size_, MS_SYNC) < 0) {
|
if (msync(base_ + p1, p2 - p1 + page_size_, MS_SYNC) < 0) {
|
||||||
s = IOError(filename_, errno);
|
s = IOError(filename_, errno);
|
||||||
}
|
}
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
@ -485,12 +485,12 @@ class PosixMmapFile : public WritableFile {
|
|||||||
virtual Status Fsync() {
|
virtual Status Fsync() {
|
||||||
if (pending_sync_) {
|
if (pending_sync_) {
|
||||||
// Some unmapped data was not synced
|
// Some unmapped data was not synced
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
pending_sync_ = false;
|
pending_sync_ = false;
|
||||||
if (fsync(fd_) < 0) {
|
if (fsync(fd_) < 0) {
|
||||||
return IOError(filename_, errno);
|
return IOError(filename_, errno);
|
||||||
}
|
}
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
}
|
}
|
||||||
// This invocation to Sync will not issue the call to
|
// This invocation to Sync will not issue the call to
|
||||||
// fdatasync because pending_sync_ has already been cleared.
|
// fdatasync because pending_sync_ has already been cleared.
|
||||||
@ -518,7 +518,7 @@ class PosixMmapFile : public WritableFile {
|
|||||||
|
|
||||||
#ifdef OS_LINUX
|
#ifdef OS_LINUX
|
||||||
virtual Status Allocate(off_t offset, off_t len) {
|
virtual Status Allocate(off_t offset, off_t len) {
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
if (!fallocate(fd_, FALLOC_FL_KEEP_SIZE, offset, len)) {
|
if (!fallocate(fd_, FALLOC_FL_KEEP_SIZE, offset, len)) {
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
} else {
|
} else {
|
||||||
@ -571,7 +571,7 @@ class PosixWritableFile : public WritableFile {
|
|||||||
pending_sync_ = true;
|
pending_sync_ = true;
|
||||||
pending_fsync_ = true;
|
pending_fsync_ = true;
|
||||||
|
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds * REDUCE_ODDS2);
|
TEST_KILL_RANDOM(rocksdb_kill_odds * REDUCE_ODDS2);
|
||||||
|
|
||||||
PrepareWrite(GetFileSize(), left);
|
PrepareWrite(GetFileSize(), left);
|
||||||
// if there is no space in the cache, then flush
|
// if there is no space in the cache, then flush
|
||||||
@ -599,7 +599,7 @@ class PosixWritableFile : public WritableFile {
|
|||||||
if (done < 0) {
|
if (done < 0) {
|
||||||
return IOError(filename_, errno);
|
return IOError(filename_, errno);
|
||||||
}
|
}
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
|
|
||||||
left -= done;
|
left -= done;
|
||||||
src += done;
|
src += done;
|
||||||
@ -615,7 +615,7 @@ class PosixWritableFile : public WritableFile {
|
|||||||
if (!s.ok()) {
|
if (!s.ok()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
|
|
||||||
if (close(fd_) < 0) {
|
if (close(fd_) < 0) {
|
||||||
if (s.ok()) {
|
if (s.ok()) {
|
||||||
@ -628,7 +628,7 @@ class PosixWritableFile : public WritableFile {
|
|||||||
|
|
||||||
// write out the cached data to the OS cache
|
// write out the cached data to the OS cache
|
||||||
virtual Status Flush() {
|
virtual Status Flush() {
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds * REDUCE_ODDS2);
|
TEST_KILL_RANDOM(rocksdb_kill_odds * REDUCE_ODDS2);
|
||||||
size_t left = cursize_;
|
size_t left = cursize_;
|
||||||
char* src = buf_.get();
|
char* src = buf_.get();
|
||||||
while (left != 0) {
|
while (left != 0) {
|
||||||
@ -636,7 +636,7 @@ class PosixWritableFile : public WritableFile {
|
|||||||
if (done < 0) {
|
if (done < 0) {
|
||||||
return IOError(filename_, errno);
|
return IOError(filename_, errno);
|
||||||
}
|
}
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds * REDUCE_ODDS2);
|
TEST_KILL_RANDOM(rocksdb_kill_odds * REDUCE_ODDS2);
|
||||||
left -= done;
|
left -= done;
|
||||||
src += done;
|
src += done;
|
||||||
}
|
}
|
||||||
@ -656,21 +656,21 @@ class PosixWritableFile : public WritableFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual Status Sync() {
|
virtual Status Sync() {
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
if (pending_sync_ && fdatasync(fd_) < 0) {
|
if (pending_sync_ && fdatasync(fd_) < 0) {
|
||||||
return IOError(filename_, errno);
|
return IOError(filename_, errno);
|
||||||
}
|
}
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
pending_sync_ = false;
|
pending_sync_ = false;
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Status Fsync() {
|
virtual Status Fsync() {
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
if (pending_fsync_ && fsync(fd_) < 0) {
|
if (pending_fsync_ && fsync(fd_) < 0) {
|
||||||
return IOError(filename_, errno);
|
return IOError(filename_, errno);
|
||||||
}
|
}
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
pending_fsync_ = false;
|
pending_fsync_ = false;
|
||||||
pending_sync_ = false;
|
pending_sync_ = false;
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
@ -691,7 +691,7 @@ class PosixWritableFile : public WritableFile {
|
|||||||
|
|
||||||
#ifdef OS_LINUX
|
#ifdef OS_LINUX
|
||||||
virtual Status Allocate(off_t offset, off_t len) {
|
virtual Status Allocate(off_t offset, off_t len) {
|
||||||
TEST_KILL_RANDOM(leveldb_kill_odds);
|
TEST_KILL_RANDOM(rocksdb_kill_odds);
|
||||||
if (!fallocate(fd_, FALLOC_FL_KEEP_SIZE, offset, len)) {
|
if (!fallocate(fd_, FALLOC_FL_KEEP_SIZE, offset, len)) {
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
} else {
|
} else {
|
||||||
@ -981,7 +981,7 @@ class PosixEnv : public Env {
|
|||||||
*result = env;
|
*result = env;
|
||||||
} else {
|
} else {
|
||||||
char buf[100];
|
char buf[100];
|
||||||
snprintf(buf, sizeof(buf), "/tmp/leveldbtest-%d", int(geteuid()));
|
snprintf(buf, sizeof(buf), "/tmp/rocksdbtest-%d", int(geteuid()));
|
||||||
*result = buf;
|
*result = buf;
|
||||||
}
|
}
|
||||||
// Directory may already exist
|
// Directory may already exist
|
||||||
|
@ -4,9 +4,7 @@
|
|||||||
//
|
//
|
||||||
// Simple hash function used for internal data structures
|
// Simple hash function used for internal data structures
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_HASH_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_HASH_H_
|
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@ -15,5 +13,3 @@ namespace rocksdb {
|
|||||||
extern uint32_t Hash(const char* data, size_t n, uint32_t seed);
|
extern uint32_t Hash(const char* data, size_t n, uint32_t seed);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_HASH_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_HISTOGRAM_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_HISTOGRAM_H_
|
|
||||||
|
|
||||||
#include "rocksdb/statistics.h"
|
#include "rocksdb/statistics.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@ -74,5 +72,3 @@ class HistogramImpl {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_HISTOGRAM_H_
|
|
||||||
|
@ -634,7 +634,7 @@ void InternalDumpCommand::DoCommand() {
|
|||||||
|
|
||||||
if (print_stats_) {
|
if (print_stats_) {
|
||||||
string stats;
|
string stats;
|
||||||
if (db_->GetProperty("leveldb.stats", &stats)) {
|
if (db_->GetProperty("rocksdb.stats", &stats)) {
|
||||||
fprintf(stdout, "%s\n", stats.c_str());
|
fprintf(stdout, "%s\n", stats.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -771,7 +771,7 @@ void DBDumperCommand::DoCommand() {
|
|||||||
uint64_t count = 0;
|
uint64_t count = 0;
|
||||||
if (print_stats_) {
|
if (print_stats_) {
|
||||||
string stats;
|
string stats;
|
||||||
if (db_->GetProperty("leveldb.stats", &stats)) {
|
if (db_->GetProperty("rocksdb.stats", &stats)) {
|
||||||
fprintf(stdout, "%s\n", stats.c_str());
|
fprintf(stdout, "%s\n", stats.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1080,7 +1080,7 @@ void ChangeCompactionStyleCommand::DoCommand() {
|
|||||||
std::string property;
|
std::string property;
|
||||||
std::string files_per_level;
|
std::string files_per_level;
|
||||||
for (int i = 0; i < db_->NumberLevels(); i++) {
|
for (int i = 0; i < db_->NumberLevels(); i++) {
|
||||||
db_->GetProperty("leveldb.num-files-at-level" + NumberToString(i),
|
db_->GetProperty("rocksdb.num-files-at-level" + NumberToString(i),
|
||||||
&property);
|
&property);
|
||||||
|
|
||||||
// format print string
|
// format print string
|
||||||
@ -1100,7 +1100,7 @@ void ChangeCompactionStyleCommand::DoCommand() {
|
|||||||
files_per_level = "";
|
files_per_level = "";
|
||||||
int num_files = 0;
|
int num_files = 0;
|
||||||
for (int i = 0; i < db_->NumberLevels(); i++) {
|
for (int i = 0; i < db_->NumberLevels(); i++) {
|
||||||
db_->GetProperty("leveldb.num-files-at-level" + NumberToString(i),
|
db_->GetProperty("rocksdb.num-files-at-level" + NumberToString(i),
|
||||||
&property);
|
&property);
|
||||||
|
|
||||||
// format print string
|
// format print string
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_LDB_CMD_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_LDB_CMD_H_
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
@ -681,4 +679,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
#endif // STORAGE_LEVELDB_UTIL_LDB_CMD_H_
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef LEVELDB_UTIL_LDB_CMD_EXECUTE_RESULT_H_
|
#pragma once
|
||||||
#define LEVELDB_UTIL_LDB_CMD_EXECUTE_RESULT_H_
|
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
|
|
||||||
@ -70,5 +69,3 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -5,9 +5,7 @@
|
|||||||
// Must not be included from any .h files to avoid polluting the namespace
|
// Must not be included from any .h files to avoid polluting the namespace
|
||||||
// with macros.
|
// with macros.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_LOGGING_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_LOGGING_H_
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -43,5 +41,3 @@ extern bool ConsumeChar(Slice* in, char c);
|
|||||||
extern bool ConsumeDecimalNumber(Slice* in, uint64_t* val);
|
extern bool ConsumeDecimalNumber(Slice* in, uint64_t* val);
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_LOGGING_H_
|
|
||||||
|
@ -25,7 +25,7 @@ class ManualCompactionTest { };
|
|||||||
|
|
||||||
TEST(ManualCompactionTest, Test) {
|
TEST(ManualCompactionTest, Test) {
|
||||||
// Get rid of any state from an old run.
|
// Get rid of any state from an old run.
|
||||||
std::string dbpath = rocksdb::test::TmpDir() + "/leveldb_cbug_test";
|
std::string dbpath = rocksdb::test::TmpDir() + "/rocksdb_cbug_test";
|
||||||
DestroyDB(dbpath, rocksdb::Options());
|
DestroyDB(dbpath, rocksdb::Options());
|
||||||
|
|
||||||
// Open database. Disable compression since it affects the creation
|
// Open database. Disable compression since it affects the creation
|
||||||
|
@ -4,9 +4,7 @@
|
|||||||
All code is released to the public domain. For business purposes, Murmurhash is
|
All code is released to the public domain. For business purposes, Murmurhash is
|
||||||
under the MIT license.
|
under the MIT license.
|
||||||
*/
|
*/
|
||||||
#ifndef MURMURHASH_H
|
#pragma once
|
||||||
#define MURMURHASH_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#if defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
@ -28,5 +26,3 @@ unsigned int MurmurHashNeutral2 ( const void * key, int len, unsigned int seed )
|
|||||||
typedef unsigned int murmur_t;
|
typedef unsigned int murmur_t;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* MURMURHASH_H */
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_
|
|
||||||
|
|
||||||
#include "port/port.h"
|
#include "port/port.h"
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
@ -73,6 +71,3 @@ class WriteLock {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
#ifndef PERF_CONTEXT_IMP_H
|
#pragma once
|
||||||
#define PERF_CONTEXT_IMP_H
|
|
||||||
|
|
||||||
#include "rocksdb/perf_context.h"
|
#include "rocksdb/perf_context.h"
|
||||||
#include "util/stop_watch.h"
|
#include "util/stop_watch.h"
|
||||||
|
|
||||||
@ -29,5 +27,3 @@ inline void BumpPerfTime(uint64_t* time,
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -5,9 +5,7 @@
|
|||||||
// Logger implementation that can be shared by all environments
|
// Logger implementation that can be shared by all environments
|
||||||
// where enough posix functionality is available.
|
// where enough posix functionality is available.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_POSIX_LOGGER_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_POSIX_LOGGER_H_
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
@ -130,5 +128,3 @@ class PosixLogger : public Logger {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_POSIX_LOGGER_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_RANDOM_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_RANDOM_H_
|
|
||||||
|
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@ -85,5 +83,3 @@ class Random64 {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_RANDOM_H_
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
#ifndef STACK_TRACE_H
|
#pragma once
|
||||||
#define STACK_TRACE_H
|
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
|
|
||||||
// Install a signal handler to print callstack on the following signals:
|
// Install a signal handler to print callstack on the following signals:
|
||||||
@ -9,5 +7,3 @@ namespace rocksdb {
|
|||||||
void InstallStackTraceHandler();
|
void InstallStackTraceHandler();
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef STATS_LOGGER_H_
|
#pragma once
|
||||||
#define STATS_LOGGER_H_
|
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
|
|
||||||
@ -20,5 +19,3 @@ class StatsLogger {
|
|||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef LEVELDB_UTIL_STL_WRAPPERS_H_
|
#pragma once
|
||||||
#define LEVELDB_UTIL_STL_WRAPPERS_H_
|
|
||||||
|
|
||||||
#include "util/murmurhash.h"
|
#include "util/murmurhash.h"
|
||||||
#include "util/coding.h"
|
#include "util/coding.h"
|
||||||
@ -45,5 +44,3 @@ namespace stl_wrappers {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LEVELDB_UTIL_STL_WRAPPERS_H_
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
#ifndef STORAGE_LEVELDB_UTIL_STOP_WATCH_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_STOP_WATCH_H_
|
|
||||||
|
|
||||||
#include "rocksdb/env.h"
|
#include "rocksdb/env.h"
|
||||||
#include "rocksdb/statistics.h"
|
#include "rocksdb/statistics.h"
|
||||||
|
|
||||||
@ -65,4 +63,3 @@ class StopWatchNano {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
#endif // STORAGE_LEVELDB_UTIL_STOP_WATCH_H_
|
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
// Copyright (c) 2013 Facebook.
|
// Copyright (c) 2013 Facebook.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_STRINGUTIL_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_STRINGUTIL_H_
|
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
|
|
||||||
extern std::vector<std::string> stringSplit(std::string arg, char delim);
|
extern std::vector<std::string> stringSplit(std::string arg, char delim);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_STRINGUTIL_H_
|
|
||||||
|
@ -34,7 +34,7 @@ bool RegisterTest(const char* base, const char* name, void (*func)()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int RunAllTests() {
|
int RunAllTests() {
|
||||||
const char* matcher = getenv("LEVELDB_TESTS");
|
const char* matcher = getenv("ROCKSDB_TESTS");
|
||||||
|
|
||||||
int num = 0;
|
int num = 0;
|
||||||
if (tests != nullptr) {
|
if (tests != nullptr) {
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_TESTHARNESS_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_TESTHARNESS_H_
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -16,14 +15,14 @@ namespace rocksdb {
|
|||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
// Run some of the tests registered by the TEST() macro. If the
|
// Run some of the tests registered by the TEST() macro. If the
|
||||||
// environment variable "LEVELDB_TESTS" is not set, runs all tests.
|
// environment variable "ROCKSDB_TESTS" is not set, runs all tests.
|
||||||
// Otherwise, runs only the tests whose name contains the value of
|
// Otherwise, runs only the tests whose name contains the value of
|
||||||
// "LEVELDB_TESTS" as a substring. E.g., suppose the tests are:
|
// "ROCKSDB_TESTS" as a substring. E.g., suppose the tests are:
|
||||||
// TEST(Foo, Hello) { ... }
|
// TEST(Foo, Hello) { ... }
|
||||||
// TEST(Foo, World) { ... }
|
// TEST(Foo, World) { ... }
|
||||||
// LEVELDB_TESTS=Hello will run the first test
|
// ROCKSDB_TESTS=Hello will run the first test
|
||||||
// LEVELDB_TESTS=o will run both tests
|
// ROCKSDB_TESTS=o will run both tests
|
||||||
// LEVELDB_TESTS=Junk will run no tests
|
// ROCKSDB_TESTS=Junk will run no tests
|
||||||
//
|
//
|
||||||
// Returns 0 if all tests pass.
|
// Returns 0 if all tests pass.
|
||||||
// Dies or returns a non-zero value if some test fails.
|
// Dies or returns a non-zero value if some test fails.
|
||||||
@ -134,5 +133,3 @@ extern bool RegisterTest(const char* base, const char* name, void (*func)());
|
|||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_TESTHARNESS_H_
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_UTIL_TESTUTIL_H_
|
#pragma once
|
||||||
#define STORAGE_LEVELDB_UTIL_TESTUTIL_H_
|
|
||||||
|
|
||||||
#include "rocksdb/env.h"
|
#include "rocksdb/env.h"
|
||||||
#include "rocksdb/slice.h"
|
#include "rocksdb/slice.h"
|
||||||
#include "util/random.h"
|
#include "util/random.h"
|
||||||
@ -50,5 +48,3 @@ class ErrorEnv : public EnvWrapper {
|
|||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_TESTUTIL_H_
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* A MergeOperator for rocksdb/leveldb that implements string append.
|
* A MergeOperator for rocksdb that implements string append.
|
||||||
* @author Deon Nicholas (dnicholas@fb.com)
|
* @author Deon Nicholas (dnicholas@fb.com)
|
||||||
* Copyright 2013 Facebook
|
* Copyright 2013 Facebook
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* A MergeOperator for rocksdb/leveldb that implements string append.
|
* A MergeOperator for rocksdb that implements string append.
|
||||||
* @author Deon Nicholas (dnicholas@fb.com)
|
* @author Deon Nicholas (dnicholas@fb.com)
|
||||||
* Copyright 2013 Facebook
|
* Copyright 2013 Facebook
|
||||||
*/
|
*/
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* A TEST MergeOperator for rocksdb/leveldb that implements string append.
|
* A TEST MergeOperator for rocksdb that implements string append.
|
||||||
* It is built using the MergeOperator interface rather than the simpler
|
* It is built using the MergeOperator interface rather than the simpler
|
||||||
* AssociativeMergeOperator interface. This is useful for testing/benchmarking.
|
* AssociativeMergeOperator interface. This is useful for testing/benchmarking.
|
||||||
* While the two operators are semantically the same, all production code
|
* While the two operators are semantically the same, all production code
|
||||||
|
@ -568,7 +568,7 @@ TEST(StringAppendOperatorTest, SimpleTestNullDelimiter) {
|
|||||||
checker[5] = '\0';
|
checker[5] = '\0';
|
||||||
assert(checker.size() == 8); // Verify it is still the correct size
|
assert(checker.size() == 8); // Verify it is still the correct size
|
||||||
|
|
||||||
// Check that the leveldb result string matches the desired string
|
// Check that the rocksdb result string matches the desired string
|
||||||
assert(res.size() == checker.size());
|
assert(res.size() == checker.size());
|
||||||
ASSERT_EQ(res, checker);
|
ASSERT_EQ(res, checker);
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,7 @@
|
|||||||
* Copyright 2013 Facebook
|
* Copyright 2013 Facebook
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef LEVELDB_REDIS_LIST_EXCEPTION_H
|
#pragma once
|
||||||
#define LEVELDB_REDIS_LIST_EXCEPTION_H
|
|
||||||
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
namespace rocksdb {
|
namespace rocksdb {
|
||||||
@ -20,5 +18,3 @@ class RedisListException: public std::exception {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace rocksdb
|
} // namespace rocksdb
|
||||||
|
|
||||||
#endif // LEVELDB_REDIS_LIST_EXCEPTION_H
|
|
||||||
|
@ -2,9 +2,7 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#ifndef LEVELDB_UTILITIES_TTL_DB_TTL_H_
|
#pragma once
|
||||||
#define LEVELDB_UTILITIES_TTL_DB_TTL_H_
|
|
||||||
|
|
||||||
#include "rocksdb/db.h"
|
#include "rocksdb/db.h"
|
||||||
#include "rocksdb/env.h"
|
#include "rocksdb/env.h"
|
||||||
#include "rocksdb/compaction_filter.h"
|
#include "rocksdb/compaction_filter.h"
|
||||||
@ -360,4 +358,3 @@ class TtlMergeOperator : public MergeOperator {
|
|||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif // LEVELDB_UTILITIES_TTL_DB_TTL_H_
|
|
||||||
|
Loading…
Reference in New Issue
Block a user