Skip to content

[cleanup](build) Replace #include exec_env.h with forward declaration in 19 headers#61582

Open
shuke987 wants to merge 1 commit intoapache:masterfrom
shuke987:iwyu-fwd-decl-exec-env-v2
Open

[cleanup](build) Replace #include exec_env.h with forward declaration in 19 headers#61582
shuke987 wants to merge 1 commit intoapache:masterfrom
shuke987:iwyu-fwd-decl-exec-env-v2

Conversation

@shuke987
Copy link
Collaborator

Summary

  • Remove unused #include "runtime/exec_env.h" from 10 header files that don't reference ExecEnv
  • Replace with class ExecEnv; forward declaration in 9 header files that only use ExecEnv* pointer
  • Move full include to corresponding .cpp files where needed
  • Add class Thread; forward declaration in workload_sched_policy_mgr.h (was transitively included via exec_env.h)

Files changed (24 files)

Headers - include removed (unused):

  • exec/operator/aggregation_sink_operator.h
  • exec/scan/scanner.h
  • exec/sink/load_stream_map_pool.h
  • exec/sink/load_stream_stub.h
  • exec/sink/writer/vtablet_writer.h
  • exec/sink/writer/vtablet_writer_v2.h
  • load/group_commit/wal/wal_info.h
  • storage/metadata_adder.h
  • storage/rowset/rowset_writer_context.h
  • storage/segment/page_handle.h

Headers - replaced with forward declaration:

  • agent/workload_sched_policy_listener.h
  • load/group_commit/group_commit_mgr.h
  • load/group_commit/wal/wal_manager.h
  • load/group_commit/wal/wal_table.h
  • runtime/query_context.h
  • runtime/workload_management/workload_sched_policy_mgr.h
  • service/http/action/check_encryption_action.h
  • service/http/action/compaction_score_action.h
  • service/http/http_handler_with_auth.h

CPP files - added full include:

  • agent/workload_sched_policy_listener.cpp
  • load/group_commit/wal/wal_table.cpp
  • runtime/workload_management/workload_sched_policy_mgr.cpp
  • service/http/action/compaction_score_action.cpp
  • service/http/http_handler_with_auth.cpp

Test plan

  • Full BE compilation verified on build server
  • CI buildall

🤖 Generated with Claude Code

… in 19 headers

Remove unused #include "runtime/exec_env.h" from 10 header files and replace
with forward declaration class ExecEnv in 9 header files that only use ExecEnv*.
Move the full include to corresponding .cpp files where needed.

Verified with full BE compilation on build server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@shuke987
Copy link
Collaborator Author

run buildall

@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants