Skip to content

Commit

Permalink
Divide file_reader_writer.h and .cc (facebook#5803)
Browse files Browse the repository at this point in the history
Summary:
file_reader_writer.h and .cc contain several files and helper function, and it's hard to navigate. Separate it to multiple files and put them under file/
Pull Request resolved: facebook#5803

Test Plan: Build whole project using make and cmake.

Differential Revision: D17374550

fbshipit-source-id: 10efca907721e7a78ed25bbf74dc5410dea05987
  • Loading branch information
siying authored and facebook-github-bot committed Sep 16, 2019
1 parent 915d72d commit b931f84
Show file tree
Hide file tree
Showing 79 changed files with 1,799 additions and 1,559 deletions.
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,15 @@ set(SOURCES
env/env_hdfs.cc
env/mock_env.cc
file/delete_scheduler.cc
file/file_prefetch_buffer.cc
file/file_util.cc
file/filename.cc
file/random_access_file_reader.cc
file/read_write_util.cc
file/readahead_raf.cc
file/sequence_file_reader.cc
file/sst_file_manager_impl.cc
file/writable_file_writer.cc
logging/auto_roll_logger.cc
logging/event_logger.cc
logging/log_buffer.cc
Expand Down Expand Up @@ -639,7 +645,6 @@ set(SOURCES
util/concurrent_task_limiter_impl.cc
util/crc32c.cc
util/dynamic_bloom.cc
util/file_reader_writer.cc
util/filter_policy.cc
util/hash.cc
util/murmurhash.cc
Expand Down
7 changes: 6 additions & 1 deletion TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,15 @@ cpp_library(
"env/io_posix.cc",
"env/mock_env.cc",
"file/delete_scheduler.cc",
"file/file_prefetch_buffer.cc",
"file/file_util.cc",
"file/filename.cc",
"file/random_access_file_reader.cc",
"file/read_write_util.cc",
"file/readahead_raf.cc",
"file/sequence_file_reader.cc",
"file/sst_file_manager_impl.cc",
"file/writable_file_writer.cc",
"logging/auto_roll_logger.cc",
"logging/event_logger.cc",
"logging/log_buffer.cc",
Expand Down Expand Up @@ -267,7 +273,6 @@ cpp_library(
"util/concurrent_task_limiter_impl.cc",
"util/crc32c.cc",
"util/dynamic_bloom.cc",
"util/file_reader_writer.cc",
"util/filter_policy.cc",
"util/hash.cc",
"util/murmurhash.cc",
Expand Down
3 changes: 2 additions & 1 deletion db/builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "db/table_cache.h"
#include "db/version_edit.h"
#include "file/filename.h"
#include "file/read_write_util.h"
#include "file/writable_file_writer.h"
#include "monitoring/iostats_context_imp.h"
#include "monitoring/thread_status_util.h"
#include "rocksdb/db.h"
Expand All @@ -33,7 +35,6 @@
#include "table/format.h"
#include "table/internal_iterator.h"
#include "test_util/sync_point.h"
#include "util/file_reader_writer.h"
#include "util/stop_watch.h"

namespace rocksdb {
Expand Down
3 changes: 2 additions & 1 deletion db/compaction/compaction_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
#include "db/range_del_aggregator.h"
#include "db/version_set.h"
#include "file/filename.h"
#include "file/read_write_util.h"
#include "file/sst_file_manager_impl.h"
#include "file/writable_file_writer.h"
#include "logging/log_buffer.h"
#include "logging/logging.h"
#include "monitoring/iostats_context_imp.h"
Expand All @@ -52,7 +54,6 @@
#include "table/table_builder.h"
#include "test_util/sync_point.h"
#include "util/coding.h"
#include "util/file_reader_writer.h"
#include "util/mutexlock.h"
#include "util/random.h"
#include "util/stop_watch.h"
Expand Down
2 changes: 1 addition & 1 deletion db/compaction/compaction_job_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
#include "db/db_impl/db_impl.h"
#include "db/error_handler.h"
#include "db/version_set.h"
#include "file/writable_file_writer.h"
#include "rocksdb/cache.h"
#include "rocksdb/db.h"
#include "rocksdb/options.h"
#include "rocksdb/write_buffer_manager.h"
#include "table/mock_table.h"
#include "test_util/testharness.h"
#include "test_util/testutil.h"
#include "util/file_reader_writer.h"
#include "util/string_util.h"
#include "utilities/merge_operators.h"

Expand Down
2 changes: 1 addition & 1 deletion db/db_impl/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
#include "db/write_callback.h"
#include "file/file_util.h"
#include "file/filename.h"
#include "file/random_access_file_reader.h"
#include "file/sst_file_manager_impl.h"
#include "logging/auto_roll_logger.h"
#include "logging/log_buffer.h"
Expand Down Expand Up @@ -96,7 +97,6 @@
#include "util/coding.h"
#include "util/compression.h"
#include "util/crc32c.h"
#include "util/file_reader_writer.h"
#include "util/mutexlock.h"
#include "util/stop_watch.h"
#include "util/string_util.h"
Expand Down
2 changes: 2 additions & 0 deletions db/db_impl/db_impl_open.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

#include "db/builder.h"
#include "db/error_handler.h"
#include "file/read_write_util.h"
#include "file/sst_file_manager_impl.h"
#include "file/writable_file_writer.h"
#include "monitoring/persistent_stats_history.h"
#include "options/options_helper.h"
#include "rocksdb/wal_filter.h"
Expand Down
1 change: 0 additions & 1 deletion db/db_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
#include "test_util/testharness.h"
#include "test_util/testutil.h"
#include "util/compression.h"
#include "util/file_reader_writer.h"
#include "util/mutexlock.h"
#include "util/rate_limiter.h"
#include "util/string_util.h"
Expand Down
2 changes: 1 addition & 1 deletion db/external_sst_file_ingestion_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
#include "db/db_impl/db_impl.h"
#include "db/version_edit.h"
#include "file/file_util.h"
#include "file/random_access_file_reader.h"
#include "table/merging_iterator.h"
#include "table/scoped_arena_iterator.h"
#include "table/sst_file_writer_collectors.h"
#include "table/table_builder.h"
#include "test_util/sync_point.h"
#include "util/file_reader_writer.h"
#include "util/stop_watch.h"

namespace rocksdb {
Expand Down
2 changes: 1 addition & 1 deletion db/flush_job_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
#include "db/db_impl/db_impl.h"
#include "db/flush_job.h"
#include "db/version_set.h"
#include "file/writable_file_writer.h"
#include "rocksdb/cache.h"
#include "rocksdb/write_buffer_manager.h"
#include "table/mock_table.h"
#include "test_util/testharness.h"
#include "test_util/testutil.h"
#include "util/file_reader_writer.h"
#include "util/string_util.h"

namespace rocksdb {
Expand Down
2 changes: 1 addition & 1 deletion db/import_column_family_job.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

#include "db/version_edit.h"
#include "file/file_util.h"
#include "file/random_access_file_reader.h"
#include "table/merging_iterator.h"
#include "table/scoped_arena_iterator.h"
#include "table/sst_file_writer_collectors.h"
#include "table/table_builder.h"
#include "util/file_reader_writer.h"
#include "util/stop_watch.h"

namespace rocksdb {
Expand Down
3 changes: 2 additions & 1 deletion db/log_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
#include "db/log_reader.h"

#include <stdio.h>
#include "file/sequence_file_reader.h"
#include "rocksdb/env.h"
#include "test_util/sync_point.h"
#include "util/coding.h"
#include "util/crc32c.h"
#include "util/file_reader_writer.h"
#include "util/util.h"

namespace rocksdb {
Expand Down
5 changes: 2 additions & 3 deletions db/log_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
#include <stdint.h>

#include "db/log_format.h"
#include "file/sequence_file_reader.h"
#include "rocksdb/options.h"
#include "rocksdb/slice.h"
#include "rocksdb/status.h"
#include "rocksdb/options.h"

namespace rocksdb {

class SequentialFileReader;
class Logger;

namespace log {
Expand Down
3 changes: 2 additions & 1 deletion db/log_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@

#include "db/log_reader.h"
#include "db/log_writer.h"
#include "file/sequence_file_reader.h"
#include "file/writable_file_writer.h"
#include "rocksdb/env.h"
#include "test_util/testharness.h"
#include "test_util/testutil.h"
#include "util/coding.h"
#include "util/crc32c.h"
#include "util/file_reader_writer.h"
#include "util/random.h"

namespace rocksdb {
Expand Down
2 changes: 1 addition & 1 deletion db/log_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#include "db/log_writer.h"

#include <stdint.h>
#include "file/writable_file_writer.h"
#include "rocksdb/env.h"
#include "util/coding.h"
#include "util/crc32c.h"
#include "util/file_reader_writer.h"

namespace rocksdb {
namespace log {
Expand Down
2 changes: 1 addition & 1 deletion db/repair.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@
#include "db/version_edit.h"
#include "db/write_batch_internal.h"
#include "file/filename.h"
#include "file/writable_file_writer.h"
#include "options/cf_options.h"
#include "rocksdb/comparator.h"
#include "rocksdb/db.h"
#include "rocksdb/env.h"
#include "rocksdb/options.h"
#include "rocksdb/write_buffer_manager.h"
#include "table/scoped_arena_iterator.h"
#include "util/file_reader_writer.h"
#include "util/string_util.h"

namespace rocksdb {
Expand Down
3 changes: 1 addition & 2 deletions db/table_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "db/snapshot_impl.h"
#include "db/version_edit.h"
#include "file/filename.h"

#include "file/random_access_file_reader.h"
#include "monitoring/perf_context_imp.h"
#include "rocksdb/statistics.h"
#include "table/block_based/block_based_table_reader.h"
Expand All @@ -27,7 +27,6 @@
#include "test_util/sync_point.h"
#include "util/cast_util.h"
#include "util/coding.h"
#include "util/file_reader_writer.h"
#include "util/stop_watch.h"

namespace rocksdb {
Expand Down
6 changes: 3 additions & 3 deletions db/table_properties_collector_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
#include <utility>
#include <vector>

#include "db/db_impl/db_impl.h"
#include "db/dbformat.h"
#include "db/table_properties_collector.h"

#include "db/db_impl/db_impl.h"
#include "file/sequence_file_reader.h"
#include "file/writable_file_writer.h"
#include "options/cf_options.h"
#include "rocksdb/table.h"
#include "table/block_based/block_based_table_factory.h"
Expand All @@ -22,7 +23,6 @@
#include "test_util/testharness.h"
#include "test_util/testutil.h"
#include "util/coding.h"
#include "util/file_reader_writer.h"

namespace rocksdb {

Expand Down
2 changes: 1 addition & 1 deletion db/transaction_log_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "db/transaction_log_impl.h"
#include <cinttypes>
#include "db/write_batch_internal.h"
#include "util/file_reader_writer.h"
#include "file/sequence_file_reader.h"

namespace rocksdb {

Expand Down
4 changes: 3 additions & 1 deletion db/version_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
#include "db/table_cache.h"
#include "db/version_builder.h"
#include "file/filename.h"
#include "file/random_access_file_reader.h"
#include "file/read_write_util.h"
#include "file/writable_file_writer.h"
#include "monitoring/file_read_sample.h"
#include "monitoring/perf_context_imp.h"
#include "monitoring/persistent_stats_history.h"
Expand All @@ -47,7 +50,6 @@
#include "table/two_level_iterator.h"
#include "test_util/sync_point.h"
#include "util/coding.h"
#include "util/file_reader_writer.h"
#include "util/stop_watch.h"
#include "util/string_util.h"
#include "util/user_comparator_wrapper.h"
Expand Down
2 changes: 1 addition & 1 deletion db/wal_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "db/write_batch_internal.h"
#include "file/file_util.h"
#include "file/filename.h"
#include "file/sequence_file_reader.h"
#include "logging/logging.h"
#include "port/port.h"
#include "rocksdb/env.h"
Expand All @@ -28,7 +29,6 @@
#include "test_util/sync_point.h"
#include "util/cast_util.h"
#include "util/coding.h"
#include "util/file_reader_writer.h"
#include "util/mutexlock.h"
#include "util/string_util.h"

Expand Down
2 changes: 1 addition & 1 deletion db/wal_manager_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#include "db/version_set.h"
#include "db/wal_manager.h"
#include "env/mock_env.h"
#include "file/writable_file_writer.h"
#include "table/mock_table.h"
#include "test_util/testharness.h"
#include "test_util/testutil.h"
#include "util/file_reader_writer.h"
#include "util/string_util.h"

namespace rocksdb {
Expand Down
Loading

0 comments on commit b931f84

Please sign in to comment.