Remove unnecessary #includes in DCP code 22/78322/4
authorDave Rigby <daver@couchbase.com>
Wed, 17 May 2017 11:58:57 +0000 (12:58 +0100)
committerDave Rigby <daver@couchbase.com>
Wed, 24 May 2017 09:29:16 +0000 (09:29 +0000)
Change-Id: Id6bb0258230281647f191bb25282e60a533c32de
Reviewed-on: http://review.couchbase.org/78322
Tested-by: Build Bot <build@couchbase.com>
Reviewed-by: Jim Walker <jim@couchbase.com>
src/connmap.h
src/dcp/backfill-manager.h
src/dcp/consumer.cc
src/dcp/consumer.h
src/dcp/dcp-types.h
src/dcp/dcpconnmap.cc
src/dcp/dcpconnmap.h
src/dcp/producer.cc
src/dcp/stream.h
tests/module_tests/evp_store_rollback_test.cc

index c55d5d3..03b9ba7 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "atomic.h"
 #include "atomicqueue.h"
+#include "dcp/dcp-types.h"
 
 #include <climits>
 #include <iterator>
@@ -36,8 +37,6 @@ class ConnHandler;
 class Consumer;
 class EventuallyPersistentEngine;
 
-typedef SingleThreadedRCPtr<ConnHandler> connection_t;
-
 /**
  * Connection notifier type.
  */
index baf94b4..18de2c0 100644 (file)
 #define SRC_DCP_BACKFILL_MANAGER_H_ 1
 
 #include "config.h"
-#include "connmap.h"
 #include "dcp/backfill.h"
-#include "dcp/producer.h"
-#include "dcp/stream.h"
 
 #include <list>
 
index ce529c1..611bf11 100644 (file)
 
 #include "dcp/consumer.h"
 
+#include "dcp/dcpconnmap.h"
+#include "dcp/stream.h"
 #include "ep_engine.h"
 #include "failover-table.h"
 #include "replicationthrottle.h"
-#include "dcp/dcpconnmap.h"
-#include "dcp/stream.h"
-#include "dcp/response.h"
-#include <platform/make_unique.h>
 
 #include <climits>
 #include <phosphor/phosphor.h>
index 8e25511..5683fef 100644 (file)
 
 #include "config.h"
 
-#include <relaxed_atomic.h>
-
-#include "connmap.h"
-#include "dcp/dcp-types.h"
+#include "atomic_unordered_map.h"
 #include "dcp/flow-control.h"
-#include "dcp/stream.h"
 #include "tapconnection.h"
 
+#include <relaxed_atomic.h>
+
 class DcpResponse;
 class StreamEndResponse;
 
index b91789d..2b04380 100644 (file)
@@ -53,6 +53,11 @@ typedef SingleThreadedRCPtr<ActiveStream> active_stream_t;
 class PassiveStream;
 typedef RCPtr<PassiveStream> passive_stream_t;
 
+class ConnHandler;
+typedef SingleThreadedRCPtr<ConnHandler> connection_t;
+
+enum process_items_error_t { all_processed, more_to_process, cannot_process };
+
 /**
  * DcpReadyQueue is a std::queue wrapper for managing a
  * queue of vbuckets that are ready for a DCP producer/consumer to process.
index 694b973..8e14f1e 100644 (file)
 
 #include "config.h"
 
-#include <algorithm>
-#include <limits>
-#include <string>
-#include <vector>
-
-#include "connmap.h"
-#include "executorthread.h"
-#include "dcp/backfill-manager.h"
+#include "configuration.h"
 #include "dcp/consumer.h"
-#include "dcp/dcpconnmap.h"
 #include "dcp/producer.h"
+#include "dcpconnmap.h"
+#include "ep_engine.h"
 
 const uint32_t DcpConnMap::dbFileMem = 10 * 1024;
 const uint16_t DcpConnMap::numBackfillsThreshold = 4096;
 const uint8_t DcpConnMap::numBackfillsMemThreshold = 1;
 
+class DcpConnMap::DcpConfigChangeListener : public ValueChangedListener {
+public:
+    DcpConfigChangeListener(DcpConnMap& connMap);
+    virtual ~DcpConfigChangeListener() {
+    }
+    virtual void sizeValueChanged(const std::string& key, size_t value);
+
+private:
+    DcpConnMap& myConnMap;
+};
+
 DcpConnMap::DcpConnMap(EventuallyPersistentEngine &e)
     : ConnMap(e),
       aggrDcpConsumerBufferSize(0) {
index 1e5aacb..acda444 100644 (file)
 
 #include "config.h"
 
+#include "connmap.h"
+
 #include <atomic>
-#include <climits>
 #include <list>
 #include <string>
 
-#include "ep_engine.h"
-#include "locks.h"
-#include "syncobject.h"
-#include "atomicqueue.h"
-#include "connmap.h"
-#include "dcp/consumer.h"
-#include "dcp/producer.h"
+class DcpProducer;
+class DcpConsumer;
 
 class DcpConnMap : public ConnMap {
 
@@ -193,12 +189,5 @@ protected:
     /* Total memory used by all DCP consumer buffers */
     std::atomic<size_t> aggrDcpConsumerBufferSize;
 
-    class DcpConfigChangeListener : public ValueChangedListener {
-    public:
-        DcpConfigChangeListener(DcpConnMap& connMap);
-        virtual ~DcpConfigChangeListener() { }
-        virtual void sizeValueChanged(const std::string &key, size_t value);
-    private:
-        DcpConnMap& myConnMap;
-    };
+    class DcpConfigChangeListener;
 };
index 1626e1c..fe4e533 100644 (file)
@@ -15,9 +15,6 @@
  *   limitations under the License.
  */
 
-#include <vector>
-#include <memcached/server_api.h>
-
 #include "dcp/producer.h"
 
 #include "backfill.h"
@@ -26,8 +23,9 @@
 #include "failover-table.h"
 #include "dcp/backfill-manager.h"
 #include "dcp/dcpconnmap.h"
-#include "dcp/response.h"
-#include "dcp/stream.h"
+
+#include <memcached/server_api.h>
+#include <vector>
 
 const std::chrono::seconds DcpProducer::defaultDcpNoopTxInterval(20);
 
index dad5fbf..9b71109 100644 (file)
@@ -53,12 +53,6 @@ enum end_stream_status_t {
     END_STREAM_BACKFILL_FAIL
 };
 
-enum process_items_error_t {
-    all_processed,
-    more_to_process,
-    cannot_process
-};
-
 enum backfill_source_t {
     BACKFILL_FROM_MEMORY,
     BACKFILL_FROM_DISK
index 16d3433..ae42114 100644 (file)
@@ -20,6 +20,8 @@
  */
 
 #include "dcp/dcpconnmap.h"
+#include "dcp/producer.h"
+#include "dcp/stream.h"
 #include "evp_store_single_threaded_test.h"
 #include "evp_store_test.h"
 #include "failover-table.h"