Skip to content

Commit

Permalink
iwyu
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed May 16, 2023
1 parent 388a4e6 commit 7125557
Show file tree
Hide file tree
Showing 25 changed files with 37 additions and 33 deletions.
3 changes: 1 addition & 2 deletions src/aio/aio_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@
#include <stdint.h>

#include "utils/error_code.h"
#include "utils/factory_store.h" // IWYU pragma: keep

namespace pegasus {

class aio_context;
class aio_task;
class disk_engine;

enum provider_type;

#define DSN_INVALID_FILE_HANDLE -1
struct linux_fd_t
{
Expand Down
1 change: 0 additions & 1 deletion src/failure_detector/test/failure_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
#include "runtime/task/async_calls.h"
#include "runtime/task/task_code.h"
#include "runtime/task/task_spec.h"
#include "utils/enum_helper.h"
#include "utils/error_code.h"
#include "utils/flags.h"
#include "utils/fmt_logging.h"
Expand Down
3 changes: 1 addition & 2 deletions src/meta/test/balancer_simulator/balancer_simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@
#include <utility>
#include <vector>

#include "backup_types.h"
#include "common/replication_other_types.h"
#include "pegasus.layer2_types.h"
#include "meta/greedy_load_balancer.h"
#include "meta/meta_data.h"
#include "meta/server_load_balancer.h"
#include "meta/test/misc/misc.h"
#include "meta_admin_types.h"
#include "pegasus.layer2_types.h"
#include "runtime/app_model.h"
#include "runtime/rpc/rpc_address.h"
#include "utils/fmt_logging.h"
Expand Down
3 changes: 1 addition & 2 deletions src/meta/test/meta_app_operation_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "common/json_helper.h"
#include "common/replica_envs.h"
#include "common/replication.codes.h"
#include "pegasus.layer2_types.h"
#include "meta/meta_data.h"
#include "meta/meta_rpc_types.h"
#include "meta/meta_service.h"
Expand All @@ -41,7 +40,7 @@
#include "meta_admin_types.h"
#include "meta_service_test_app.h"
#include "meta_test_base.h"
#include "misc/misc.h"
#include "pegasus.layer2_types.h"
#include "runtime/rpc/rpc_address.h"
#include "runtime/rpc/rpc_message.h"
#include "runtime/task/task_tracker.h"
Expand Down
3 changes: 1 addition & 2 deletions src/meta/test/meta_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@
#include <string>
#include <vector>

#include "client/partition_resolver.h"
#include "common/gpid.h"
#include "pegasus.layer2_types.h"
#include "meta/meta_data.h"
#include "metadata_types.h"
#include "misc/misc.h"
#include "pegasus.layer2_types.h"
#include "runtime/rpc/rpc_address.h"

namespace pegasus {
Expand Down
4 changes: 1 addition & 3 deletions src/meta/test/misc/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <atomic>
#include <chrono>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <string>
#include <thread>
Expand All @@ -42,10 +41,9 @@
#include "common/gpid.h"
#include "common/replication_enums.h"
#include "common/replication_other_types.h"
#include "pegasus.layer2_types.h"
#include "duplication_types.h"
#include "meta_admin_types.h"
#include "metadata_types.h"
#include "pegasus.layer2_types.h"
#include "utils/error_code.h"
#include "utils/fmt_logging.h"
#include "utils/rand.h"
Expand Down
11 changes: 4 additions & 7 deletions src/redis_protocol/proxy_lib/redis_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,19 @@

namespace pegasus {
class binary_writer;

namespace apps {
class rrdb_client;
}
}

class proxy_test;
} // namespace apps
} // namespace pegasus

namespace pegasus {
namespace proxy {

class proxy_test;
// http://redis.io/topics/protocol
class redis_parser : public proxy_session
{
protected:
friend class ::proxy_test;
friend class pegasus::proxy::proxy_test;

struct redis_base_type
{
Expand Down
1 change: 1 addition & 0 deletions src/replica/storage/simple_kv/simple_kv.main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
// apps
#include "simple_kv.app.example.h"
#include "simple_kv.server.impl.h"
#include "utils/enum_helper.h"

using namespace pegasus;

Expand Down
1 change: 1 addition & 0 deletions src/replica/storage/simple_kv/test/simple_kv.main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

#include "checker.h"
#include "client.h"
#include "common/gpid.h"
#include "http/http_server.h"
#include "injector.h"
#include "meta/meta_service_app.h"
Expand Down
1 change: 1 addition & 0 deletions src/replica/test/cold_backup_context_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "backup_block_service_mock.h"
#include "backup_types.h"
#include "block_service/block_service.h"
#include "block_service/test/block_service_mock.h"
#include "common/backup_common.h"
#include "common/gpid.h"
#include "common/json_helper.h"
Expand Down
1 change: 1 addition & 0 deletions src/replica/test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <thread>
#include <vector>

#include "client/partition_resolver.h"
#include "replication_service_test_app.h"
#include "runtime/app_model.h"
#include "runtime/service_app.h"
Expand Down
5 changes: 4 additions & 1 deletion src/replica/test/mutation_log_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <unordered_map>

#include "aio/aio_task.h"
#include "backup_types.h"
#include "common/replication.codes.h"
#include "consensus_types.h"
#include "replica/log_block.h"
Expand All @@ -49,6 +48,10 @@
#include "utils/fmt_logging.h"
#include "utils/ports.h"

namespace pegasus {
class message_ex;
} // namespace pegasus

using namespace pegasus::utils::filesystem;

namespace pegasus {
Expand Down
1 change: 1 addition & 0 deletions src/runtime/test/lpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "runtime/task/task_worker.h"
#include "test_utils.h"
#include "utils/autoref_ptr.h"
#include "utils/error_code.h"

DEFINE_TASK_CODE(LPC_TEST_HASH, TASK_PRIORITY_COMMON, THREAD_POOL_TEST_SERVER)

Expand Down
1 change: 1 addition & 0 deletions src/runtime/test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "runtime/app_model.h"
#include "runtime/service_app.h"
#include "test_utils.h"
#include "utils/error_code.h"
#include "utils/flags.h"
#include "utils/strings.h"

Expand Down
1 change: 0 additions & 1 deletion src/runtime/test/task_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include "runtime/service_engine.h"
#include "runtime/task/task.h"
#include "test_utils.h"
#include "utils/enum_helper.h"
#include "utils/threadpool_code.h"

namespace pegasus {
Expand Down
1 change: 1 addition & 0 deletions src/server/compaction_operation.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include "common/json_helper.h"
#include "compaction_filter_rule.h"
#include "pegasus_value_schema.h"
#include "utils/blob.h"
#include "utils/enum_helper.h"
#include "utils/factory_store.h"
Expand Down
3 changes: 3 additions & 0 deletions src/server/hotspot_partition_calculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "client/replication_ddl_client.h"
#include "common/gpid.h"
#include "common/serialization_helper/pegasus.layer2_types.h"
#include "pegasus_value_schema.h"
#include "perf_counter/perf_counter.h"
#include "runtime/rpc/rpc_address.h"
#include "server/hotspot_partition_stat.h"
Expand All @@ -35,7 +36,9 @@
#include "utils/fmt_logging.h"
#include "utils/string_view.h"

namespace pegasus {
struct row_data;
} // namespace pegasus

using pegasus::replication::hotkey_type;
using pegasus::replication::detect_action;
Expand Down
6 changes: 2 additions & 4 deletions src/server/hotspot_partition_calculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@
#include "replica_admin_types.h"
#include "runtime/rpc/rpc_holder.h"

namespace pegasus {
struct row_data;
struct shell_context;
} // namespace pegasus

using pegasus::replication::detect_hotkey_request;
using pegasus::replication::detect_hotkey_response;
namespace pegasus {
namespace replication {
class detect_hotkey_request;
class detect_hotkey_response;
}
namespace server {

// stores the whole histories of all partitions in one table
Expand Down
3 changes: 1 addition & 2 deletions src/server/info_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@
#include "shell/command_helper.h"
#include "utils/synchronize.h"

struct shell_context;

namespace pegasus {
class pegasus_client;
struct shell_context;

namespace server {

Expand Down
4 changes: 2 additions & 2 deletions src/server/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
#include <string>
#include <vector>

#include "backup_types.h"
#include "compaction_operation.h"
#include "info_collector_app.h"
#include "meta/meta_service_app.h"
#include "pegasus_server_impl.h"
#include "pegasus_service_app.h"
#include "runtime/app_model.h"
#include "runtime/service_app.h"
#include "server/compaction_filter_rule.h"
#include "utils/autoref_ptr.h"
#include "utils/command_manager.h"
#include "utils/fmt_logging.h"
#include "utils/process_utils.h"
#include "utils/strings.h"
#include "utils/time_utils.h"
#include "utils/utils.h"

#define STR_I(var) #var
#define STR(var) STR_I(var)
Expand Down
1 change: 1 addition & 0 deletions src/server/test/hashkey_transform_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include "base/pegasus_key_schema.h"
#include "utils/blob.h"
#include "utils/string_view.h"

using namespace pegasus;

Expand Down
1 change: 1 addition & 0 deletions src/server/test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "server/compaction_operation.h"
#include "server/pegasus_server_impl.h"
#include "utils/error_code.h"
#include "utils/utils.h"

std::atomic_bool gtest_done{false};
std::atomic_int gtest_ret{false};
Expand Down
3 changes: 2 additions & 1 deletion src/server/test/pegasus_mutation_duplicator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@
#include <pegasus/error.h>
#include <sys/types.h>
#include <memory>
#include <set>
#include <utility>
#include <vector>

#include "backup_types.h"
#include "base/pegasus_rpc_types.h"
#include "common/duplication_common.h"
#include "common/gpid.h"
#include "common/replication.codes.h"
#include "duplication_internal_types.h"
#include "pegasus_key_schema.h"
#include "pegasus_server_test_base.h"
#include "pegasus_value_schema.h"
#include "replica/replica_base.h"
#include "rrdb/rrdb.code.definition.h"
#include "rrdb/rrdb_types.h"
Expand Down
1 change: 1 addition & 0 deletions src/server/test/pegasus_write_service_impl_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#include "pegasus_key_schema.h"
#include "pegasus_server_test_base.h"
#include "pegasus_value_schema.h"
#include "rrdb/rrdb_types.h"
#include "server/pegasus_server_write.h"
#include "server/pegasus_write_service.h"
Expand Down
7 changes: 4 additions & 3 deletions src/utils/metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,10 @@ class error_code;
extern pegasus::floating_percentile_prototype<double> METRIC_##name

namespace pegasus {
class metric; // IWYU pragma: keep
class metric_prototype; // IWYU pragma: keep
struct metric_filters; // IWYU pragma: keep
class metric; // IWYU pragma: keep
class metric_entity_prototype; // IWYU pragma: keep
class metric_prototype; // IWYU pragma: keep
struct metric_filters; // IWYU pragma: keep

using metric_ptr = ref_ptr<metric>;

Expand Down

0 comments on commit 7125557

Please sign in to comment.