From 63e507c59cee3e2d810eafe68b7e9d6883b5de7d Mon Sep 17 00:00:00 2001 From: Venkatesh Radhakrishnan Date: Wed, 14 Oct 2015 17:08:28 -0700 Subject: [PATCH] Move ldb and sst_dump from utils to tools. Summary: As part of cleaning up dependencies for tech debt week, we are moving ldb and sst_dump tools from util to tools, since they are tools. Test Plan: make check Reviewers: sdong Reviewed By: sdong Subscribers: dhruba Differential Revision: https://reviews.facebook.net/D48747 --- CMakeLists.txt | 10 +++++----- Makefile | 4 ++-- src.mk | 12 ++++++------ {util => tools}/ldb_cmd.cc | 4 ++-- {util => tools}/ldb_cmd.h | 2 +- {util => tools}/ldb_cmd_execute_result.h | 0 {util => tools}/ldb_cmd_test.cc | 2 +- {util => tools}/ldb_tool.cc | 2 +- tools/reduce_levels_test.cc | 2 +- {util => tools}/sst_dump_test.cc | 0 {util => tools}/sst_dump_tool.cc | 2 +- {util => tools}/sst_dump_tool_imp.h | 4 ++-- 12 files changed, 22 insertions(+), 22 deletions(-) rename {util => tools}/ldb_cmd.cc (99%) rename {util => tools}/ldb_cmd.h (99%) rename {util => tools}/ldb_cmd_execute_result.h (100%) rename {util => tools}/ldb_cmd_test.cc (98%) rename {util => tools}/ldb_tool.cc (99%) rename {util => tools}/sst_dump_test.cc (100%) rename {util => tools}/sst_dump_tool.cc (99%) rename {util => tools}/sst_dump_tool_imp.h (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8ad791e0..9b3d4d523 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -164,6 +164,7 @@ set(SOURCES table/plain_table_reader.cc table/table_properties.cc table/two_level_iterator.cc + tools/sst_dump_tool.cc tools/dump/db_dump_tool.cc util/arena.cc util/auto_roll_logger.cc @@ -190,8 +191,8 @@ set(SOURCES util/histogram.cc util/instrumented_mutex.cc util/iostats_context.cc - util/ldb_cmd.cc - util/ldb_tool.cc + tools/ldb_cmd.cc + tools/ldb_tool.cc util/logging.cc util/log_buffer.cc util/memenv.cc @@ -207,7 +208,6 @@ set(SOURCES util/rate_limiter.cc util/skiplistrep.cc util/slice.cc - util/sst_dump_tool.cc util/statistics.cc util/status.cc util/status_message.cc @@ -327,7 +327,9 @@ set(TESTS table/merger_test.cc table/table_test.cc tools/db_sanity_test.cc + tools/ldb_cmd_test.cc tools/reduce_levels_test.cc + tools/sst_dump_test.cc util/arena_test.cc util/autovector_test.cc util/auto_roll_logger_test.cc @@ -342,13 +344,11 @@ set(TESTS util/file_reader_writer_test.cc util/heap_test.cc util/histogram_test.cc - util/ldb_cmd_test.cc util/memenv_test.cc util/mock_env_test.cc util/options_test.cc util/rate_limiter_test.cc util/slice_transform_test.cc - util/sst_dump_test.cc util/thread_list_test.cc util/thread_local_test.cc utilities/backupable/backupable_db_test.cc diff --git a/Makefile b/Makefile index b4ccc1dc5..909a8618d 100644 --- a/Makefile +++ b/Makefile @@ -904,7 +904,7 @@ options_test: util/options_test.o $(LIBOBJECTS) $(TESTHARNESS) event_logger_test: util/event_logger_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) -sst_dump_test: util/sst_dump_test.o $(LIBOBJECTS) $(TESTHARNESS) +sst_dump_test: tools/sst_dump_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) memenv_test : util/memenv_test.o $(LIBOBJECTS) $(TESTHARNESS) @@ -940,7 +940,7 @@ transaction_test: utilities/transactions/transaction_test.o $(LIBOBJECTS) $(TEST sst_dump: tools/sst_dump.o $(LIBOBJECTS) $(AM_LINK) -ldb_cmd_test: util/ldb_cmd_test.o $(LIBOBJECTS) $(TESTHARNESS) +ldb_cmd_test: tools/ldb_cmd_test.o $(LIBOBJECTS) $(TESTHARNESS) $(AM_LINK) ldb: tools/ldb.o $(LIBOBJECTS) diff --git a/src.mk b/src.mk index 717bbae20..c975b7e6b 100644 --- a/src.mk +++ b/src.mk @@ -161,9 +161,9 @@ LIB_SOURCES = \ util/xxhash.cc \ TOOL_SOURCES = \ - util/ldb_cmd.cc \ - util/ldb_tool.cc \ - util/sst_dump_tool.cc \ + tools/ldb_cmd.cc \ + tools/ldb_tool.cc \ + tools/sst_dump_tool.cc \ MOCK_SOURCES = \ table/mock_table.cc \ @@ -224,7 +224,9 @@ TEST_BENCH_SOURCES = \ table/table_reader_bench.cc \ table/table_test.cc \ tools/db_sanity_test.cc \ + tools/ldb_cmd_test.cc \ tools/reduce_levels_test.cc \ + tools/sst_dump_test.cc \ util/arena_test.cc \ util/auto_roll_logger_test.cc \ util/autovector_test.cc \ @@ -259,12 +261,10 @@ TEST_BENCH_SOURCES = \ util/event_logger_test.cc \ util/rate_limiter_test.cc \ util/slice_transform_test.cc \ - util/sst_dump_test.cc \ util/testharness.cc \ util/testutil.cc \ util/thread_list_test.cc \ - util/thread_local_test.cc \ - util/ldb_cmd_test.cc + util/thread_local_test.cc JNI_NATIVE_SOURCES = \ java/rocksjni/backupenginejni.cc \ diff --git a/util/ldb_cmd.cc b/tools/ldb_cmd.cc similarity index 99% rename from util/ldb_cmd.cc rename to tools/ldb_cmd.cc index 44900b06d..112014351 100644 --- a/util/ldb_cmd.cc +++ b/tools/ldb_cmd.cc @@ -4,7 +4,7 @@ // of patent rights can be found in the PATENTS file in the same directory. // #ifndef ROCKSDB_LITE -#include "util/ldb_cmd.h" +#include "tools/ldb_cmd.h" #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS @@ -23,8 +23,8 @@ #include "rocksdb/table_properties.h" #include "table/scoped_arena_iterator.h" #include "port/dirent.h" +#include "tools/sst_dump_tool_imp.h" #include "util/coding.h" -#include "util/sst_dump_tool_imp.h" #include "util/string_util.h" #include "utilities/ttl/db_ttl_impl.h" diff --git a/util/ldb_cmd.h b/tools/ldb_cmd.h similarity index 99% rename from util/ldb_cmd.h rename to tools/ldb_cmd.h index d48fcf667..71d5f647b 100644 --- a/util/ldb_cmd.h +++ b/tools/ldb_cmd.h @@ -23,8 +23,8 @@ #include "rocksdb/options.h" #include "rocksdb/slice.h" #include "rocksdb/utilities/db_ttl.h" +#include "tools/ldb_cmd_execute_result.h" #include "util/logging.h" -#include "util/ldb_cmd_execute_result.h" #include "util/string_util.h" #include "utilities/ttl/db_ttl_impl.h" diff --git a/util/ldb_cmd_execute_result.h b/tools/ldb_cmd_execute_result.h similarity index 100% rename from util/ldb_cmd_execute_result.h rename to tools/ldb_cmd_execute_result.h diff --git a/util/ldb_cmd_test.cc b/tools/ldb_cmd_test.cc similarity index 98% rename from util/ldb_cmd_test.cc rename to tools/ldb_cmd_test.cc index c918cf565..7cba8948c 100644 --- a/util/ldb_cmd_test.cc +++ b/tools/ldb_cmd_test.cc @@ -3,7 +3,7 @@ // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. // -#include "util/ldb_cmd.h" +#include "tools/ldb_cmd.h" #include "util/testharness.h" class LdbCmdTest : public testing::Test {}; diff --git a/util/ldb_tool.cc b/tools/ldb_tool.cc similarity index 99% rename from util/ldb_tool.cc rename to tools/ldb_tool.cc index fe84fa933..366202c2d 100644 --- a/util/ldb_tool.cc +++ b/tools/ldb_tool.cc @@ -5,7 +5,7 @@ // #ifndef ROCKSDB_LITE #include "rocksdb/ldb_tool.h" -#include "util/ldb_cmd.h" +#include "tools/ldb_cmd.h" namespace rocksdb { diff --git a/tools/reduce_levels_test.cc b/tools/reduce_levels_test.cc index f3091edbb..863d8607e 100644 --- a/tools/reduce_levels_test.cc +++ b/tools/reduce_levels_test.cc @@ -9,10 +9,10 @@ #include "rocksdb/db.h" #include "db/db_impl.h" #include "db/version_set.h" +#include "tools/ldb_cmd.h" #include "util/logging.h" #include "util/testutil.h" #include "util/testharness.h" -#include "util/ldb_cmd.h" namespace rocksdb { diff --git a/util/sst_dump_test.cc b/tools/sst_dump_test.cc similarity index 100% rename from util/sst_dump_test.cc rename to tools/sst_dump_test.cc diff --git a/util/sst_dump_tool.cc b/tools/sst_dump_tool.cc similarity index 99% rename from util/sst_dump_tool.cc rename to tools/sst_dump_tool.cc index e3bbe8cd2..ae22da36d 100644 --- a/util/sst_dump_tool.cc +++ b/tools/sst_dump_tool.cc @@ -5,7 +5,7 @@ // #ifndef ROCKSDB_LITE -#include "util/sst_dump_tool_imp.h" +#include "tools/sst_dump_tool_imp.h" #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS diff --git a/util/sst_dump_tool_imp.h b/tools/sst_dump_tool_imp.h similarity index 99% rename from util/sst_dump_tool_imp.h rename to tools/sst_dump_tool_imp.h index b7d9e4dc2..dd65d3b10 100644 --- a/util/sst_dump_tool_imp.h +++ b/tools/sst_dump_tool_imp.h @@ -2,8 +2,8 @@ // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. -#ifndef ROCKSDB_LITE #pragma once +#ifndef ROCKSDB_LITE #include "rocksdb/sst_dump_tool.h" @@ -29,8 +29,8 @@ #include "table/format.h" #include "table/meta_blocks.h" #include "table/plain_table_factory.h" +#include "tools/ldb_cmd.h" #include "util/file_reader_writer.h" -#include "util/ldb_cmd.h" #include "util/random.h" #include "util/testharness.h" #include "util/testutil.h"