Remove unnecessary #include "tasks.h" 98/77498/2
authorDave Rigby <daver@couchbase.com>
Fri, 28 Apr 2017 17:28:36 +0000 (18:28 +0100)
committerDave Rigby <daver@couchbase.com>
Tue, 2 May 2017 10:41:14 +0000 (10:41 +0000)
tasks.h is a relatively expensive header to include, as it contains
the definitions of various disjoint Task types, so in turn it includes
a large proportion of ep-engine headers.

However, it is unneessarily included in a large number of places. This
is probably at last in part due to the fact that globaltask.h didn't
used to be it's own header, and hence to get the GlobalTask definition
one needed to include tasks.h

Change-Id: I0971eab4808ce51d470fe061c13796d18b444234
Reviewed-on: http://review.couchbase.org/77498
Reviewed-by: Manu Dhundi <manu@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
20 files changed:
src/access_scanner.h
src/backfill.h
src/bgfetcher.cc
src/checkpoint_remover.h
src/couch-kvstore/couch-kvstore.h
src/defragmenter.h
src/ep_vb.cc
src/executorpool.h
src/executorthread.h
src/flusher.cc
src/futurequeue.h
src/globaltask.h
src/htresizer.h
src/item_pager.h
src/kv_bucket.cc
src/taskable.h
src/taskqueue.h
src/vbucket.h
tests/module_tests/stats_test.cc
tests/module_tests/vbucket_test.h

index 4f051dd..3821b76 100644 (file)
@@ -20,9 +20,9 @@
 
 #include "config.h"
 
-#include <string>
+#include "globaltask.h"
 
-#include "tasks.h"
+#include <string>
 
 // Forward declaration.
 class EPStats;
index c264283..278e7f9 100644 (file)
@@ -22,8 +22,8 @@
 
 #include <string>
 
+#include "globaltask.h"
 #include "kv_bucket_iface.h"
-#include "tasks.h"
 
 #define DEFAULT_BACKFILL_SNOOZE_TIME 1.0
 
index 7b503fc..16272f9 100644 (file)
@@ -25,6 +25,7 @@
 #include "executorthread.h"
 #include "kv_bucket.h"
 #include "kvshard.h"
+#include "tasks.h"
 
 const double BgFetcher::sleepInterval = MIN_SLEEP_TIME;
 
index 85e351f..e82291e 100644 (file)
 
 #include "config.h"
 
-#include "stats.h"
-#include "tasks.h"
-
-#include <set>
-#include <string>
+#include "globaltask.h"
 
+class EPStats;
 class EventuallyPersistentEngine;
 
 /**
index 9ee1492..9a850f6 100644 (file)
@@ -35,7 +35,6 @@
 #include "logger.h"
 #include "item.h"
 #include "kvstore.h"
-#include "tasks.h"
 #include "atomicqueue.h"
 
 #define COUCHSTORE_NO_OPTIONS 0
index 38de625..b335f6d 100644 (file)
@@ -20,8 +20,8 @@
 
 #include "config.h"
 
+#include "globaltask.h"
 #include "kv_bucket_iface.h"
-#include "tasks.h"
 
 class EPStats;
 class DefragmentVisitor;
index 06f0d13..6b1e058 100644 (file)
@@ -23,6 +23,7 @@
 #include "failover-table.h"
 #include "kvshard.h"
 #include "stored_value_factories.h"
+#include "tasks.h"
 #include "vbucketdeletiontask.h"
 
 EPVBucket::EPVBucket(id_type i,
@@ -601,4 +602,4 @@ void EPVBucket::setupDeferredDeletion(const void* cookie) {
 void EPVBucket::scheduleDeferredDeletion(EventuallyPersistentEngine& engine) {
     ExTask task = new VBucketMemoryAndDiskDeletionTask(engine, *shard, this);
     ExecutorPool::get()->schedule(task);
-}
\ No newline at end of file
+}
index f5c228c..7926d07 100644 (file)
@@ -68,7 +68,7 @@
 
 #include "config.h"
 
-#include "tasks.h"
+#include "syncobject.h"
 #include "task_type.h"
 #include "taskable.h"
 
index 629188d..0de9292 100644 (file)
@@ -18,8 +18,8 @@
 
 #include "config.h"
 
+#include "globaltask.h"
 #include "objectregistry.h"
-#include "tasks.h"
 #include "task_type.h"
 #include "tasklogentry.h"
 
index 3cae9e3..8603650 100644 (file)
@@ -18,6 +18,7 @@
 #include "flusher.h"
 
 #include "common.h"
+#include "tasks.h"
 
 #include <stdlib.h>
 
index 8afb10a..95b8a0d 100644 (file)
@@ -31,7 +31,7 @@
 #include <platform/processclock.h>
 #include <queue>
 
-#include "tasks.h"
+#include "globaltask.h"
 
 template <class C = std::deque<ExTask>,
           class Compare = CompareByDueDate>
index ac209b4..f4f12e5 100644 (file)
 
 #pragma once
 
-#include <array>
-#include <platform/processclock.h>
-#include <platform/sized_buffer.h>
-
 #include "atomic.h"
 #include "config.h"
 #include "task_type.h"
 
+#include <platform/processclock.h>
+#include <platform/sized_buffer.h>
+#include <array>
+
 enum task_state_t {
     TASK_RUNNING,
     TASK_SNOOZED,
index 2bb4250..982a4c1 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "config.h"
 
-#include "tasks.h"
+#include "globaltask.h"
 
 #include <string>
 
index 0cfc08f..ba87a0e 100644 (file)
 
 #include "config.h"
 
-#include "tasks.h"
+#include "globaltask.h"
 
 typedef std::pair<int64_t, int64_t> row_range_t;
 
 // Forward declaration.
+class EPStats;
 class EventuallyPersistentEngine;
 
 /**
index 8e1b9bc..de7f965 100644 (file)
 #include "access_scanner.h"
 #include "checkpoint_remover.h"
 #include "conflict_resolution.h"
+#include "connmap.h"
 #include "dcp/dcpconnmap.h"
 #include "defragmenter.h"
-#include "kv_bucket.h"
 #include "ep_engine.h"
 #include "ext_meta_parser.h"
 #include "failover-table.h"
 #include "flusher.h"
 #include "htresizer.h"
+#include "kv_bucket.h"
 #include "kvshard.h"
 #include "kvstore.h"
 #include "locks.h"
 #include "mutation_log.h"
-#include "warmup.h"
-#include "connmap.h"
 #include "replicationthrottle.h"
 #include "statwriter.h"
 #include "tapconnmap.h"
-#include "vbucketdeletiontask.h"
+#include "tasks.h"
 #include "vb_count_visitor.h"
+#include "vbucketdeletiontask.h"
+#include "warmup.h"
 
 class StatsValueChangeListener : public ValueChangedListener {
 public:
index 3b60ca8..c898cf0 100644 (file)
@@ -23,8 +23,8 @@
 
 #include <platform/processclock.h>
 
+#include "globaltask.h"
 #include "workload.h"
-#include "tasks.h"
 
 /*
     A type for identifying all tasks belonging to a task owner.
index c9cfcf9..4d6df37 100644 (file)
 
 #include "config.h"
 
-#include <queue>
-#include <platform/processclock.h>
-
 #include "futurequeue.h"
+#include "syncobject.h"
 #include "task_type.h"
-#include "tasks.h"
+
+#include <platform/processclock.h>
+
+#include <list>
+#include <queue>
+
 class ExecutorPool;
 class ExecutorThread;
 
index 4f1ebad..f64116e 100644 (file)
@@ -26,6 +26,7 @@
 #include "hash_table.h"
 #include "hlc.h"
 #include "item_pager.h"
+#include "kvstore.h"
 #include "monotonic.h"
 
 #include <platform/non_negative_counter.h>
index 96a63d7..07aaf55 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "stats_test.h"
 #include "evp_store_single_threaded_test.h"
+#include "tasks.h"
 #include "test_helpers.h"
 
 #include <gmock/gmock.h>
index 7892d0c..9b2d182 100644 (file)
 
 #include "callbacks.h"
 #include "checkpoint.h"
-#include "item_pager.h"
+#include "configuration.h"
 #include "hash_table.h"
+#include "item_pager.h"
 
 #include <gtest/gtest.h>
 
+class BgFetcher;
 class VBucket;
+class VBucketBGFetchItem;
 
 /**
  * Dummy callback to replace the flusher callback.