-
Couldn't load subscription status.
- Fork 1.5k
Added namespace oceanbase to src/observer #605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Added namespace oceanbase to src/observer #605
Conversation
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the oceanbase namespace to the entire src/observer directory structure. The changes consistently wrap all existing code in the observer module with the oceanbase namespace to improve code organization and prevent naming conflicts.
Key Changes:
- Added
namespace oceanbase {declarations to all header and implementation files - Added corresponding
} // namespace oceanbaseclosing braces - Reformatted some function definitions from multi-line to single-line style
Reviewed Changes
Copilot reviewed 299 out of 346 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| All .h files | Added namespace wrapper around class/function declarations |
| All .cpp files | Added namespace wrapper around implementations |
| main.cpp | Added namespace wrapper around main function and global variables |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| #include "common/global_context.h" | ||
| #include "sql/parser/parse_defs.h" | ||
| #include "storage/buffer/disk_buffer_pool.h" | ||
|
|
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the stray semicolon on line 20. It appears to be a formatting artifact from code restructuring.
| bp = iter->second; | ||
| return RC::SUCCESS; | ||
| } | ||
|
|
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Add a blank line before the closing namespace brace for consistency with other files in the PR.
| char *Arena::AllocateAligned(size_t bytes) | ||
| { | ||
| const int align = (sizeof(void *) > 8) ? sizeof(void *) : 8; | ||
| static_assert((align & (align - 1)) == 0, "Pointer size should be a power of 2"); |
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The reformatted single-line static_assert is less readable than the original multi-line format. Consider keeping multi-line format for better readability.
| static_assert((align & (align - 1)) == 0, "Pointer size should be a power of 2"); | |
| static_assert( | |
| (align & (align - 1)) == 0, | |
| "Pointer size should be a power of 2" | |
| ); |
| for (const auto &child : child_groups_) { | ||
| hash ^= std::hash<int>()(child) + 0x9e3779b9 + (hash << 6) + (hash >> 2);; | ||
| hash ^= std::hash<int>()(child) + 0x9e3779b9 + (hash << 6) + (hash >> 2); | ||
| ; |
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the stray semicolon on line 20. This appears to be a formatting artifact.
| ; |
| int Value::compare(const Value &other) const | ||
| { | ||
| return DataType::type_instance(this->attr_type_)->compare(*this, other); | ||
| } |
Copilot
AI
Oct 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The original single-line format for this simple function was more concise. Consider reverting to the original format.
| int Value::compare(const Value &other) const | |
| { | |
| return DataType::type_instance(this->attr_type_)->compare(*this, other); | |
| } | |
| int Value::compare(const Value &other) const { return DataType::type_instance(this->attr_type_)->compare(*this, other); } |
What problem were solved in this pull request?
Added namespace oceanbase to the src/observer file
Issue Number: close #515
Problem:
What is changed and how it works?
Other information