From eb6d13966681412a2d89d2b932257dfbf66bfb58 Mon Sep 17 00:00:00 2001 From: Haobo Xu Date: Mon, 22 Apr 2013 15:20:20 -0700 Subject: [PATCH] [RocksDB] Move table.h to table/ Summary: - don't see a point exposing table.h to the public. - fixed make clean to remove also *.d files. Test Plan: make check; db_stress Reviewers: dhruba, heyongqiang Reviewed By: dhruba CC: leveldb Differential Revision: https://reviews.facebook.net/D10479 --- Makefile | 2 +- db/corruption_test.cc | 2 +- db/db_impl.cc | 2 +- db/db_impl_readonly.cc | 2 +- db/db_test.cc | 2 +- db/table_cache.cc | 2 +- db/table_cache.h | 2 +- table/block_test.cc | 12 +++++------- table/table.cc | 3 +-- {include/leveldb => table}/table.h | 0 table/table_test.cc | 4 +--- table/two_level_iterator.cc | 2 +- tools/sst_dump.cc | 2 +- 13 files changed, 16 insertions(+), 21 deletions(-) rename {include/leveldb => table}/table.h (100%) diff --git a/Makefile b/Makefile index a9d78046d1..53b3e538e4 100644 --- a/Makefile +++ b/Makefile @@ -132,7 +132,7 @@ valgrind_check: all $(PROGRAMS) $(TESTS) done clean: - -rm -f $(PROGRAMS) $(BENCHMARKS) $(LIBRARY) $(SHARED) $(MEMENVLIBRARY) $(THRIFTSERVER) */*.o */*/*.o ios-x86/*/*.o ios-arm/*/*.o build_config.mk + -rm -f $(PROGRAMS) $(BENCHMARKS) $(LIBRARY) $(SHARED) $(MEMENVLIBRARY) $(THRIFTSERVER) */*.o */*/*.o ios-x86/*/*.o ios-arm/*/*.o build_config.mk */*.d */*/*.d -rm -rf ios-x86/* ios-arm/* $(LIBRARY): $(LIBOBJECTS) diff --git a/db/corruption_test.cc b/db/corruption_test.cc index e3ee98fd1d..3be2b6ab38 100644 --- a/db/corruption_test.cc +++ b/db/corruption_test.cc @@ -10,12 +10,12 @@ #include #include "leveldb/cache.h" #include "leveldb/env.h" -#include "leveldb/table.h" #include "leveldb/write_batch.h" #include "db/db_impl.h" #include "db/filename.h" #include "db/log_format.h" #include "db/version_set.h" +#include "table/table.h" #include "util/logging.h" #include "util/testharness.h" #include "util/testutil.h" diff --git a/db/db_impl.cc b/db/db_impl.cc index 5d05aa981d..54f6d34dd2 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -29,11 +29,11 @@ #include "leveldb/env.h" #include "leveldb/statistics.h" #include "leveldb/status.h" -#include "leveldb/table.h" #include "leveldb/table_builder.h" #include "port/port.h" #include "table/block.h" #include "table/merger.h" +#include "table/table.h" #include "table/two_level_iterator.h" #include "util/auto_roll_logger.h" #include "util/build_version.h" diff --git a/db/db_impl_readonly.cc b/db/db_impl_readonly.cc index 28d9be454d..2ec52970bb 100644 --- a/db/db_impl_readonly.cc +++ b/db/db_impl_readonly.cc @@ -24,11 +24,11 @@ #include "leveldb/db.h" #include "leveldb/env.h" #include "leveldb/status.h" -#include "leveldb/table.h" #include "leveldb/table_builder.h" #include "port/port.h" #include "table/block.h" #include "table/merger.h" +#include "table/table.h" #include "table/two_level_iterator.h" #include "util/coding.h" #include "util/logging.h" diff --git a/db/db_test.cc b/db/db_test.cc index 550b221c53..b1ebd9004b 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -13,7 +13,7 @@ #include "db/write_batch_internal.h" #include "leveldb/cache.h" #include "leveldb/env.h" -#include "leveldb/table.h" +#include "table/table.h" #include "util/hash.h" #include "util/logging.h" #include "util/mutexlock.h" diff --git a/db/table_cache.cc b/db/table_cache.cc index 0894d5baba..729d470188 100644 --- a/db/table_cache.cc +++ b/db/table_cache.cc @@ -6,8 +6,8 @@ #include "db/filename.h" -#include "leveldb/table.h" #include "leveldb/statistics.h" +#include "table/table.h" #include "util/coding.h" namespace leveldb { diff --git a/db/table_cache.h b/db/table_cache.h index 6c6ed1e438..7b5dcc04dd 100644 --- a/db/table_cache.h +++ b/db/table_cache.h @@ -12,8 +12,8 @@ #include "db/dbformat.h" #include "leveldb/env.h" #include "leveldb/cache.h" -#include "leveldb/table.h" #include "port/port.h" +#include "table/table.h" #include "util/storage_options.h" namespace leveldb { diff --git a/table/block_test.cc b/table/block_test.cc index 92154ac0e1..2434a629c5 100644 --- a/table/block_test.cc +++ b/table/block_test.cc @@ -1,9 +1,6 @@ // Copyright (c) 2012 Facebook. // 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. - -#include "leveldb/table.h" - #include #include "db/dbformat.h" #include "db/memtable.h" @@ -14,6 +11,7 @@ #include "leveldb/table_builder.h" #include "table/block.h" #include "table/block_builder.h" +#include "table/table.h" #include "table/format.h" #include "util/random.h" #include "util/testharness.h" @@ -60,7 +58,7 @@ TEST(BlockTest, SimpleTest) { // read serialized contents of the block Slice rawblock = builder.Finish(); - // create block reader + // create block reader BlockContents contents; contents.data = rawblock; contents.cachable = false; @@ -71,7 +69,7 @@ TEST(BlockTest, SimpleTest) { int count = 0; Iterator* iter = reader.NewIterator(options.comparator); for (iter->SeekToFirst();iter->Valid(); count++, iter->Next()) { - + // read kv from block Slice k = iter->key(); Slice v = iter->value(); @@ -81,8 +79,8 @@ TEST(BlockTest, SimpleTest) { ASSERT_EQ(v.ToString().compare(values[count]), 0); } delete iter; - - // read block contents randomly + + // read block contents randomly iter = reader.NewIterator(options.comparator); for (int i = 0; i < num_records; i++) { diff --git a/table/table.cc b/table/table.cc index 33200243c3..9bf72f76dd 100644 --- a/table/table.cc +++ b/table/table.cc @@ -2,8 +2,6 @@ // 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. -#include "leveldb/table.h" - #include "leveldb/cache.h" #include "leveldb/comparator.h" #include "leveldb/env.h" @@ -13,6 +11,7 @@ #include "table/block.h" #include "table/filter_block.h" #include "table/format.h" +#include "table/table.h" #include "table/two_level_iterator.h" #include "util/coding.h" diff --git a/include/leveldb/table.h b/table/table.h similarity index 100% rename from include/leveldb/table.h rename to table/table.h diff --git a/table/table_test.cc b/table/table_test.cc index 2afdd84016..5770eacb55 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -1,9 +1,6 @@ // Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. - -#include "leveldb/table.h" - #include #include #include "db/dbformat.h" @@ -16,6 +13,7 @@ #include "table/block.h" #include "table/block_builder.h" #include "table/format.h" +#include "table/table.h" #include "util/random.h" #include "util/testharness.h" #include "util/testutil.h" diff --git a/table/two_level_iterator.cc b/table/two_level_iterator.cc index 049ce59bef..3d99897394 100644 --- a/table/two_level_iterator.cc +++ b/table/two_level_iterator.cc @@ -4,9 +4,9 @@ #include "table/two_level_iterator.h" -#include "leveldb/table.h" #include "table/block.h" #include "table/format.h" +#include "table/table.h" #include "table/iterator_wrapper.h" namespace leveldb { diff --git a/tools/sst_dump.cc b/tools/sst_dump.cc index f24e148d23..b606fa51de 100644 --- a/tools/sst_dump.cc +++ b/tools/sst_dump.cc @@ -1,4 +1,4 @@ -#include "leveldb/table.h" +#include "table/table.h" #include #include