mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-30 07:25:50 +00:00
Make includes relative, change namespace, support unity build
This commit is contained in:
@@ -2,17 +2,17 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "db/builder.h"
|
#include "builder.h"
|
||||||
|
|
||||||
#include "db/filename.h"
|
#include "filename.h"
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "db/table_cache.h"
|
#include "table_cache.h"
|
||||||
#include "db/version_edit.h"
|
#include "version_edit.h"
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/iterator.h"
|
#include "../hyperleveldb/iterator.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
Status BuildTable(const std::string& dbname,
|
Status BuildTable(const std::string& dbname,
|
||||||
Env* env,
|
Env* env,
|
||||||
@@ -85,4 +85,4 @@ Status BuildTable(const std::string& dbname,
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,12 +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 STORAGE_LEVELDB_DB_BUILDER_H_
|
#ifndef STORAGE_HYPERLEVELDB_DB_BUILDER_H_
|
||||||
#define STORAGE_LEVELDB_DB_BUILDER_H_
|
#define STORAGE_HYPERLEVELDB_DB_BUILDER_H_
|
||||||
|
|
||||||
#include "hyperleveldb/status.h"
|
#include "../hyperleveldb/status.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
struct Options;
|
struct Options;
|
||||||
struct FileMetaData;
|
struct FileMetaData;
|
||||||
@@ -29,6 +29,6 @@ extern Status BuildTable(const std::string& dbname,
|
|||||||
Iterator* iter,
|
Iterator* iter,
|
||||||
FileMetaData* meta);
|
FileMetaData* meta);
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_BUILDER_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_BUILDER_H_
|
||||||
|
|||||||
@@ -2,19 +2,19 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "hyperleveldb/c.h"
|
#include "c.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "hyperleveldb/cache.h"
|
#include "../hyperleveldb/cache.h"
|
||||||
#include "hyperleveldb/comparator.h"
|
#include "../hyperleveldb/comparator.h"
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/filter_policy.h"
|
#include "../hyperleveldb/filter_policy.h"
|
||||||
#include "hyperleveldb/iterator.h"
|
#include "../hyperleveldb/iterator.h"
|
||||||
#include "hyperleveldb/options.h"
|
#include "../hyperleveldb/options.h"
|
||||||
#include "hyperleveldb/status.h"
|
#include "../hyperleveldb/status.h"
|
||||||
#include "hyperleveldb/write_batch.h"
|
#include "../hyperleveldb/write_batch.h"
|
||||||
|
|
||||||
using leveldb::Cache;
|
using leveldb::Cache;
|
||||||
using leveldb::Comparator;
|
using leveldb::Comparator;
|
||||||
|
|||||||
@@ -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. */
|
||||||
|
|
||||||
#include "hyperleveldb/c.h"
|
#include "c.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -2,25 +2,25 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "hyperleveldb/cache.h"
|
#include "../hyperleveldb/cache.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/table.h"
|
#include "../hyperleveldb/table.h"
|
||||||
#include "hyperleveldb/write_batch.h"
|
#include "../hyperleveldb/write_batch.h"
|
||||||
#include "db/db_impl.h"
|
#include "db_impl.h"
|
||||||
#include "db/filename.h"
|
#include "filename.h"
|
||||||
#include "db/log_format.h"
|
#include "log_format.h"
|
||||||
#include "db/version_set.h"
|
#include "version_set.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
#include "util/testharness.h"
|
#include "../util/testharness.h"
|
||||||
#include "util/testutil.h"
|
#include "../util/testutil.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
static const int kValueSize = 1000;
|
static const int kValueSize = 1000;
|
||||||
|
|
||||||
@@ -353,7 +353,7 @@ TEST(CorruptionTest, UnrelatedKeys) {
|
|||||||
ASSERT_EQ(Value(1000, &tmp2).ToString(), v);
|
ASSERT_EQ(Value(1000, &tmp2).ToString(), v);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -5,18 +5,18 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "db/db_impl.h"
|
#include "db_impl.h"
|
||||||
#include "db/version_set.h"
|
#include "version_set.h"
|
||||||
#include "hyperleveldb/cache.h"
|
#include "../hyperleveldb/cache.h"
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/write_batch.h"
|
#include "../hyperleveldb/write_batch.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
#include "util/crc32c.h"
|
#include "../util/crc32c.h"
|
||||||
#include "util/histogram.h"
|
#include "../util/histogram.h"
|
||||||
#include "util/mutexlock.h"
|
#include "../util/mutexlock.h"
|
||||||
#include "util/random.h"
|
#include "../util/random.h"
|
||||||
#include "util/testutil.h"
|
#include "../util/testutil.h"
|
||||||
|
|
||||||
// Comma-separated list of operations to run in the specified order
|
// Comma-separated list of operations to run in the specified order
|
||||||
// Actual benchmarks:
|
// Actual benchmarks:
|
||||||
@@ -102,7 +102,7 @@ static bool FLAGS_use_existing_db = false;
|
|||||||
// Use the db with the following name.
|
// Use the db with the following name.
|
||||||
static const char* FLAGS_db = NULL;
|
static const char* FLAGS_db = NULL;
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -921,7 +921,7 @@ class Benchmark {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
FLAGS_write_buffer_size = leveldb::Options().write_buffer_size;
|
FLAGS_write_buffer_size = leveldb::Options().write_buffer_size;
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|
||||||
#include "db/db_impl.h"
|
#include "db_impl.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <set>
|
#include <set>
|
||||||
@@ -10,30 +10,30 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "db/builder.h"
|
#include "builder.h"
|
||||||
#include "db/db_iter.h"
|
#include "db_iter.h"
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "db/filename.h"
|
#include "filename.h"
|
||||||
#include "db/log_reader.h"
|
#include "log_reader.h"
|
||||||
#include "db/log_writer.h"
|
#include "log_writer.h"
|
||||||
#include "db/memtable.h"
|
#include "memtable.h"
|
||||||
#include "db/table_cache.h"
|
#include "table_cache.h"
|
||||||
#include "db/version_set.h"
|
#include "version_set.h"
|
||||||
#include "db/write_batch_internal.h"
|
#include "write_batch_internal.h"
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/status.h"
|
#include "../hyperleveldb/status.h"
|
||||||
#include "hyperleveldb/table.h"
|
#include "../hyperleveldb/table.h"
|
||||||
#include "hyperleveldb/table_builder.h"
|
#include "../hyperleveldb/table_builder.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
#include "table/block.h"
|
#include "../table/block.h"
|
||||||
#include "table/merger.h"
|
#include "../table/merger.h"
|
||||||
#include "table/two_level_iterator.h"
|
#include "../table/two_level_iterator.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
#include "util/mutexlock.h"
|
#include "../util/mutexlock.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
const int kNumNonTableCacheFiles = 10;
|
const int kNumNonTableCacheFiles = 10;
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ DBImpl::DBImpl(const Options& options, const std::string& dbname)
|
|||||||
versions_ = new VersionSet(dbname_, &options_, table_cache_,
|
versions_ = new VersionSet(dbname_, &options_, table_cache_,
|
||||||
&internal_comparator_);
|
&internal_comparator_);
|
||||||
|
|
||||||
for (int i = 0; i < leveldb::config::kNumLevels; ++i) {
|
for (int i = 0; i < config::kNumLevels; ++i) {
|
||||||
levels_locked_[i] = false;
|
levels_locked_[i] = false;
|
||||||
}
|
}
|
||||||
mutex_.Unlock();
|
mutex_.Unlock();
|
||||||
@@ -1613,4 +1613,4 @@ Status DestroyDB(const std::string& dbname, const Options& options) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,20 +2,20 @@
|
|||||||
// 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_IMPL_H_
|
#ifndef STORAGE_HYPERLEVELDB_DB_DB_IMPL_H_
|
||||||
#define STORAGE_LEVELDB_DB_DB_IMPL_H_
|
#define STORAGE_HYPERLEVELDB_DB_DB_IMPL_H_
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "db/log_writer.h"
|
#include "log_writer.h"
|
||||||
#include "db/snapshot.h"
|
#include "snapshot.h"
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
#include "port/thread_annotations.h"
|
#include "../port/thread_annotations.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class MemTable;
|
class MemTable;
|
||||||
class TableCache;
|
class TableCache;
|
||||||
@@ -154,7 +154,7 @@ class DBImpl : public DB {
|
|||||||
std::set<uint64_t> pending_outputs_;
|
std::set<uint64_t> pending_outputs_;
|
||||||
|
|
||||||
bool allow_background_activity_;
|
bool allow_background_activity_;
|
||||||
bool levels_locked_[leveldb::config::kNumLevels];
|
bool levels_locked_[config::kNumLevels];
|
||||||
int num_bg_threads_;
|
int num_bg_threads_;
|
||||||
// Tell the foreground that background has done something of note
|
// Tell the foreground that background has done something of note
|
||||||
port::CondVar bg_fg_cv_;
|
port::CondVar bg_fg_cv_;
|
||||||
@@ -218,6 +218,6 @@ extern Options SanitizeOptions(const std::string& db,
|
|||||||
const InternalFilterPolicy* ipolicy,
|
const InternalFilterPolicy* ipolicy,
|
||||||
const Options& src);
|
const Options& src);
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_DB_IMPL_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_DB_IMPL_H_
|
||||||
|
|||||||
@@ -2,17 +2,17 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "db/db_iter.h"
|
#include "db_iter.h"
|
||||||
|
|
||||||
#include "db/filename.h"
|
#include "filename.h"
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/iterator.h"
|
#include "../hyperleveldb/iterator.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
#include "util/mutexlock.h"
|
#include "../util/mutexlock.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void DumpInternalIter(Iterator* iter) {
|
static void DumpInternalIter(Iterator* iter) {
|
||||||
@@ -296,4 +296,4 @@ Iterator* NewDBIterator(
|
|||||||
return new DBIter(dbname, env, user_key_comparator, internal_iter, sequence);
|
return new DBIter(dbname, env, user_key_comparator, internal_iter, sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_DB_DB_ITER_H_
|
||||||
#define STORAGE_LEVELDB_DB_DB_ITER_H_
|
#define STORAGE_HYPERLEVELDB_DB_DB_ITER_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// Return a new iterator that converts internal keys (yielded by
|
// Return a new iterator that converts internal keys (yielded by
|
||||||
// "*internal_iter") that were live at the specified "sequence" number
|
// "*internal_iter") that were live at the specified "sequence" number
|
||||||
@@ -21,6 +21,6 @@ extern Iterator* NewDBIterator(
|
|||||||
Iterator* internal_iter,
|
Iterator* internal_iter,
|
||||||
const SequenceNumber& sequence);
|
const SequenceNumber& sequence);
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_DB_ITER_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_DB_ITER_H_
|
||||||
|
|||||||
@@ -2,22 +2,22 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
#include "hyperleveldb/filter_policy.h"
|
#include "../hyperleveldb/filter_policy.h"
|
||||||
#include "db/db_impl.h"
|
#include "db_impl.h"
|
||||||
#include "db/filename.h"
|
#include "filename.h"
|
||||||
#include "db/version_set.h"
|
#include "version_set.h"
|
||||||
#include "db/write_batch_internal.h"
|
#include "write_batch_internal.h"
|
||||||
#include "hyperleveldb/cache.h"
|
#include "../hyperleveldb/cache.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/table.h"
|
#include "../hyperleveldb/table.h"
|
||||||
#include "util/hash.h"
|
#include "../util/hash.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
#include "util/mutexlock.h"
|
#include "../util/mutexlock.h"
|
||||||
#include "util/testharness.h"
|
#include "../util/testharness.h"
|
||||||
#include "util/testutil.h"
|
#include "../util/testutil.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
static std::string RandomString(Random* rnd, int len) {
|
static std::string RandomString(Random* rnd, int len) {
|
||||||
std::string r;
|
std::string r;
|
||||||
@@ -2049,7 +2049,7 @@ void BM_LogAndApply(int iters, int num_base_files) {
|
|||||||
buf, iters, us, ((float)us) / iters);
|
buf, iters, us, ((float)us) / iters);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
if (argc > 1 && std::string(argv[1]) == "--benchmark") {
|
if (argc > 1 && std::string(argv[1]) == "--benchmark") {
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
static uint64_t PackSequenceAndType(uint64_t seq, ValueType t) {
|
static uint64_t PackSequenceAndType(uint64_t seq, ValueType t) {
|
||||||
assert(seq <= kMaxSequenceNumber);
|
assert(seq <= kMaxSequenceNumber);
|
||||||
@@ -137,4 +137,4 @@ LookupKey::LookupKey(const Slice& user_key, SequenceNumber s) {
|
|||||||
end_ = dst;
|
end_ = dst;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,19 +2,19 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_DB_FORMAT_H_
|
||||||
#define STORAGE_LEVELDB_DB_FORMAT_H_
|
#define STORAGE_HYPERLEVELDB_DB_FORMAT_H_
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "hyperleveldb/comparator.h"
|
#include "../hyperleveldb/comparator.h"
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
#include "hyperleveldb/filter_policy.h"
|
#include "../hyperleveldb/filter_policy.h"
|
||||||
#include "hyperleveldb/slice.h"
|
#include "../hyperleveldb/slice.h"
|
||||||
#include "hyperleveldb/table_builder.h"
|
#include "../hyperleveldb/table_builder.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// Grouping of constants. We may want to make some of these
|
// Grouping of constants. We may want to make some of these
|
||||||
// parameters set via options.
|
// parameters set via options.
|
||||||
@@ -224,6 +224,6 @@ inline LookupKey::~LookupKey() {
|
|||||||
if (start_ != space_) delete[] start_;
|
if (start_ != space_) delete[] start_;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_FORMAT_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_FORMAT_H_
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
#include "util/testharness.h"
|
#include "../util/testharness.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
static std::string IKey(const std::string& user_key,
|
static std::string IKey(const std::string& user_key,
|
||||||
uint64_t seq,
|
uint64_t seq,
|
||||||
@@ -105,7 +105,7 @@ TEST(FormatTest, InternalKeyShortestSuccessor) {
|
|||||||
ShortSuccessor(IKey("\xff\xff", 100, kTypeValue)));
|
ShortSuccessor(IKey("\xff\xff", 100, kTypeValue)));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "db/filename.h"
|
#include "filename.h"
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// A utility routine: write "data" to the named file and Sync() it.
|
// A utility routine: write "data" to the named file and Sync() it.
|
||||||
extern Status WriteStringToFileSync(Env* env, const Slice& data,
|
extern Status WriteStringToFileSync(Env* env, const Slice& data,
|
||||||
@@ -136,4 +136,4 @@ Status SetCurrentFile(Env* env, const std::string& dbname,
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -4,16 +4,16 @@
|
|||||||
//
|
//
|
||||||
// File names used by DB code
|
// File names used by DB code
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_FILENAME_H_
|
#ifndef STORAGE_HYPERLEVELDB_DB_FILENAME_H_
|
||||||
#define STORAGE_LEVELDB_DB_FILENAME_H_
|
#define STORAGE_HYPERLEVELDB_DB_FILENAME_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "hyperleveldb/slice.h"
|
#include "../hyperleveldb/slice.h"
|
||||||
#include "hyperleveldb/status.h"
|
#include "../hyperleveldb/status.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Env;
|
class Env;
|
||||||
|
|
||||||
@@ -75,6 +75,6 @@ extern Status SetCurrentFile(Env* env, const std::string& dbname,
|
|||||||
uint64_t descriptor_number);
|
uint64_t descriptor_number);
|
||||||
|
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_FILENAME_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_FILENAME_H_
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "db/filename.h"
|
#include "filename.h"
|
||||||
|
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
#include "util/testharness.h"
|
#include "../util/testharness.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class FileNameTest { };
|
class FileNameTest { };
|
||||||
|
|
||||||
@@ -115,7 +115,7 @@ TEST(FileNameTest, Construction) {
|
|||||||
ASSERT_EQ(kTempFile, type);
|
ASSERT_EQ(kTempFile, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -3,20 +3,20 @@
|
|||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "db/filename.h"
|
#include "filename.h"
|
||||||
#include "db/log_reader.h"
|
#include "log_reader.h"
|
||||||
#include "db/version_edit.h"
|
#include "version_edit.h"
|
||||||
#include "db/write_batch_internal.h"
|
#include "write_batch_internal.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/iterator.h"
|
#include "../hyperleveldb/iterator.h"
|
||||||
#include "hyperleveldb/options.h"
|
#include "../hyperleveldb/options.h"
|
||||||
#include "hyperleveldb/status.h"
|
#include "../hyperleveldb/status.h"
|
||||||
#include "hyperleveldb/table.h"
|
#include "../hyperleveldb/table.h"
|
||||||
#include "hyperleveldb/write_batch.h"
|
#include "../hyperleveldb/write_batch.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -209,7 +209,7 @@ bool HandleDumpCommand(Env* env, char** files, int num) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
static void Usage() {
|
static void Usage() {
|
||||||
fprintf(
|
fprintf(
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_DB_LOG_FORMAT_H_
|
||||||
#define STORAGE_LEVELDB_DB_LOG_FORMAT_H_
|
#define STORAGE_HYPERLEVELDB_DB_LOG_FORMAT_H_
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
namespace log {
|
namespace log {
|
||||||
|
|
||||||
enum RecordType {
|
enum RecordType {
|
||||||
@@ -30,6 +30,6 @@ static const int kBlockSize = 32768;
|
|||||||
static const int kHeaderSize = 4 + 1 + 2;
|
static const int kHeaderSize = 4 + 1 + 2;
|
||||||
|
|
||||||
} // namespace log
|
} // namespace log
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_LOG_FORMAT_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_LOG_FORMAT_H_
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "db/log_reader.h"
|
#include "log_reader.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
#include "util/crc32c.h"
|
#include "../util/crc32c.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
namespace log {
|
namespace log {
|
||||||
|
|
||||||
Reader::Reporter::~Reporter() {
|
Reader::Reporter::~Reporter() {
|
||||||
@@ -256,4 +256,4 @@ unsigned int Reader::ReadPhysicalRecord(Slice* result) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace log
|
} // namespace log
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_DB_LOG_READER_H_
|
||||||
#define STORAGE_LEVELDB_DB_LOG_READER_H_
|
#define STORAGE_HYPERLEVELDB_DB_LOG_READER_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "db/log_format.h"
|
#include "log_format.h"
|
||||||
#include "hyperleveldb/slice.h"
|
#include "../hyperleveldb/slice.h"
|
||||||
#include "hyperleveldb/status.h"
|
#include "../hyperleveldb/status.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class SequentialFile;
|
class SequentialFile;
|
||||||
|
|
||||||
@@ -103,6 +103,6 @@ class Reader {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace log
|
} // namespace log
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_LOG_READER_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_LOG_READER_H_
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "db/log_reader.h"
|
#include "log_reader.h"
|
||||||
#include "db/log_writer.h"
|
#include "log_writer.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
#include "util/crc32c.h"
|
#include "../util/crc32c.h"
|
||||||
#include "util/random.h"
|
#include "../util/random.h"
|
||||||
#include "util/testharness.h"
|
#include "../util/testharness.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
namespace log {
|
namespace log {
|
||||||
|
|
||||||
// Construct a string of the specified length made out of the supplied
|
// Construct a string of the specified length made out of the supplied
|
||||||
@@ -502,7 +502,7 @@ TEST(LogTest, ReadPastEnd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace log
|
} // namespace log
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "db/log_writer.h"
|
#include "log_writer.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
#include "util/crc32c.h"
|
#include "../util/crc32c.h"
|
||||||
#include "util/mutexlock.h"
|
#include "../util/mutexlock.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
namespace log {
|
namespace log {
|
||||||
|
|
||||||
Writer::Writer(WritableFile* dest)
|
Writer::Writer(WritableFile* dest)
|
||||||
@@ -129,4 +129,4 @@ Status Writer::EmitPhysicalRecordAt(RecordType t, const char* ptr, uint64_t offs
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace log
|
} // namespace log
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_DB_LOG_WRITER_H_
|
||||||
#define STORAGE_LEVELDB_DB_LOG_WRITER_H_
|
#define STORAGE_HYPERLEVELDB_DB_LOG_WRITER_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "db/log_format.h"
|
#include "log_format.h"
|
||||||
#include "hyperleveldb/slice.h"
|
#include "../hyperleveldb/slice.h"
|
||||||
#include "hyperleveldb/status.h"
|
#include "../hyperleveldb/status.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class WritableFile;
|
class WritableFile;
|
||||||
|
|
||||||
@@ -45,6 +45,6 @@ class Writer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
} // namespace log
|
} // namespace log
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_LOG_WRITER_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_LOG_WRITER_H_
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "db/memtable.h"
|
#include "memtable.h"
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "hyperleveldb/comparator.h"
|
#include "../hyperleveldb/comparator.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/iterator.h"
|
#include "../hyperleveldb/iterator.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
#include "util/mutexlock.h"
|
#include "../util/mutexlock.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
static Slice GetLengthPrefixedSlice(const char* data) {
|
static Slice GetLengthPrefixedSlice(const char* data) {
|
||||||
uint32_t len;
|
uint32_t len;
|
||||||
@@ -157,4 +157,4 @@ bool MemTable::Get(const LookupKey& key, std::string* value, Status* s) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_DB_MEMTABLE_H_
|
||||||
#define STORAGE_LEVELDB_DB_MEMTABLE_H_
|
#define STORAGE_HYPERLEVELDB_DB_MEMTABLE_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "db/skiplist.h"
|
#include "skiplist.h"
|
||||||
#include "util/arena.h"
|
#include "../util/arena.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class InternalKeyComparator;
|
class InternalKeyComparator;
|
||||||
class Mutex;
|
class Mutex;
|
||||||
@@ -89,6 +89,6 @@ class MemTable {
|
|||||||
void operator=(const MemTable&);
|
void operator=(const MemTable&);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_MEMTABLE_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_MEMTABLE_H_
|
||||||
|
|||||||
@@ -24,21 +24,21 @@
|
|||||||
// Store per-table metadata (smallest, largest, largest-seq#, ...)
|
// Store per-table metadata (smallest, largest, largest-seq#, ...)
|
||||||
// in the table's meta section to speed up ScanTable.
|
// in the table's meta section to speed up ScanTable.
|
||||||
|
|
||||||
#include "db/builder.h"
|
#include "builder.h"
|
||||||
#include "db/db_impl.h"
|
#include "db_impl.h"
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "db/filename.h"
|
#include "filename.h"
|
||||||
#include "db/log_reader.h"
|
#include "log_reader.h"
|
||||||
#include "db/log_writer.h"
|
#include "log_writer.h"
|
||||||
#include "db/memtable.h"
|
#include "memtable.h"
|
||||||
#include "db/table_cache.h"
|
#include "table_cache.h"
|
||||||
#include "db/version_edit.h"
|
#include "version_edit.h"
|
||||||
#include "db/write_batch_internal.h"
|
#include "write_batch_internal.h"
|
||||||
#include "hyperleveldb/comparator.h"
|
#include "../hyperleveldb/comparator.h"
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -386,4 +386,4 @@ Status RepairDB(const std::string& dbname, const Options& options) {
|
|||||||
return repairer.Run();
|
return repairer.Run();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -26,11 +26,11 @@
|
|||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
#include "util/arena.h"
|
#include "../util/arena.h"
|
||||||
#include "util/random.h"
|
#include "../util/random.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Arena;
|
class Arena;
|
||||||
|
|
||||||
@@ -457,4 +457,4 @@ bool SkipList<Key,Comparator>::Contains(const Key& key) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "db/skiplist.h"
|
#include "skiplist.h"
|
||||||
#include <set>
|
#include <set>
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "util/arena.h"
|
#include "../util/arena.h"
|
||||||
#include "util/hash.h"
|
#include "../util/hash.h"
|
||||||
#include "util/random.h"
|
#include "../util/random.h"
|
||||||
#include "util/testharness.h"
|
#include "../util/testharness.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
typedef uint64_t Key;
|
typedef uint64_t Key;
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ TEST(SkipTest, Concurrent3) { RunConcurrent(3); }
|
|||||||
TEST(SkipTest, Concurrent4) { RunConcurrent(4); }
|
TEST(SkipTest, Concurrent4) { RunConcurrent(4); }
|
||||||
TEST(SkipTest, Concurrent5) { RunConcurrent(5); }
|
TEST(SkipTest, Concurrent5) { RunConcurrent(5); }
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -2,12 +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 STORAGE_LEVELDB_DB_SNAPSHOT_H_
|
#ifndef STORAGE_HYPERLEVELDB_DB_SNAPSHOT_H_
|
||||||
#define STORAGE_LEVELDB_DB_SNAPSHOT_H_
|
#define STORAGE_HYPERLEVELDB_DB_SNAPSHOT_H_
|
||||||
|
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class SnapshotList;
|
class SnapshotList;
|
||||||
|
|
||||||
@@ -61,6 +61,6 @@ class SnapshotList {
|
|||||||
SnapshotImpl list_;
|
SnapshotImpl list_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_SNAPSHOT_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_SNAPSHOT_H_
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "db/table_cache.h"
|
#include "table_cache.h"
|
||||||
|
|
||||||
#include "db/filename.h"
|
#include "filename.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/table.h"
|
#include "../hyperleveldb/table.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
struct TableAndFile {
|
struct TableAndFile {
|
||||||
RandomAccessFile* file;
|
RandomAccessFile* file;
|
||||||
@@ -118,4 +118,4 @@ void TableCache::Evict(uint64_t file_number) {
|
|||||||
cache_->Erase(Slice(buf, sizeof(buf)));
|
cache_->Erase(Slice(buf, sizeof(buf)));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -4,17 +4,17 @@
|
|||||||
//
|
//
|
||||||
// Thread-safe (provides internal synchronization)
|
// Thread-safe (provides internal synchronization)
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_DB_TABLE_CACHE_H_
|
#ifndef STORAGE_HYPERLEVELDB_DB_TABLE_CACHE_H_
|
||||||
#define STORAGE_LEVELDB_DB_TABLE_CACHE_H_
|
#define STORAGE_HYPERLEVELDB_DB_TABLE_CACHE_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "hyperleveldb/cache.h"
|
#include "../hyperleveldb/cache.h"
|
||||||
#include "hyperleveldb/table.h"
|
#include "../hyperleveldb/table.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Env;
|
class Env;
|
||||||
|
|
||||||
@@ -56,6 +56,6 @@ class TableCache {
|
|||||||
Status FindTable(uint64_t file_number, uint64_t file_size, Cache::Handle**);
|
Status FindTable(uint64_t file_number, uint64_t file_size, Cache::Handle**);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_TABLE_CACHE_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_TABLE_CACHE_H_
|
||||||
|
|||||||
@@ -2,12 +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.
|
||||||
|
|
||||||
#include "db/version_edit.h"
|
#include "version_edit.h"
|
||||||
|
|
||||||
#include "db/version_set.h"
|
#include "version_set.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// Tag numbers for serialized VersionEdit. These numbers are written to
|
// Tag numbers for serialized VersionEdit. These numbers are written to
|
||||||
// disk and should not be changed.
|
// disk and should not be changed.
|
||||||
@@ -263,4 +263,4 @@ std::string VersionEdit::DebugString() const {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_DB_VERSION_EDIT_H_
|
||||||
#define STORAGE_LEVELDB_DB_VERSION_EDIT_H_
|
#define STORAGE_HYPERLEVELDB_DB_VERSION_EDIT_H_
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class VersionSet;
|
class VersionSet;
|
||||||
|
|
||||||
@@ -102,6 +102,6 @@ class VersionEdit {
|
|||||||
std::vector< std::pair<int, FileMetaData> > new_files_;
|
std::vector< std::pair<int, FileMetaData> > new_files_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_VERSION_EDIT_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_VERSION_EDIT_H_
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "db/version_edit.h"
|
#include "version_edit.h"
|
||||||
#include "util/testharness.h"
|
#include "../util/testharness.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
static void TestEncodeDecode(const VersionEdit& edit) {
|
static void TestEncodeDecode(const VersionEdit& edit) {
|
||||||
std::string encoded, encoded2;
|
std::string encoded, encoded2;
|
||||||
@@ -39,7 +39,7 @@ TEST(VersionEditTest, EncodeDecode) {
|
|||||||
TestEncodeDecode(edit);
|
TestEncodeDecode(edit);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -6,20 +6,20 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "db/filename.h"
|
#include "filename.h"
|
||||||
#include "db/log_reader.h"
|
#include "log_reader.h"
|
||||||
#include "db/log_writer.h"
|
#include "log_writer.h"
|
||||||
#include "db/memtable.h"
|
#include "memtable.h"
|
||||||
#include "db/table_cache.h"
|
#include "table_cache.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/table_builder.h"
|
#include "../hyperleveldb/table_builder.h"
|
||||||
#include "table/merger.h"
|
#include "../table/merger.h"
|
||||||
#include "table/two_level_iterator.h"
|
#include "../table/two_level_iterator.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
static double MaxBytesForLevel(int level) {
|
static double MaxBytesForLevel(int level) {
|
||||||
assert(level < leveldb::config::kNumLevels);
|
assert(level < leveldb::config::kNumLevels);
|
||||||
@@ -1499,4 +1499,4 @@ void Compaction::ReleaseInputs() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -12,18 +12,18 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_DB_VERSION_SET_H_
|
||||||
#define STORAGE_LEVELDB_DB_VERSION_SET_H_
|
#define STORAGE_HYPERLEVELDB_DB_VERSION_SET_H_
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "db/version_edit.h"
|
#include "version_edit.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
#include "port/thread_annotations.h"
|
#include "../port/thread_annotations.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
namespace log { class Writer; }
|
namespace log { class Writer; }
|
||||||
|
|
||||||
@@ -385,6 +385,6 @@ class Compaction {
|
|||||||
size_t level_ptrs_[config::kNumLevels];
|
size_t level_ptrs_[config::kNumLevels];
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_VERSION_SET_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_VERSION_SET_H_
|
||||||
|
|||||||
@@ -2,12 +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.
|
||||||
|
|
||||||
#include "db/version_set.h"
|
#include "version_set.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
#include "util/testharness.h"
|
#include "../util/testharness.h"
|
||||||
#include "util/testutil.h"
|
#include "../util/testutil.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class FindFileTest {
|
class FindFileTest {
|
||||||
public:
|
public:
|
||||||
@@ -172,7 +172,7 @@ TEST(FindFileTest, OverlappingFiles) {
|
|||||||
ASSERT_TRUE(Overlaps("600", "700"));
|
ASSERT_TRUE(Overlaps("600", "700"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -13,15 +13,15 @@
|
|||||||
// len: varint32
|
// len: varint32
|
||||||
// data: uint8[len]
|
// data: uint8[len]
|
||||||
|
|
||||||
#include "hyperleveldb/write_batch.h"
|
#include "../hyperleveldb/write_batch.h"
|
||||||
|
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
#include "db/dbformat.h"
|
#include "dbformat.h"
|
||||||
#include "db/memtable.h"
|
#include "memtable.h"
|
||||||
#include "db/write_batch_internal.h"
|
#include "write_batch_internal.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// WriteBatch header has an 8-byte sequence number followed by a 4-byte count.
|
// WriteBatch header has an 8-byte sequence number followed by a 4-byte count.
|
||||||
static const size_t kHeader = 12;
|
static const size_t kHeader = 12;
|
||||||
@@ -144,4 +144,4 @@ void WriteBatchInternal::Append(WriteBatch* dst, const WriteBatch* src) {
|
|||||||
dst->rep_.append(src->rep_.data() + kHeader, src->rep_.size() - kHeader);
|
dst->rep_.append(src->rep_.data() + kHeader, src->rep_.size() - kHeader);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,12 +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 STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_
|
#ifndef STORAGE_HYPERLEVELDB_DB_WRITE_BATCH_INTERNAL_H_
|
||||||
#define STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_
|
#define STORAGE_HYPERLEVELDB_DB_WRITE_BATCH_INTERNAL_H_
|
||||||
|
|
||||||
#include "hyperleveldb/write_batch.h"
|
#include "../hyperleveldb/write_batch.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class MemTable;
|
class MemTable;
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ class WriteBatchInternal {
|
|||||||
static void Append(WriteBatch* dst, const WriteBatch* src);
|
static void Append(WriteBatch* dst, const WriteBatch* src);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_
|
#endif // STORAGE_HYPERLEVELDB_DB_WRITE_BATCH_INTERNAL_H_
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
|
|
||||||
#include "hyperleveldb/db.h"
|
#include "hyperleveldb/db.h"
|
||||||
|
|
||||||
#include "db/memtable.h"
|
#include "memtable.h"
|
||||||
#include "db/write_batch_internal.h"
|
#include "write_batch_internal.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
#include "util/testharness.h"
|
#include "../util/testharness.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
static std::string PrintContents(WriteBatch* b) {
|
static std::string PrintContents(WriteBatch* b) {
|
||||||
InternalKeyComparator cmp(BytewiseComparator());
|
InternalKeyComparator cmp(BytewiseComparator());
|
||||||
@@ -113,7 +113,7 @@ TEST(WriteBatchTest, Append) {
|
|||||||
PrintContents(&b1));
|
PrintContents(&b1));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ static void WalCheckpoint(sqlite3* db_) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// Helper for quickly generating random data.
|
// Helper for quickly generating random data.
|
||||||
namespace {
|
namespace {
|
||||||
@@ -664,7 +664,7 @@ class Benchmark {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
std::string default_db_path;
|
std::string default_db_path;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ static void DBSynchronize(kyotocabinet::TreeDB* db_)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// Helper for quickly generating random data.
|
// Helper for quickly generating random data.
|
||||||
namespace {
|
namespace {
|
||||||
@@ -479,7 +479,7 @@ class Benchmark {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
std::string default_db_path;
|
std::string default_db_path;
|
||||||
|
|||||||
@@ -2,18 +2,18 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "helpers/memenv/memenv.h"
|
#include "memenv.h"
|
||||||
|
|
||||||
#include "hyperleveldb/env.h"
|
#include "../../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/status.h"
|
#include "../../hyperleveldb/status.h"
|
||||||
#include "port/port.h"
|
#include "../../port/port.h"
|
||||||
#include "util/mutexlock.h"
|
#include "../../util/mutexlock.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -380,4 +380,4 @@ Env* NewMemEnv(Env* base_env) {
|
|||||||
return new InMemoryEnv(base_env);
|
return new InMemoryEnv(base_env);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
// 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_HELPERS_MEMENV_MEMENV_H_
|
#ifndef STORAGE_HYPERLEVELDB_HELPERS_MEMENV_MEMENV_H_
|
||||||
#define STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_
|
#define STORAGE_HYPERLEVELDB_HELPERS_MEMENV_MEMENV_H_
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Env;
|
class Env;
|
||||||
|
|
||||||
@@ -15,6 +15,6 @@ class Env;
|
|||||||
// *base_env must remain live while the result is in use.
|
// *base_env must remain live while the result is in use.
|
||||||
Env* NewMemEnv(Env* base_env);
|
Env* NewMemEnv(Env* base_env);
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_
|
#endif // STORAGE_HYPERLEVELDB_HELPERS_MEMENV_MEMENV_H_
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "helpers/memenv/memenv.h"
|
#include "memenv.h"
|
||||||
|
|
||||||
#include "db/db_impl.h"
|
#include "../../db/db_impl.h"
|
||||||
#include "hyperleveldb/db.h"
|
#include "../../hyperleveldb/db.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../../hyperleveldb/env.h"
|
||||||
#include "util/testharness.h"
|
#include "../../util/testharness.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class MemEnvTest {
|
class MemEnvTest {
|
||||||
public:
|
public:
|
||||||
@@ -225,7 +225,7 @@ TEST(MemEnvTest, DBTest) {
|
|||||||
delete db;
|
delete db;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -38,8 +38,8 @@
|
|||||||
(5) All of the pointer arguments must be non-NULL.
|
(5) All of the pointer arguments must be non-NULL.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_INCLUDE_C_H_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_C_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_C_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_C_H_
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@@ -288,4 +288,4 @@ extern int leveldb_minor_version();
|
|||||||
} /* end extern "C" */
|
} /* end extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* STORAGE_LEVELDB_INCLUDE_C_H_ */
|
#endif /* STORAGE_HYPERLEVELDB_INCLUDE_C_H_ */
|
||||||
|
|||||||
@@ -15,13 +15,13 @@
|
|||||||
// they want something more sophisticated (like scan-resistance, a
|
// they want something more sophisticated (like scan-resistance, a
|
||||||
// custom eviction policy, variable cache sizing, etc.)
|
// custom eviction policy, variable cache sizing, etc.)
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_INCLUDE_CACHE_H_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_CACHE_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_CACHE_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_CACHE_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "hyperleveldb/slice.h"
|
#include "slice.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Cache;
|
class Cache;
|
||||||
|
|
||||||
@@ -94,6 +94,6 @@ class Cache {
|
|||||||
void operator=(const Cache&);
|
void operator=(const Cache&);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_CACHE_H_
|
#endif // STORAGE_HYPERLEVELDB_UTIL_CACHE_H_
|
||||||
|
|||||||
@@ -2,12 +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 STORAGE_LEVELDB_INCLUDE_COMPARATOR_H_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_COMPARATOR_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_COMPARATOR_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_COMPARATOR_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Slice;
|
class Slice;
|
||||||
|
|
||||||
@@ -58,6 +58,6 @@ class Comparator {
|
|||||||
// must not be deleted.
|
// must not be deleted.
|
||||||
extern const Comparator* BytewiseComparator();
|
extern const Comparator* BytewiseComparator();
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_COMPARATOR_H_
|
#endif // STORAGE_HYPERLEVELDB_INCLUDE_COMPARATOR_H_
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
// 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_DB_H_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_DB_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_DB_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_DB_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "hyperleveldb/iterator.h"
|
#include "iterator.h"
|
||||||
#include "hyperleveldb/options.h"
|
#include "options.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// Update Makefile if you change these
|
// Update Makefile if you change these
|
||||||
static const int kMajorVersion = 1;
|
static const int kMajorVersion = 1;
|
||||||
@@ -156,6 +156,6 @@ Status DestroyDB(const std::string& name, const Options& options);
|
|||||||
// on a database that contains important information.
|
// on a database that contains important information.
|
||||||
Status RepairDB(const std::string& dbname, const Options& options);
|
Status RepairDB(const std::string& dbname, const Options& options);
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_DB_H_
|
#endif // STORAGE_HYPERLEVELDB_INCLUDE_DB_H_
|
||||||
|
|||||||
@@ -10,16 +10,16 @@
|
|||||||
// All Env implementations are safe for concurrent access from
|
// All Env implementations are safe for concurrent access from
|
||||||
// multiple threads without any external synchronization.
|
// multiple threads without any external synchronization.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_INCLUDE_ENV_H_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_ENV_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_ENV_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_ENV_H_
|
||||||
|
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "hyperleveldb/status.h"
|
#include "status.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class FileLock;
|
class FileLock;
|
||||||
class Logger;
|
class Logger;
|
||||||
@@ -332,6 +332,6 @@ class EnvWrapper : public Env {
|
|||||||
Env* target_;
|
Env* target_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_ENV_H_
|
#endif // STORAGE_HYPERLEVELDB_INCLUDE_ENV_H_
|
||||||
|
|||||||
@@ -13,12 +13,12 @@
|
|||||||
// Most people will want to use the builtin bloom filter support (see
|
// Most people will want to use the builtin bloom filter support (see
|
||||||
// NewBloomFilterPolicy() below).
|
// NewBloomFilterPolicy() below).
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_INCLUDE_FILTER_POLICY_H_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_FILTER_POLICY_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_FILTER_POLICY_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_FILTER_POLICY_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Slice;
|
class Slice;
|
||||||
|
|
||||||
@@ -67,4 +67,4 @@ extern const FilterPolicy* NewBloomFilterPolicy(int bits_per_key);
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_FILTER_POLICY_H_
|
#endif // STORAGE_HYPERLEVELDB_INCLUDE_FILTER_POLICY_H_
|
||||||
|
|||||||
@@ -12,13 +12,13 @@
|
|||||||
// non-const method, all threads accessing the same Iterator must use
|
// non-const method, all threads accessing the same Iterator must use
|
||||||
// external synchronization.
|
// external synchronization.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_INCLUDE_ITERATOR_H_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_ITERATOR_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_ITERATOR_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_ITERATOR_H_
|
||||||
|
|
||||||
#include "hyperleveldb/slice.h"
|
#include "slice.h"
|
||||||
#include "hyperleveldb/status.h"
|
#include "status.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Iterator {
|
class Iterator {
|
||||||
public:
|
public:
|
||||||
@@ -95,6 +95,6 @@ extern Iterator* NewEmptyIterator();
|
|||||||
// Return an empty iterator with the specified status.
|
// Return an empty iterator with the specified status.
|
||||||
extern Iterator* NewErrorIterator(const Status& status);
|
extern Iterator* NewErrorIterator(const Status& status);
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_ITERATOR_H_
|
#endif // STORAGE_HYPERLEVELDB_INCLUDE_ITERATOR_H_
|
||||||
|
|||||||
@@ -2,12 +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 STORAGE_LEVELDB_INCLUDE_OPTIONS_H_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_OPTIONS_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_OPTIONS_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_OPTIONS_H_
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Cache;
|
class Cache;
|
||||||
class Comparator;
|
class Comparator;
|
||||||
@@ -190,6 +190,6 @@ struct WriteOptions {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_OPTIONS_H_
|
#endif // STORAGE_HYPERLEVELDB_INCLUDE_OPTIONS_H_
|
||||||
|
|||||||
@@ -12,15 +12,15 @@
|
|||||||
// non-const method, all threads accessing the same Slice must use
|
// non-const method, all threads accessing the same Slice must use
|
||||||
// external synchronization.
|
// external synchronization.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_INCLUDE_SLICE_H_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_SLICE_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_SLICE_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_SLICE_H_
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Slice {
|
class Slice {
|
||||||
public:
|
public:
|
||||||
@@ -103,7 +103,7 @@ inline int Slice::compare(const Slice& b) const {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_SLICE_H_
|
#endif // STORAGE_HYPERLEVELDB_INCLUDE_SLICE_H_
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
// non-const method, all threads accessing the same Status must use
|
// non-const method, all threads accessing the same Status must use
|
||||||
// external synchronization.
|
// external synchronization.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_INCLUDE_STATUS_H_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_STATUS_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_STATUS_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_STATUS_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "hyperleveldb/slice.h"
|
#include "slice.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Status {
|
class Status {
|
||||||
public:
|
public:
|
||||||
@@ -101,6 +101,6 @@ inline void Status::operator=(const Status& s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_STATUS_H_
|
#endif // STORAGE_HYPERLEVELDB_INCLUDE_STATUS_H_
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_TABLE_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_TABLE_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_TABLE_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "hyperleveldb/iterator.h"
|
#include "iterator.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Block;
|
class Block;
|
||||||
class BlockHandle;
|
class BlockHandle;
|
||||||
@@ -80,6 +80,6 @@ class Table {
|
|||||||
void operator=(const Table&);
|
void operator=(const Table&);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_TABLE_H_
|
#endif // STORAGE_HYPERLEVELDB_INCLUDE_TABLE_H_
|
||||||
|
|||||||
@@ -10,14 +10,14 @@
|
|||||||
// non-const method, all threads accessing the same TableBuilder must use
|
// non-const method, all threads accessing the same TableBuilder must use
|
||||||
// external synchronization.
|
// external synchronization.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_TABLE_BUILDER_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_TABLE_BUILDER_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "hyperleveldb/options.h"
|
#include "options.h"
|
||||||
#include "hyperleveldb/status.h"
|
#include "status.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class BlockBuilder;
|
class BlockBuilder;
|
||||||
class BlockHandle;
|
class BlockHandle;
|
||||||
@@ -87,6 +87,6 @@ class TableBuilder {
|
|||||||
void operator=(const TableBuilder&);
|
void operator=(const TableBuilder&);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_TABLE_BUILDER_H_
|
#endif // STORAGE_HYPERLEVELDB_INCLUDE_TABLE_BUILDER_H_
|
||||||
|
|||||||
@@ -18,13 +18,13 @@
|
|||||||
// non-const method, all threads accessing the same WriteBatch must use
|
// non-const method, all threads accessing the same WriteBatch must use
|
||||||
// external synchronization.
|
// external synchronization.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_INCLUDE_WRITE_BATCH_H_
|
#ifndef STORAGE_HYPERLEVELDB_INCLUDE_WRITE_BATCH_H_
|
||||||
#define STORAGE_LEVELDB_INCLUDE_WRITE_BATCH_H_
|
#define STORAGE_HYPERLEVELDB_INCLUDE_WRITE_BATCH_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "hyperleveldb/status.h"
|
#include "status.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Slice;
|
class Slice;
|
||||||
|
|
||||||
@@ -59,6 +59,6 @@ class WriteBatch {
|
|||||||
// Intentionally copyable
|
// Intentionally copyable
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_INCLUDE_WRITE_BATCH_H_
|
#endif // STORAGE_HYPERLEVELDB_INCLUDE_WRITE_BATCH_H_
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
#define ARCH_CPU_PPC_FAMILY 1
|
#define ARCH_CPU_PPC_FAMILY 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
namespace port {
|
namespace port {
|
||||||
|
|
||||||
// Define MemoryBarrier() if available
|
// Define MemoryBarrier() if available
|
||||||
@@ -219,6 +219,6 @@ class AtomicPointer {
|
|||||||
#undef ARCH_CPU_PPC_FAMILY
|
#undef ARCH_CPU_PPC_FAMILY
|
||||||
|
|
||||||
} // namespace port
|
} // namespace port
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // PORT_ATOMIC_POINTER_H_
|
#endif // PORT_ATOMIC_POINTER_H_
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
// 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_PORT_PORT_H_
|
#ifndef STORAGE_HYPERLEVELDB_PORT_PORT_H_
|
||||||
#define STORAGE_LEVELDB_PORT_PORT_H_
|
#define STORAGE_HYPERLEVELDB_PORT_PORT_H_
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -11,9 +11,9 @@
|
|||||||
// porting to a new platform, see "port_example.h" for documentation
|
// porting to a new platform, see "port_example.h" for documentation
|
||||||
// of what the new port_<platform>.h file must provide.
|
// of what the new port_<platform>.h file must provide.
|
||||||
#if defined(LEVELDB_PLATFORM_POSIX)
|
#if defined(LEVELDB_PLATFORM_POSIX)
|
||||||
# include "port/port_posix.h"
|
# include "port_posix.h"
|
||||||
#elif defined(LEVELDB_PLATFORM_CHROMIUM)
|
#elif defined(LEVELDB_PLATFORM_CHROMIUM)
|
||||||
# include "port/port_chromium.h"
|
# include "port_chromium.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_PORT_PORT_H_
|
#endif // STORAGE_HYPERLEVELDB_PORT_PORT_H_
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
// specific port_<platform>.h file. Use this file as a reference for
|
// specific port_<platform>.h file. Use this file as a reference for
|
||||||
// how to port this package to a new platform.
|
// how to port this package to a new platform.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_PORT_PORT_EXAMPLE_H_
|
#ifndef STORAGE_HYPERLEVELDB_PORT_PORT_EXAMPLE_H_
|
||||||
#define STORAGE_LEVELDB_PORT_PORT_EXAMPLE_H_
|
#define STORAGE_HYPERLEVELDB_PORT_PORT_EXAMPLE_H_
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
namespace port {
|
namespace port {
|
||||||
|
|
||||||
// TODO(jorlow): Many of these belong more in the environment class rather than
|
// TODO(jorlow): Many of these belong more in the environment class rather than
|
||||||
@@ -130,6 +130,6 @@ extern bool Snappy_Uncompress(const char* input_data, size_t input_length,
|
|||||||
extern bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg);
|
extern bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg);
|
||||||
|
|
||||||
} // namespace port
|
} // namespace port
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_PORT_PORT_EXAMPLE_H_
|
#endif // STORAGE_HYPERLEVELDB_PORT_PORT_EXAMPLE_H_
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
namespace port {
|
namespace port {
|
||||||
|
|
||||||
static void PthreadCall(const char* label, int result) {
|
static void PthreadCall(const char* label, int result) {
|
||||||
@@ -51,4 +51,4 @@ void InitOnce(OnceType* once, void (*initializer)()) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace port
|
} // namespace port
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
//
|
//
|
||||||
// See port_example.h for documentation for the following types/functions.
|
// See port_example.h for documentation for the following types/functions.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_PORT_PORT_POSIX_H_
|
#ifndef STORAGE_HYPERLEVELDB_PORT_PORT_POSIX_H_
|
||||||
#define STORAGE_LEVELDB_PORT_PORT_POSIX_H_
|
#define STORAGE_HYPERLEVELDB_PORT_PORT_POSIX_H_
|
||||||
|
|
||||||
#undef PLATFORM_IS_LITTLE_ENDIAN
|
#undef PLATFORM_IS_LITTLE_ENDIAN
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "port/atomic_pointer.h"
|
#include "atomic_pointer.h"
|
||||||
|
|
||||||
#ifndef PLATFORM_IS_LITTLE_ENDIAN
|
#ifndef PLATFORM_IS_LITTLE_ENDIAN
|
||||||
#define PLATFORM_IS_LITTLE_ENDIAN (__BYTE_ORDER == __LITTLE_ENDIAN)
|
#define PLATFORM_IS_LITTLE_ENDIAN (__BYTE_ORDER == __LITTLE_ENDIAN)
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
#define fdatasync fsync
|
#define fdatasync fsync
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
namespace port {
|
namespace port {
|
||||||
|
|
||||||
static const bool kLittleEndian = PLATFORM_IS_LITTLE_ENDIAN;
|
static const bool kLittleEndian = PLATFORM_IS_LITTLE_ENDIAN;
|
||||||
@@ -152,6 +152,6 @@ inline bool GetHeapProfile(void (*func)(void*, const char*, int), void* arg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace port
|
} // namespace port
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_PORT_PORT_POSIX_H_
|
#endif // STORAGE_HYPERLEVELDB_PORT_PORT_POSIX_H_
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H
|
#ifndef STORAGE_HYPERLEVELDB_PORT_THREAD_ANNOTATIONS_H
|
||||||
|
|
||||||
// Some environments provide custom macros to aid in static thread-safety
|
// Some environments provide custom macros to aid in static thread-safety
|
||||||
// analysis. Provide empty definitions of such macros unless they are already
|
// analysis. Provide empty definitions of such macros unless they are already
|
||||||
@@ -56,4 +56,4 @@
|
|||||||
#define NO_THREAD_SAFETY_ANALYSIS
|
#define NO_THREAD_SAFETY_ANALYSIS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H
|
#endif // STORAGE_HYPERLEVELDB_PORT_THREAD_ANNOTATIONS_H
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
|
|
||||||
// MSVC didn't ship with this file until the 2010 version.
|
// MSVC didn't ship with this file until the 2010 version.
|
||||||
|
|
||||||
#ifndef STORAGE_LEVELDB_PORT_WIN_STDINT_H_
|
#ifndef STORAGE_HYPERLEVELDB_PORT_WIN_STDINT_H_
|
||||||
#define STORAGE_LEVELDB_PORT_WIN_STDINT_H_
|
#define STORAGE_HYPERLEVELDB_PORT_WIN_STDINT_H_
|
||||||
|
|
||||||
#if !defined(_MSC_VER)
|
#if !defined(_MSC_VER)
|
||||||
#error This file should only be included when compiling with MSVC.
|
#error This file should only be included when compiling with MSVC.
|
||||||
@@ -21,4 +21,4 @@ typedef unsigned short uint16_t;
|
|||||||
typedef unsigned int uint32_t;
|
typedef unsigned int uint32_t;
|
||||||
typedef unsigned long long uint64_t;
|
typedef unsigned long long uint64_t;
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_PORT_WIN_STDINT_H_
|
#endif // STORAGE_HYPERLEVELDB_PORT_WIN_STDINT_H_
|
||||||
|
|||||||
@@ -4,16 +4,16 @@
|
|||||||
//
|
//
|
||||||
// Decodes the blocks generated by block_builder.cc.
|
// Decodes the blocks generated by block_builder.cc.
|
||||||
|
|
||||||
#include "table/block.h"
|
#include "block.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "hyperleveldb/comparator.h"
|
#include "../hyperleveldb/comparator.h"
|
||||||
#include "table/format.h"
|
#include "format.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
#include "util/logging.h"
|
#include "../util/logging.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
inline uint32_t Block::NumRestarts() const {
|
inline uint32_t Block::NumRestarts() const {
|
||||||
assert(size_ >= sizeof(uint32_t));
|
assert(size_ >= sizeof(uint32_t));
|
||||||
@@ -265,4 +265,4 @@ Iterator* Block::NewIterator(const Comparator* cmp) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_TABLE_BLOCK_H_
|
||||||
#define STORAGE_LEVELDB_TABLE_BLOCK_H_
|
#define STORAGE_HYPERLEVELDB_TABLE_BLOCK_H_
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "hyperleveldb/iterator.h"
|
#include "../hyperleveldb/iterator.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
struct BlockContents;
|
struct BlockContents;
|
||||||
class Comparator;
|
class Comparator;
|
||||||
@@ -39,6 +39,6 @@ class Block {
|
|||||||
class Iter;
|
class Iter;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_BLOCK_H_
|
#endif // STORAGE_HYPERLEVELDB_TABLE_BLOCK_H_
|
||||||
|
|||||||
@@ -26,15 +26,15 @@
|
|||||||
// num_restarts: uint32
|
// num_restarts: uint32
|
||||||
// restarts[i] contains the offset within the block of the ith restart point.
|
// restarts[i] contains the offset within the block of the ith restart point.
|
||||||
|
|
||||||
#include "table/block_builder.h"
|
#include "block_builder.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "hyperleveldb/comparator.h"
|
#include "../hyperleveldb/comparator.h"
|
||||||
#include "hyperleveldb/table_builder.h"
|
#include "../hyperleveldb/table_builder.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
BlockBuilder::BlockBuilder(const Options* options)
|
BlockBuilder::BlockBuilder(const Options* options)
|
||||||
: options_(options),
|
: options_(options),
|
||||||
@@ -106,4 +106,4 @@ void BlockBuilder::Add(const Slice& key, const Slice& value) {
|
|||||||
counter_++;
|
counter_++;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_TABLE_BLOCK_BUILDER_H_
|
||||||
#define STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_
|
#define STORAGE_HYPERLEVELDB_TABLE_BLOCK_BUILDER_H_
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "hyperleveldb/slice.h"
|
#include "../hyperleveldb/slice.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
struct Options;
|
struct Options;
|
||||||
|
|
||||||
@@ -52,6 +52,6 @@ class BlockBuilder {
|
|||||||
void operator=(const BlockBuilder&);
|
void operator=(const BlockBuilder&);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_
|
#endif // STORAGE_HYPERLEVELDB_TABLE_BLOCK_BUILDER_H_
|
||||||
|
|||||||
@@ -2,12 +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.
|
||||||
|
|
||||||
#include "table/filter_block.h"
|
#include "filter_block.h"
|
||||||
|
|
||||||
#include "hyperleveldb/filter_policy.h"
|
#include "../hyperleveldb/filter_policy.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// See doc/table_format.txt for an explanation of the filter block format.
|
// See doc/table_format.txt for an explanation of the filter block format.
|
||||||
|
|
||||||
|
|||||||
@@ -6,17 +6,17 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_TABLE_FILTER_BLOCK_H_
|
||||||
#define STORAGE_LEVELDB_TABLE_FILTER_BLOCK_H_
|
#define STORAGE_HYPERLEVELDB_TABLE_FILTER_BLOCK_H_
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "hyperleveldb/slice.h"
|
#include "../hyperleveldb/slice.h"
|
||||||
#include "util/hash.h"
|
#include "../util/hash.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class FilterPolicy;
|
class FilterPolicy;
|
||||||
|
|
||||||
@@ -65,4 +65,4 @@ class FilterBlockReader {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_FILTER_BLOCK_H_
|
#endif // STORAGE_HYPERLEVELDB_TABLE_FILTER_BLOCK_H_
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "table/filter_block.h"
|
#include "../table/filter_block.h"
|
||||||
|
|
||||||
#include "hyperleveldb/filter_policy.h"
|
#include "../hyperleveldb/filter_policy.h"
|
||||||
#include "util/coding.h"
|
#include "coding.h"
|
||||||
#include "util/hash.h"
|
#include "hash.h"
|
||||||
#include "util/logging.h"
|
#include "logging.h"
|
||||||
#include "util/testharness.h"
|
#include "testharness.h"
|
||||||
#include "util/testutil.h"
|
#include "testutil.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// For testing: emit an array with one hash value per key
|
// For testing: emit an array with one hash value per key
|
||||||
class TestHashFilter : public FilterPolicy {
|
class TestHashFilter : public FilterPolicy {
|
||||||
@@ -121,7 +121,7 @@ TEST(FilterBlockTest, MultiChunk) {
|
|||||||
ASSERT_TRUE(! reader.KeyMayMatch(9000, "bar"));
|
ASSERT_TRUE(! reader.KeyMayMatch(9000, "bar"));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "table/format.h"
|
#include "format.h"
|
||||||
|
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
#include "table/block.h"
|
#include "block.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
#include "util/crc32c.h"
|
#include "../util/crc32c.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
void BlockHandle::EncodeTo(std::string* dst) const {
|
void BlockHandle::EncodeTo(std::string* dst) const {
|
||||||
// Sanity check that all fields have been set
|
// Sanity check that all fields have been set
|
||||||
@@ -142,4 +142,4 @@ Status ReadBlock(RandomAccessFile* file,
|
|||||||
return Status::OK();
|
return Status::OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,16 +2,16 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_TABLE_FORMAT_H_
|
||||||
#define STORAGE_LEVELDB_TABLE_FORMAT_H_
|
#define STORAGE_HYPERLEVELDB_TABLE_FORMAT_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "hyperleveldb/slice.h"
|
#include "../hyperleveldb/slice.h"
|
||||||
#include "hyperleveldb/status.h"
|
#include "../hyperleveldb/status.h"
|
||||||
#include "hyperleveldb/table_builder.h"
|
#include "../hyperleveldb/table_builder.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Block;
|
class Block;
|
||||||
class RandomAccessFile;
|
class RandomAccessFile;
|
||||||
@@ -103,6 +103,6 @@ inline BlockHandle::BlockHandle()
|
|||||||
size_(~static_cast<uint64_t>(0)) {
|
size_(~static_cast<uint64_t>(0)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_FORMAT_H_
|
#endif // STORAGE_HYPERLEVELDB_TABLE_FORMAT_H_
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "hyperleveldb/iterator.h"
|
#include "../hyperleveldb/iterator.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
Iterator::Iterator() {
|
Iterator::Iterator() {
|
||||||
cleanup_.function = NULL;
|
cleanup_.function = NULL;
|
||||||
@@ -64,4 +64,4 @@ Iterator* NewErrorIterator(const Status& status) {
|
|||||||
return new EmptyIterator(status);
|
return new EmptyIterator(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_TABLE_ITERATOR_WRAPPER_H_
|
||||||
#define STORAGE_LEVELDB_TABLE_ITERATOR_WRAPPER_H_
|
#define STORAGE_HYPERLEVELDB_TABLE_ITERATOR_WRAPPER_H_
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// A internal wrapper class with an interface similar to Iterator that
|
// A internal wrapper class with an interface similar to Iterator that
|
||||||
// caches the valid() and key() results for an underlying iterator.
|
// caches the valid() and key() results for an underlying iterator.
|
||||||
@@ -58,6 +58,6 @@ class IteratorWrapper {
|
|||||||
Slice key_;
|
Slice key_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_ITERATOR_WRAPPER_H_
|
#endif // STORAGE_HYPERLEVELDB_TABLE_ITERATOR_WRAPPER_H_
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "table/merger.h"
|
#include "merger.h"
|
||||||
|
|
||||||
#include "hyperleveldb/comparator.h"
|
#include "../hyperleveldb/comparator.h"
|
||||||
#include "hyperleveldb/iterator.h"
|
#include "../hyperleveldb/iterator.h"
|
||||||
#include "table/iterator_wrapper.h"
|
#include "iterator_wrapper.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
class MergingIterator : public Iterator {
|
class MergingIterator : public Iterator {
|
||||||
@@ -194,4 +194,4 @@ Iterator* NewMergingIterator(const Comparator* cmp, Iterator** list, int n) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_TABLE_MERGER_H_
|
||||||
#define STORAGE_LEVELDB_TABLE_MERGER_H_
|
#define STORAGE_HYPERLEVELDB_TABLE_MERGER_H_
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Comparator;
|
class Comparator;
|
||||||
class Iterator;
|
class Iterator;
|
||||||
@@ -21,6 +21,6 @@ class Iterator;
|
|||||||
extern Iterator* NewMergingIterator(
|
extern Iterator* NewMergingIterator(
|
||||||
const Comparator* comparator, Iterator** children, int n);
|
const Comparator* comparator, Iterator** children, int n);
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_MERGER_H_
|
#endif // STORAGE_HYPERLEVELDB_TABLE_MERGER_H_
|
||||||
|
|||||||
@@ -2,20 +2,20 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "hyperleveldb/table.h"
|
#include "../hyperleveldb/table.h"
|
||||||
|
|
||||||
#include "hyperleveldb/cache.h"
|
#include "../hyperleveldb/cache.h"
|
||||||
#include "hyperleveldb/comparator.h"
|
#include "../hyperleveldb/comparator.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/filter_policy.h"
|
#include "../hyperleveldb/filter_policy.h"
|
||||||
#include "hyperleveldb/options.h"
|
#include "../hyperleveldb/options.h"
|
||||||
#include "table/block.h"
|
#include "block.h"
|
||||||
#include "table/filter_block.h"
|
#include "filter_block.h"
|
||||||
#include "table/format.h"
|
#include "format.h"
|
||||||
#include "table/two_level_iterator.h"
|
#include "two_level_iterator.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
struct Table::Rep {
|
struct Table::Rep {
|
||||||
~Rep() {
|
~Rep() {
|
||||||
@@ -272,4 +272,4 @@ uint64_t Table::ApproximateOffsetOf(const Slice& key) const {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,20 +2,20 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "hyperleveldb/table_builder.h"
|
#include "../hyperleveldb/table_builder.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "hyperleveldb/comparator.h"
|
#include "../hyperleveldb/comparator.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/filter_policy.h"
|
#include "../hyperleveldb/filter_policy.h"
|
||||||
#include "hyperleveldb/options.h"
|
#include "../hyperleveldb/options.h"
|
||||||
#include "table/block_builder.h"
|
#include "block_builder.h"
|
||||||
#include "table/filter_block.h"
|
#include "filter_block.h"
|
||||||
#include "table/format.h"
|
#include "format.h"
|
||||||
#include "util/coding.h"
|
#include "../util/coding.h"
|
||||||
#include "util/crc32c.h"
|
#include "../util/crc32c.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
struct TableBuilder::Rep {
|
struct TableBuilder::Rep {
|
||||||
Options options;
|
Options options;
|
||||||
@@ -266,4 +266,4 @@ uint64_t TableBuilder::FileSize() const {
|
|||||||
return rep_->offset;
|
return rep_->offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -6,21 +6,21 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "db/dbformat.h"
|
#include "../db/dbformat.h"
|
||||||
#include "db/memtable.h"
|
#include "../db/memtable.h"
|
||||||
#include "db/write_batch_internal.h"
|
#include "../db/write_batch_internal.h"
|
||||||
#include "hyperleveldb/db.h"
|
#include "../hyperleveldb/db.h"
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/iterator.h"
|
#include "../hyperleveldb/iterator.h"
|
||||||
#include "hyperleveldb/table_builder.h"
|
#include "../hyperleveldb/table_builder.h"
|
||||||
#include "table/block.h"
|
#include "block.h"
|
||||||
#include "table/block_builder.h"
|
#include "block_builder.h"
|
||||||
#include "table/format.h"
|
#include "format.h"
|
||||||
#include "util/random.h"
|
#include "../util/random.h"
|
||||||
#include "util/testharness.h"
|
#include "../util/testharness.h"
|
||||||
#include "util/testutil.h"
|
#include "../util/testutil.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// Return reverse of "key".
|
// Return reverse of "key".
|
||||||
// Used to test non-lexicographic comparators.
|
// Used to test non-lexicographic comparators.
|
||||||
@@ -869,7 +869,7 @@ TEST(TableTest, ApproximateOffsetOfCompressed) {
|
|||||||
ASSERT_TRUE(Between(c.ApproximateOffsetOf("xyz"), 4000, 6000));
|
ASSERT_TRUE(Between(c.ApproximateOffsetOf("xyz"), 4000, 6000));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "table/two_level_iterator.h"
|
#include "two_level_iterator.h"
|
||||||
|
|
||||||
#include "hyperleveldb/table.h"
|
#include "../hyperleveldb/table.h"
|
||||||
#include "table/block.h"
|
#include "block.h"
|
||||||
#include "table/format.h"
|
#include "format.h"
|
||||||
#include "table/iterator_wrapper.h"
|
#include "iterator_wrapper.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -179,4 +179,4 @@ Iterator* NewTwoLevelIterator(
|
|||||||
return new TwoLevelIterator(index_iter, block_function, arg, options);
|
return new TwoLevelIterator(index_iter, block_function, arg, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,12 +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 STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
|
#ifndef STORAGE_HYPERLEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
|
||||||
#define STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
|
#define STORAGE_HYPERLEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
|
||||||
|
|
||||||
#include "hyperleveldb/iterator.h"
|
#include "../hyperleveldb/iterator.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
struct ReadOptions;
|
struct ReadOptions;
|
||||||
|
|
||||||
@@ -29,6 +29,6 @@ extern Iterator* NewTwoLevelIterator(
|
|||||||
void* arg,
|
void* arg,
|
||||||
const ReadOptions& options);
|
const ReadOptions& options);
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
|
#endif // STORAGE_HYPERLEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "util/arena.h"
|
#include "arena.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
static const int kBlockSize = 4096;
|
static const int kBlockSize = 4096;
|
||||||
|
|
||||||
@@ -65,4 +65,4 @@ char* Arena::AllocateNewBlock(size_t block_bytes) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
// 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_ARENA_H_
|
#ifndef STORAGE_HYPERLEVELDB_UTIL_ARENA_H_
|
||||||
#define STORAGE_LEVELDB_UTIL_ARENA_H_
|
#define STORAGE_HYPERLEVELDB_UTIL_ARENA_H_
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Arena {
|
class Arena {
|
||||||
public:
|
public:
|
||||||
@@ -63,6 +63,6 @@ inline char* Arena::Allocate(size_t bytes) {
|
|||||||
return AllocateFallback(bytes);
|
return AllocateFallback(bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_ARENA_H_
|
#endif // STORAGE_HYPERLEVELDB_UTIL_ARENA_H_
|
||||||
|
|||||||
@@ -2,12 +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.
|
||||||
|
|
||||||
#include "util/arena.h"
|
#include "arena.h"
|
||||||
|
|
||||||
#include "util/random.h"
|
#include "random.h"
|
||||||
#include "util/testharness.h"
|
#include "testharness.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class ArenaTest { };
|
class ArenaTest { };
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ TEST(ArenaTest, Simple) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -2,12 +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.
|
||||||
|
|
||||||
#include "hyperleveldb/filter_policy.h"
|
#include "../hyperleveldb/filter_policy.h"
|
||||||
|
|
||||||
#include "hyperleveldb/slice.h"
|
#include "../hyperleveldb/slice.h"
|
||||||
#include "util/hash.h"
|
#include "hash.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
static uint32_t BloomHash(const Slice& key) {
|
static uint32_t BloomHash(const Slice& key) {
|
||||||
@@ -92,4 +92,4 @@ const FilterPolicy* NewBloomFilterPolicy(int bits_per_key) {
|
|||||||
return new BloomFilterPolicy(bits_per_key);
|
return new BloomFilterPolicy(bits_per_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "hyperleveldb/filter_policy.h"
|
#include "../hyperleveldb/filter_policy.h"
|
||||||
|
|
||||||
#include "util/coding.h"
|
#include "coding.h"
|
||||||
#include "util/logging.h"
|
#include "logging.h"
|
||||||
#include "util/testharness.h"
|
#include "testharness.h"
|
||||||
#include "util/testutil.h"
|
#include "testutil.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
static const int kVerbose = 1;
|
static const int kVerbose = 1;
|
||||||
|
|
||||||
@@ -153,7 +153,7 @@ TEST(BloomTest, VaryingLengths) {
|
|||||||
|
|
||||||
// Different bits-per-byte
|
// Different bits-per-byte
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -6,12 +6,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "hyperleveldb/cache.h"
|
#include "../hyperleveldb/cache.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
#include "util/hash.h"
|
#include "hash.h"
|
||||||
#include "util/mutexlock.h"
|
#include "mutexlock.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
Cache::~Cache() {
|
Cache::~Cache() {
|
||||||
}
|
}
|
||||||
@@ -322,4 +322,4 @@ Cache* NewLRUCache(size_t capacity) {
|
|||||||
return new ShardedLRUCache(capacity);
|
return new ShardedLRUCache(capacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "hyperleveldb/cache.h"
|
#include "../hyperleveldb/cache.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "util/coding.h"
|
#include "coding.h"
|
||||||
#include "util/testharness.h"
|
#include "testharness.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// Conversions between numeric keys/values and the types expected by Cache.
|
// Conversions between numeric keys/values and the types expected by Cache.
|
||||||
static std::string EncodeKey(int k) {
|
static std::string EncodeKey(int k) {
|
||||||
@@ -179,7 +179,7 @@ TEST(CacheTest, NewId) {
|
|||||||
ASSERT_NE(a, b);
|
ASSERT_NE(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "util/coding.h"
|
#include "coding.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
void EncodeFixed32(char* buf, uint32_t value) {
|
void EncodeFixed32(char* buf, uint32_t value) {
|
||||||
if (port::kLittleEndian) {
|
if (port::kLittleEndian) {
|
||||||
@@ -191,4 +191,4 @@ bool GetLengthPrefixedSlice(Slice* input, Slice* result) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -7,16 +7,16 @@
|
|||||||
// * 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_
|
#ifndef STORAGE_HYPERLEVELDB_UTIL_CODING_H_
|
||||||
#define STORAGE_LEVELDB_UTIL_CODING_H_
|
#define STORAGE_HYPERLEVELDB_UTIL_CODING_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "hyperleveldb/slice.h"
|
#include "../hyperleveldb/slice.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
// Standard Put... routines append to a string
|
// Standard Put... routines append to a string
|
||||||
extern void PutFixed32(std::string* dst, uint32_t value);
|
extern void PutFixed32(std::string* dst, uint32_t value);
|
||||||
@@ -99,6 +99,6 @@ inline const char* GetVarint32Ptr(const char* p,
|
|||||||
return GetVarint32PtrFallback(p, limit, value);
|
return GetVarint32PtrFallback(p, limit, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_CODING_H_
|
#endif // STORAGE_HYPERLEVELDB_UTIL_CODING_H_
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "util/coding.h"
|
#include "coding.h"
|
||||||
|
|
||||||
#include "util/testharness.h"
|
#include "testharness.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
class Coding { };
|
class Coding { };
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ TEST(Coding, Strings) {
|
|||||||
ASSERT_EQ("", input.ToString());
|
ASSERT_EQ("", input.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "hyperleveldb/comparator.h"
|
#include "../hyperleveldb/comparator.h"
|
||||||
#include "hyperleveldb/slice.h"
|
#include "../hyperleveldb/slice.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
#include "util/logging.h"
|
#include "logging.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
Comparator::~Comparator() { }
|
Comparator::~Comparator() { }
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ class BytewiseComparatorImpl : public Comparator {
|
|||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
static port::OnceType once = LEVELDB_ONCE_INIT;
|
static port::OnceType onceComparator = LEVELDB_ONCE_INIT;
|
||||||
static const Comparator* bytewise;
|
static const Comparator* bytewise;
|
||||||
|
|
||||||
static void InitModule() {
|
static void InitModule() {
|
||||||
@@ -74,8 +74,8 @@ static void InitModule() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Comparator* BytewiseComparator() {
|
const Comparator* BytewiseComparator() {
|
||||||
port::InitOnce(&once, InitModule);
|
port::InitOnce(&onceComparator, InitModule);
|
||||||
return bytewise;
|
return bytewise;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -5,12 +5,12 @@
|
|||||||
// A portable implementation of crc32c, optimized to handle
|
// A portable implementation of crc32c, optimized to handle
|
||||||
// four bytes at a time.
|
// four bytes at a time.
|
||||||
|
|
||||||
#include "util/crc32c.h"
|
#include "crc32c.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "util/coding.h"
|
#include "coding.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
namespace crc32c {
|
namespace crc32c {
|
||||||
|
|
||||||
static const uint32_t table0_[256] = {
|
static const uint32_t table0_[256] = {
|
||||||
@@ -329,4 +329,4 @@ uint32_t Extend(uint32_t crc, const char* buf, size_t size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace crc32c
|
} // namespace crc32c
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
// 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_
|
#ifndef STORAGE_HYPERLEVELDB_UTIL_CRC32C_H_
|
||||||
#define STORAGE_LEVELDB_UTIL_CRC32C_H_
|
#define STORAGE_HYPERLEVELDB_UTIL_CRC32C_H_
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
namespace crc32c {
|
namespace crc32c {
|
||||||
|
|
||||||
// Return the crc32c of concat(A, data[0,n-1]) where init_crc is the
|
// Return the crc32c of concat(A, data[0,n-1]) where init_crc is the
|
||||||
@@ -40,6 +40,6 @@ inline uint32_t Unmask(uint32_t masked_crc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace crc32c
|
} // namespace crc32c
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
#endif // STORAGE_LEVELDB_UTIL_CRC32C_H_
|
#endif // STORAGE_HYPERLEVELDB_UTIL_CRC32C_H_
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "util/crc32c.h"
|
#include "crc32c.h"
|
||||||
#include "util/testharness.h"
|
#include "testharness.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
namespace crc32c {
|
namespace crc32c {
|
||||||
|
|
||||||
class CRC { };
|
class CRC { };
|
||||||
@@ -65,7 +65,7 @@ TEST(CRC, Mask) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace crc32c
|
} // namespace crc32c
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
return leveldb::test::RunAllTests();
|
return leveldb::test::RunAllTests();
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
// found in the LICENSE file. See the AUTHORS file for names of contributors.
|
||||||
|
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
Env::~Env() {
|
Env::~Env() {
|
||||||
}
|
}
|
||||||
@@ -93,4 +93,4 @@ Status ReadFileToString(Env* env, const std::string& fname, std::string* data) {
|
|||||||
EnvWrapper::~EnvWrapper() {
|
EnvWrapper::~EnvWrapper() {
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
@@ -20,14 +20,14 @@
|
|||||||
#if defined(LEVELDB_PLATFORM_ANDROID)
|
#if defined(LEVELDB_PLATFORM_ANDROID)
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
#include "hyperleveldb/env.h"
|
#include "../hyperleveldb/env.h"
|
||||||
#include "hyperleveldb/slice.h"
|
#include "../hyperleveldb/slice.h"
|
||||||
#include "port/port.h"
|
#include "../port/port.h"
|
||||||
#include "util/logging.h"
|
#include "logging.h"
|
||||||
#include "util/mutexlock.h"
|
#include "mutexlock.h"
|
||||||
#include "util/posix_logger.h"
|
#include "posix_logger.h"
|
||||||
|
|
||||||
namespace leveldb {
|
namespace hyperleveldb {
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -686,13 +686,13 @@ void PosixEnv::StartThread(void (*function)(void* arg), void* arg) {
|
|||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
static pthread_once_t once = PTHREAD_ONCE_INIT;
|
static pthread_once_t oncePosix = PTHREAD_ONCE_INIT;
|
||||||
static Env* default_env;
|
static Env* default_env;
|
||||||
static void InitDefaultEnv() { default_env = new PosixEnv; }
|
static void InitDefaultEnv() { default_env = new PosixEnv; }
|
||||||
|
|
||||||
Env* Env::Default() {
|
Env* Env::Default() {
|
||||||
pthread_once(&once, InitDefaultEnv);
|
pthread_once(&oncePosix, InitDefaultEnv);
|
||||||
return default_env;
|
return default_env;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace leveldb
|
} // namespace hyperleveldb
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user