Move auto_roll_logger and filename out of db/

Summary:
It is confusing to have auto_roll_logger to stay under db/, which has nothing to do with database. Move filename together as it is a dependency.
Closes https://github.com/facebook/rocksdb/pull/2080

Differential Revision: D4821141

Pulled By: siying

fbshipit-source-id: ca7d768
This commit is contained in:
Siying Dong 2017-04-03 18:27:24 -07:00 committed by Facebook Github Bot
parent a1c469d719
commit 6ef8c620d3
45 changed files with 70 additions and 74 deletions

View File

@ -281,7 +281,6 @@ add_subdirectory(third-party/gtest-1.7.0/fused-src/gtest)
# Main library source code
set(SOURCES
db/auto_roll_logger.cc
db/builder.cc
db/c.cc
db/column_family.cc
@ -302,7 +301,6 @@ set(SOURCES
db/event_helpers.cc
db/external_sst_file_ingestion_job.cc
db/experimental.cc
db/filename.cc
db/file_indexer.cc
db/flush_job.cc
db/flush_scheduler.cc
@ -387,6 +385,7 @@ set(SOURCES
util/event_logger.cc
util/file_util.cc
util/file_reader_writer.cc
util/filename.cc
util/sst_file_manager_impl.cc
util/filter_policy.cc
util/hash.cc
@ -398,6 +397,7 @@ set(SOURCES
util/lru_cache.cc
tools/ldb_cmd.cc
tools/ldb_tool.cc
util/auto_roll_logger.cc
util/logging.cc
util/log_buffer.cc
util/memenv.cc
@ -544,7 +544,6 @@ else()
endif()
set(TESTS
db/auto_roll_logger_test.cc
db/column_family_test.cc
db/compact_files_test.cc
db/compaction_iterator_test.cc
@ -618,6 +617,7 @@ set(TESTS
tools/reduce_levels_test.cc
tools/sst_dump_test.cc
util/arena_test.cc
util/auto_roll_logger_test.cc
util/autovector_test.cc
util/bloom_test.cc
util/cache_test.cc

View File

@ -1285,7 +1285,7 @@ manual_compaction_test: db/manual_compaction_test.o $(LIBOBJECTS) $(TESTHARNESS)
filelock_test: util/filelock_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(AM_LINK)
auto_roll_logger_test: db/auto_roll_logger_test.o $(LIBOBJECTS) $(TESTHARNESS)
auto_roll_logger_test: util/auto_roll_logger_test.o $(LIBOBJECTS) $(TESTHARNESS)
$(AM_LINK)
memtable_list_test: db/memtable_list_test.o $(LIBOBJECTS) $(TESTHARNESS)

View File

@ -16,7 +16,6 @@
#include "db/compaction_iterator.h"
#include "db/dbformat.h"
#include "db/event_helpers.h"
#include "db/filename.h"
#include "db/internal_stats.h"
#include "db/merge_helper.h"
#include "db/table_cache.h"
@ -29,6 +28,7 @@
#include "table/block_based_table_builder.h"
#include "table/internal_iterator.h"
#include "util/file_reader_writer.h"
#include "util/filename.h"
#include "util/iostats_context_imp.h"
#include "util/stop_watch.h"
#include "util/thread_status_util.h"

View File

@ -28,7 +28,6 @@
#include "db/db_iter.h"
#include "db/dbformat.h"
#include "db/event_helpers.h"
#include "db/filename.h"
#include "db/log_reader.h"
#include "db/log_writer.h"
#include "db/memtable.h"
@ -49,12 +48,13 @@
#include "table/table_builder.h"
#include "util/coding.h"
#include "util/file_reader_writer.h"
#include "util/filename.h"
#include "util/iostats_context_imp.h"
#include "util/log_buffer.h"
#include "util/logging.h"
#include "util/sst_file_manager_impl.h"
#include "util/mutexlock.h"
#include "util/perf_context_imp.h"
#include "util/sst_file_manager_impl.h"
#include "util/stop_watch.h"
#include "util/string_util.h"
#include "util/sync_point.h"

View File

@ -23,7 +23,6 @@
#include "db/db_impl.h"
#include "db/dbformat.h"
#include "db/filename.h"
#include "db/job_context.h"
#include "db/version_set.h"
#include "db/write_batch_internal.h"
@ -50,6 +49,7 @@
#include "table/plain_table_factory.h"
#include "table/scoped_arena_iterator.h"
#include "util/compression.h"
#include "util/filename.h"
#include "util/hash.h"
#include "util/logging.h"
#include "util/mock_env.h"

View File

@ -19,7 +19,7 @@
#include <string>
#include <utility>
#include "db/column_family.h"
#include "db/filename.h"
#include "util/filename.h"
#include "util/log_buffer.h"
#include "util/random.h"
#include "util/statistics.h"

View File

@ -11,19 +11,19 @@
#include "rocksdb/db.h"
#include <inttypes.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "db/db_impl.h"
#include "db/log_format.h"
#include "db/version_set.h"
#include "rocksdb/cache.h"
#include "rocksdb/env.h"
#include "rocksdb/table.h"
#include "rocksdb/write_batch.h"
#include "db/db_impl.h"
#include "db/filename.h"
#include "db/log_format.h"
#include "db/version_set.h"
#include "util/filename.h"
#include "util/logging.h"
#include "util/testharness.h"
#include "util/testutil.h"

View File

@ -18,13 +18,13 @@
#include <algorithm>
#include <string>
#include "db/db_impl.h"
#include "db/filename.h"
#include "db/job_context.h"
#include "db/version_set.h"
#include "port/port.h"
#include "rocksdb/db.h"
#include "rocksdb/env.h"
#include "util/file_util.h"
#include "util/filename.h"
#include "util/mutexlock.h"
#include "util/sync_point.h"

View File

@ -32,7 +32,6 @@
#include <utility>
#include <vector>
#include "db/auto_roll_logger.h"
#include "db/builder.h"
#include "db/compaction_job.h"
#include "db/db_info_dumper.h"
@ -40,7 +39,6 @@
#include "db/dbformat.h"
#include "db/event_helpers.h"
#include "db/external_sst_file_ingestion_job.h"
#include "db/filename.h"
#include "db/flush_job.h"
#include "db/forward_iterator.h"
#include "db/job_context.h"
@ -78,6 +76,7 @@
#include "table/merging_iterator.h"
#include "table/table_builder.h"
#include "table/two_level_iterator.h"
#include "util/auto_roll_logger.h"
#include "util/autovector.h"
#include "util/build_version.h"
#include "util/cf_options.h"
@ -86,6 +85,7 @@
#include "util/crc32c.h"
#include "util/file_reader_writer.h"
#include "util/file_util.h"
#include "util/filename.h"
#include "util/iostats_context_imp.h"
#include "util/log_buffer.h"
#include "util/logging.h"

View File

@ -15,8 +15,8 @@
#include <algorithm>
#include <vector>
#include "db/filename.h"
#include "rocksdb/env.h"
#include "util/filename.h"
namespace rocksdb {

View File

@ -14,7 +14,6 @@
#include <limits>
#include "db/dbformat.h"
#include "db/filename.h"
#include "db/merge_context.h"
#include "db/merge_helper.h"
#include "db/pinned_iterators_manager.h"
@ -25,6 +24,7 @@
#include "rocksdb/options.h"
#include "table/internal_iterator.h"
#include "util/arena.h"
#include "util/filename.h"
#include "util/logging.h"
#include "util/mutexlock.h"
#include "util/perf_context_imp.h"

View File

@ -26,7 +26,6 @@
#include "db/db_impl.h"
#include "db/db_test_util.h"
#include "db/dbformat.h"
#include "db/filename.h"
#include "db/job_context.h"
#include "db/version_set.h"
#include "db/write_batch_internal.h"
@ -57,6 +56,7 @@
#include "table/scoped_arena_iterator.h"
#include "util/compression.h"
#include "util/file_reader_writer.h"
#include "util/filename.h"
#include "util/hash.h"
#include "util/logging.h"
#include "util/mock_env.h"

View File

@ -26,7 +26,6 @@
#include "db/db_impl.h"
#include "db/dbformat.h"
#include "db/filename.h"
#include "memtable/hash_linklist_rep.h"
#include "rocksdb/cache.h"
#include "rocksdb/compaction_filter.h"
@ -45,6 +44,7 @@
#include "table/plain_table_factory.h"
#include "table/scoped_arena_iterator.h"
#include "util/compression.h"
#include "util/filename.h"
#include "util/mock_env.h"
#include "util/mutexlock.h"

View File

@ -14,12 +14,12 @@
#include <string>
#include <vector>
#include "db/db_impl.h"
#include "db/filename.h"
#include "db/version_set.h"
#include "db/write_batch_internal.h"
#include "rocksdb/db.h"
#include "rocksdb/env.h"
#include "rocksdb/transaction_log.h"
#include "util/filename.h"
#include "util/string_util.h"
#include "util/sync_point.h"
#include "util/testharness.h"

View File

@ -12,7 +12,6 @@
// file data (or entire files) not protected by a "sync".
#include "db/db_impl.h"
#include "db/filename.h"
#include "db/log_format.h"
#include "db/version_set.h"
#include "rocksdb/cache.h"
@ -21,6 +20,7 @@
#include "rocksdb/table.h"
#include "rocksdb/write_batch.h"
#include "util/fault_injection_test_env.h"
#include "util/filename.h"
#include "util/logging.h"
#include "util/mock_env.h"
#include "util/mutexlock.h"

View File

@ -7,7 +7,7 @@
// 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 "db/filename.h"
#include "util/filename.h"
#include "db/dbformat.h"
#include "port/port.h"

View File

@ -22,7 +22,6 @@
#include "db/db_iter.h"
#include "db/dbformat.h"
#include "db/event_helpers.h"
#include "db/filename.h"
#include "db/log_reader.h"
#include "db/log_writer.h"
#include "db/memtable.h"
@ -44,6 +43,7 @@
#include "util/coding.h"
#include "util/event_logger.h"
#include "util/file_util.h"
#include "util/filename.h"
#include "util/iostats_context_imp.h"
#include "util/log_buffer.h"
#include "util/logging.h"

View File

@ -6,7 +6,6 @@
#include "db/db_impl.h"
#include "db/db_test_util.h"
#include "db/dbformat.h"
#include "db/filename.h"
#include "db/version_set.h"
#include "db/write_batch_internal.h"
#include "memtable/hash_linklist_rep.h"
@ -23,6 +22,7 @@
#include "rocksdb/table_properties.h"
#include "table/block_based_table_factory.h"
#include "table/plain_table_factory.h"
#include "util/filename.h"
#include "util/hash.h"
#include "util/logging.h"
#include "util/mutexlock.h"

View File

@ -12,7 +12,6 @@
#include <deque>
#include "db/dbformat.h"
#include "db/filename.h"
#include "db/memtable.h"
#include "db/range_del_aggregator.h"
#include "db/skiplist.h"
@ -21,6 +20,7 @@
#include "rocksdb/options.h"
#include "rocksdb/types.h"
#include "util/autovector.h"
#include "util/filename.h"
#include "util/instrumented_mutex.h"
#include "util/log_buffer.h"

View File

@ -15,7 +15,6 @@
#include <set>
#include "db/db_impl.h"
#include "db/filename.h"
#include "db/version_set.h"
#include "db/write_batch_internal.h"
#include "rocksdb/cache.h"
@ -25,12 +24,13 @@
#include "rocksdb/filter_policy.h"
#include "rocksdb/slice_transform.h"
#include "rocksdb/table.h"
#include "table/meta_blocks.h"
#include "table/bloom_block.h"
#include "table/table_builder.h"
#include "table/meta_blocks.h"
#include "table/plain_table_factory.h"
#include "table/plain_table_key_coding.h"
#include "table/plain_table_reader.h"
#include "table/table_builder.h"
#include "util/filename.h"
#include "util/hash.h"
#include "util/logging.h"
#include "util/mutexlock.h"

View File

@ -68,7 +68,6 @@
#include "db/builder.h"
#include "db/db_impl.h"
#include "db/dbformat.h"
#include "db/filename.h"
#include "db/log_reader.h"
#include "db/log_writer.h"
#include "db/memtable.h"
@ -83,6 +82,7 @@
#include "table/scoped_arena_iterator.h"
#include "util/cf_options.h"
#include "util/file_reader_writer.h"
#include "util/filename.h"
#include "util/string_util.h"
namespace rocksdb {

View File

@ -10,8 +10,8 @@
#include "db/table_cache.h"
#include "db/dbformat.h"
#include "db/filename.h"
#include "db/version_edit.h"
#include "util/filename.h"
#include "rocksdb/statistics.h"
#include "table/internal_iterator.h"

View File

@ -7,7 +7,6 @@
#ifndef ROCKSDB_LITE
#include <vector>
#include "db/filename.h"
#include "db/log_reader.h"
#include "db/version_set.h"
#include "port/port.h"
@ -16,6 +15,7 @@
#include "rocksdb/transaction_log.h"
#include "rocksdb/types.h"
#include "util/db_options.h"
#include "util/filename.h"
namespace rocksdb {

View File

@ -16,14 +16,13 @@
#include <inttypes.h>
#include <stdio.h>
#include <algorithm>
#include <climits>
#include <map>
#include <set>
#include <climits>
#include <string>
#include <unordered_map>
#include <vector>
#include <string>
#include "db/compaction.h"
#include "db/filename.h"
#include "db/internal_stats.h"
#include "db/log_reader.h"
#include "db/log_writer.h"
@ -46,6 +45,7 @@
#include "table/two_level_iterator.h"
#include "util/coding.h"
#include "util/file_reader_writer.h"
#include "util/filename.h"
#include "util/logging.h"
#include "util/perf_context_imp.h"
#include "util/stop_watch.h"

View File

@ -18,10 +18,9 @@
#include <vector>
#include <memory>
#include "db/filename.h"
#include "db/transaction_log_impl.h"
#include "db/log_reader.h"
#include "db/log_writer.h"
#include "db/transaction_log_impl.h"
#include "db/write_batch_internal.h"
#include "port/port.h"
#include "rocksdb/env.h"
@ -29,10 +28,11 @@
#include "rocksdb/write_batch.h"
#include "util/coding.h"
#include "util/file_reader_writer.h"
#include "util/filename.h"
#include "util/logging.h"
#include "util/mutexlock.h"
#include "util/sync_point.h"
#include "util/string_util.h"
#include "util/sync_point.h"
namespace rocksdb {

6
src.mk
View File

@ -1,6 +1,5 @@
# These are the sources from which librocksdb.a is built:
LIB_SOURCES = \
db/auto_roll_logger.cc \
db/builder.cc \
db/c.cc \
db/column_family.cc \
@ -23,7 +22,6 @@ LIB_SOURCES = \
db/experimental.cc \
db/event_helpers.cc \
db/file_indexer.cc \
db/filename.cc \
db/flush_job.cc \
db/flush_scheduler.cc \
db/forward_iterator.cc \
@ -88,6 +86,7 @@ LIB_SOURCES = \
table/two_level_iterator.cc \
tools/dump/db_dump_tool.cc \
util/arena.cc \
util/auto_roll_logger.cc \
util/bloom.cc \
util/build_version.cc \
util/cf_options.cc \
@ -107,6 +106,7 @@ LIB_SOURCES = \
util/event_logger.cc \
util/file_util.cc \
util/file_reader_writer.cc \
util/filename.cc \
util/filter_policy.cc \
util/hash.cc \
util/histogram.cc \
@ -211,7 +211,6 @@ TEST_LIB_SOURCES = \
MAIN_SOURCES = \
third-party/gtest-1.7.0/fused-src/gtest/gtest-all.cc \
db/auto_roll_logger_test.cc \
db/column_family_test.cc \
db/compaction_job_test.cc \
db/compaction_job_stats_test.cc \
@ -283,6 +282,7 @@ MAIN_SOURCES = \
tools/reduce_levels_test.cc \
tools/sst_dump_test.cc \
util/arena_test.cc \
util/auto_roll_logger_test.cc \
util/autovector_test.cc \
util/bloom_test.cc \
util/cache_bench.cc \

View File

@ -14,7 +14,6 @@
#include "db/db_impl.h"
#include "db/dbformat.h"
#include "db/filename.h"
#include "db/log_reader.h"
#include "db/write_batch_internal.h"
#include "port/dirent.h"
@ -29,6 +28,7 @@
#include "tools/ldb_cmd_impl.h"
#include "tools/sst_dump_tool_imp.h"
#include "util/coding.h"
#include "util/filename.h"
#include "util/stderr_logger.h"
#include "util/string_util.h"
#include "utilities/ttl/db_ttl_impl.h"

View File

@ -4,10 +4,10 @@
#include <v8.h>
#include <node.h>
#include "db_wrapper.h"
#include "db/_wrapper.h"
#include "rocksdb/db.h"
#include "rocksdb/slice.h"
#include "rocksdb/options.h"
#include "rocksdb/slice.h"
namespace {
void printWithBackSlashes(std::string str) {

View File

@ -2,9 +2,9 @@
#define BUILDING_NODE_EXTENSION
#endif
#include <v8.h>
#include <node.h>
#include "db_wrapper.h"
#include <v8.h>
#include "db/_wrapper.h"
using namespace v8;

View File

@ -66,13 +66,12 @@ int main() {
#include <string>
#include <thread>
#include "db/filename.h"
#include "port/port.h"
#include "rocksdb/db.h"
#include "rocksdb/env.h"
#include "rocksdb/options.h"
#include "rocksdb/slice.h"
#include "util/filename.h"
using GFLAGS::ParseCommandLineFlags;
using GFLAGS::RegisterFlagValidator;

View File

@ -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 "db/auto_roll_logger.h"
#include "util/auto_roll_logger.h"
#include "util/mutexlock.h"
namespace rocksdb {

View File

@ -10,11 +10,11 @@
#include <list>
#include <string>
#include "db/filename.h"
#include "port/port.h"
#include "port/util_logger.h"
#include "util/sync_point.h"
#include "util/filename.h"
#include "util/mutexlock.h"
#include "util/sync_point.h"
namespace rocksdb {

View File

@ -6,7 +6,7 @@
#ifndef ROCKSDB_LITE
#include "db/auto_roll_logger.h"
#include "util/auto_roll_logger.h"
#include <errno.h>
#include <sys/stat.h>
#include <algorithm>
@ -17,7 +17,6 @@
#include <string>
#include <thread>
#include <vector>
#include "db/db_test_util.h"
#include "port/port.h"
#include "rocksdb/db.h"
#include "util/logging.h"

View File

@ -18,10 +18,10 @@
#include <set>
#include <string>
#include "db/filename.h"
#include "db/version_set.h"
#include "rocksdb/db.h"
#include "rocksdb/env.h"
#include "util/filename.h"
#include "util/mock_env.h"
#include "util/mutexlock.h"

View File

@ -10,13 +10,12 @@
#define __STDC_FORMAT_MACROS
#endif
#include "db/filename.h"
#include "util/filename.h"
#include <inttypes.h>
#include <ctype.h>
#include <stdio.h>
#include <vector>
#include "db/dbformat.h"
#include "rocksdb/env.h"
#include "util/file_reader_writer.h"
#include "util/logging.h"

View File

@ -10,16 +10,16 @@
#ifndef ROCKSDB_LITE
#include "rocksdb/utilities/backupable_db.h"
#include "db/filename.h"
#include "port/port.h"
#include "rocksdb/rate_limiter.h"
#include "rocksdb/transaction_log.h"
#include "util/channel.h"
#include "util/coding.h"
#include "util/crc32c.h"
#include "util/file_reader_writer.h"
#include "util/filename.h"
#include "util/logging.h"
#include "util/string_util.h"
#include "rocksdb/rate_limiter.h"
#include "rocksdb/transaction_log.h"
#include "port/port.h"
#include "util/sync_point.h"
#ifndef __STDC_FORMAT_MACROS

View File

@ -13,7 +13,6 @@
#include <string>
#include "db/db_impl.h"
#include "db/filename.h"
#include "port/port.h"
#include "port/stack_trace.h"
#include "rocksdb/rate_limiter.h"
@ -23,6 +22,7 @@
#include "rocksdb/utilities/options_util.h"
#include "util/env_chroot.h"
#include "util/file_reader_writer.h"
#include "util/filename.h"
#include "util/mutexlock.h"
#include "util/random.h"
#include "util/stderr_logger.h"

View File

@ -4,7 +4,6 @@
#include "utilities/blob_db/blob_db.h"
#ifndef ROCKSDB_LITE
#include "db/filename.h"
#include "db/write_batch_internal.h"
#include "rocksdb/convenience.h"
#include "rocksdb/env.h"
@ -16,6 +15,7 @@
#include "util/cf_options.h"
#include "util/crc32c.h"
#include "util/file_reader_writer.h"
#include "util/filename.h"
#include "util/instrumented_mutex.h"
namespace rocksdb {

View File

@ -18,14 +18,14 @@
#include <inttypes.h>
#include <algorithm>
#include <string>
#include "db/filename.h"
#include "db/wal_manager.h"
#include "port/port.h"
#include "rocksdb/db.h"
#include "rocksdb/env.h"
#include "rocksdb/transaction_log.h"
#include "util/file_util.h"
#include "util/filename.h"
#include "util/sync_point.h"
#include "port/port.h"
namespace rocksdb {

View File

@ -7,9 +7,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "db/filename.h"
#include "rocksdb/env.h"
#include "rocksdb/utilities/info_log_finder.h"
#include "rocksdb/env.h"
#include "util/filename.h"
namespace rocksdb {

View File

@ -9,7 +9,6 @@
#include "db/db_impl.h"
#include "db/db_iter.h"
#include "db/filename.h"
#include "db/write_batch_internal.h"
#include "rocksdb/convenience.h"
#include "rocksdb/env.h"
@ -17,6 +16,7 @@
#include "rocksdb/utilities/date_tiered_db.h"
#include "table/merging_iterator.h"
#include "util/coding.h"
#include "util/filename.h"
#include "util/instrumented_mutex.h"
#include "util/options_helper.h"
#include "util/string_util.h"

View File

@ -11,15 +11,14 @@
#define __STDC_FORMAT_MACROS
#endif
#include <vector>
#include <limits>
#include <map>
#include <string>
#include <limits>
#include "db/filename.h"
#include <vector>
#include "util/coding.h"
#include "util/filename.h"
#include "util/string_util.h"
//
// There are two types of keys. The first type of key-values
// maps a geo location to the set of object ids and their values.

View File

@ -7,8 +7,8 @@
#include "rocksdb/utilities/options_util.h"
#include "db/filename.h"
#include "rocksdb/options.h"
#include "util/filename.h"
#include "util/options_parser.h"
namespace rocksdb {

View File

@ -5,13 +5,13 @@
#include "utilities/ttl/db_ttl_impl.h"
#include "db/filename.h"
#include "db/write_batch_internal.h"
#include "rocksdb/convenience.h"
#include "rocksdb/env.h"
#include "rocksdb/iterator.h"
#include "rocksdb/utilities/db_ttl.h"
#include "util/coding.h"
#include "util/filename.h"
namespace rocksdb {