Skip to content

Commit

Permalink
Moving Some includes from options.h to forward declaration
Browse files Browse the repository at this point in the history
Summary: By removing some includes form options.h and reply on forward declaration, we can more easily reason the dependencies.

Test Plan: make all check

Reviewers: kailiu, haobo, igor, dhruba

Reviewed By: kailiu

CC: leveldb

Differential Revision: https://reviews.facebook.net/D15411
  • Loading branch information
siying committed Jan 25, 2014
1 parent f653fdc commit 8477255
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 14 deletions.
2 changes: 2 additions & 0 deletions db/compaction_picker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// found in the LICENSE file. See the AUTHORS file for names of contributors.

#include "db/compaction_picker.h"

#include <limits>
#include "util/statistics.h"

namespace rocksdb {
Expand Down
2 changes: 2 additions & 0 deletions db/db_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "rocksdb/env.h"
#include "rocksdb/memtablerep.h"
#include "rocksdb/write_batch.h"
#include "rocksdb/slice.h"
#include "rocksdb/slice_transform.h"
#include "rocksdb/statistics.h"
#include "port/port.h"
#include "util/bit_set.h"
Expand Down
2 changes: 2 additions & 0 deletions db/db_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include "rocksdb/cache.h"
#include "rocksdb/compaction_filter.h"
#include "rocksdb/env.h"
#include "rocksdb/slice.h"
#include "rocksdb/slice_transform.h"
#include "rocksdb/table.h"
#include "util/hash.h"
#include "util/logging.h"
Expand Down
2 changes: 2 additions & 0 deletions db/prefix_filter_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#pragma once
#include "rocksdb/iterator.h"
#include "rocksdb/slice.h"
#include "rocksdb/slice_transform.h"

namespace rocksdb {

Expand Down
1 change: 1 addition & 0 deletions db/skiplist.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <stdlib.h>
#include "port/port.h"
#include "util/random.h"
#include "rocksdb/arena.h"

namespace rocksdb {

Expand Down
2 changes: 2 additions & 0 deletions db/tailing_iter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <string>
#include <utility>
#include "db/db_impl.h"
#include "rocksdb/slice.h"
#include "rocksdb/slice_transform.h"

namespace rocksdb {

Expand Down
7 changes: 4 additions & 3 deletions include/rocksdb/memtablerep.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@
#define STORAGE_ROCKSDB_DB_MEMTABLEREP_H_

#include <memory>
#include "rocksdb/arena.h"
#include "rocksdb/slice.h"
#include "rocksdb/slice_transform.h"

namespace rocksdb {

class Arena;
class Slice;
class SliceTransform;

class MemTableRep {
public:
// KeyComparator provides a means to compare keys, which are internal keys
Expand Down
10 changes: 5 additions & 5 deletions include/rocksdb/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
#include <vector>
#include <stdint.h>

#include "rocksdb/memtablerep.h"
#include "rocksdb/slice.h"
#include "rocksdb/slice_transform.h"
#include "rocksdb/statistics.h"
#include "rocksdb/table_properties.h"
#include "rocksdb/universal_compaction.h"

namespace rocksdb {
Expand All @@ -34,6 +29,11 @@ class Logger;
class MergeOperator;
class Snapshot;
class TableFactory;
class MemTableRepFactory;
class TablePropertiesCollector;
class Slice;
class SliceTransform;
class Statistics;

using std::shared_ptr;

Expand Down
6 changes: 0 additions & 6 deletions include/rocksdb/universal_compaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,8 @@
#ifndef STORAGE_ROCKSDB_UNIVERSAL_COMPACTION_OPTIONS_H
#define STORAGE_ROCKSDB_UNIVERSAL_COMPACTION_OPTIONS_H

#include <stddef.h>
#include <string>
#include <memory>
#include <vector>
#include <stdint.h>
#include <climits>
#include "rocksdb/slice.h"
#include "rocksdb/statistics.h"

namespace rocksdb {

Expand Down
2 changes: 2 additions & 0 deletions tools/db_stress.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include "utilities/utility_db.h"
#include "rocksdb/env.h"
#include "rocksdb/write_batch.h"
#include "rocksdb/slice.h"
#include "rocksdb/slice_transform.h"
#include "rocksdb/statistics.h"
#include "port/port.h"
#include "util/coding.h"
Expand Down
4 changes: 4 additions & 0 deletions util/coding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

#include "util/coding.h"

#include "rocksdb/slice.h"
#include "rocksdb/slice_transform.h"


#include <algorithm>

namespace rocksdb {
Expand Down
2 changes: 2 additions & 0 deletions util/coding.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#include <stdint.h>
#include <string.h>
#include <string>

#include "rocksdb/write_batch.h"
#include "port/port.h"

namespace rocksdb {
Expand Down
4 changes: 4 additions & 0 deletions util/options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#include "rocksdb/env.h"
#include "rocksdb/filter_policy.h"
#include "rocksdb/merge_operator.h"
#include "rocksdb/memtablerep.h"
#include "rocksdb/slice.h"
#include "rocksdb/slice_transform.h"
#include "rocksdb/table_properties.h"
#include "table/block_based_table_factory.h"

namespace rocksdb {
Expand Down
1 change: 1 addition & 0 deletions utilities/backupable/backupable_db.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <string>
#include <limits>
#include <atomic>
#include <unordered_map>

namespace rocksdb {

Expand Down

0 comments on commit 8477255

Please sign in to comment.