Skip to content

refactor(indexer): Apply RAII to all classes. - #845

Draft
Bill-hbrhbr wants to merge 5 commits into
y-scope:mainfrom
Bill-hbrhbr:change-indexer-column-metadata-table-name
Draft

refactor(indexer): Apply RAII to all classes.#845
Bill-hbrhbr wants to merge 5 commits into
y-scope:mainfrom
Bill-hbrhbr:change-indexer-column-metadata-table-name

Conversation

@Bill-hbrhbr

@Bill-hbrhbr Bill-hbrhbr commented Apr 24, 2025

Copy link
Copy Markdown
Contributor

Description

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  • Tested with clp-package using CLP_S storage engine.

Summary by CodeRabbit

  • Refactor

    • Updated terminology from "table name" to "dataset name" across user-facing options and messages.
    • Simplified and streamlined database and index management processes for improved reliability and maintainability.
    • Replaced hardcoded dataset name with a configurable constant.
    • Enhanced initialization by integrating metadata updates directly into index manager construction.
    • Improved resource management by consolidating database connection lifecycle within object construction and destruction.
    • Removed redundant commands and updated command-line argument handling for clarity.
  • Bug Fixes

    • Improved consistency in naming and parameter handling for dataset-related operations.

@Bill-hbrhbr
Bill-hbrhbr requested review from a team, gibber9809 and wraymo as code owners April 24, 2025 05:22
@coderabbitai

coderabbitai Bot commented Apr 24, 2025

Copy link
Copy Markdown
Contributor
## Walkthrough

This set of changes refactors the handling of dataset and table naming conventions across several components. The main updates include renaming variables and function parameters from "table" to "dataset" to reflect a shift in terminology, updating function signatures and class interfaces to accept dataset names and prefixes, and consolidating database connection and initialization logic into constructors and destructors. The changes also standardize the construction of metadata table names and remove explicit state management in database storage classes. Additionally, a hardcoded dataset name is replaced with a configuration constant.

## Changes

| File(s)                                                                                                                                            | Change Summary                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
|----------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `components/clp-py-utils/clp_py_utils/clp_metadata_db_utils.py`                                                                                   | Modified `_create_column_metadata_table` to accept a `table_prefix` instead of a full table name and updated SQL construction; updated `create_metadata_db_tables` to use the new parameterization and added a TODO for future dataset-specific logic.                                                                                                                |
| `components/core/src/clp_s/indexer/CommandLineArguments.cpp`,<br>`components/core/src/clp_s/indexer/CommandLineArguments.hpp`                     | Renamed all references from "table-name" and `m_table_name` to "dataset-name" and `m_dataset_name`; updated accessor method to `get_dataset_name()`.                                                                                                                                                                                                                                                        |
| `components/core/src/clp_s/indexer/IndexManager.cpp`,<br>`components/core/src/clp_s/indexer/IndexManager.hpp`                                     | Updated the `IndexManager` constructor to require `dataset_name` and `archive_path`; removed the `update_metadata` method and `m_should_create_table` member; moved metadata update logic into the constructor; updated destructor formatting.                                                                                                                        |
| `components/core/src/clp_s/indexer/MySQLIndexStorage.cpp`,<br>`components/core/src/clp_s/indexer/MySQLIndexStorage.hpp`                           | Refactored to remove explicit `open()`, `init()`, and `close()` methods; moved initialization logic to the constructor and cleanup to the destructor; updated table name construction to use new suffix constant; simplified class interface and removed state-tracking members.                                                                                      |
| `components/core/src/clp_s/indexer/indexer.cpp`                                                                                                   | Updated construction of `IndexManager` to pass `dataset_name`, `should_create_table`, and `archive_path` directly; removed the separate call to `update_metadata`.                                                                                                                                                                                                                                          |
| `components/job-orchestration/job_orchestration/executor/compress/compression_task.py`                                                            | Replaced hardcoded `"default"` dataset name with the `CLP_DEFAULT_DATASET_NAME` constant in the `run_clp` function.                                                                                                                                                                                                                                                                                         |
| `taskfiles/lint.yaml`                                                                                                                              | Removed `IndexManager.hpp` and `MySQLIndexStorage.hpp` from the list of source files included in the C++ linting configuration under the `check-cpp-static-full` task.                                                                                                                                                                                                                                     |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant CommandLineArguments
    participant IndexManager
    participant MySQLIndexStorage
    participant ArchiveReader

    User->>CommandLineArguments: Provide dataset name and archive path
    User->>IndexManager: Construct with db_config, dataset_name, should_create_table, archive_path
    IndexManager->>MySQLIndexStorage: Construct with connection info, table_prefix, dataset_name, should_create_table
    IndexManager->>ArchiveReader: Open archive at archive_path
    ArchiveReader-->>IndexManager: Return schema tree
    IndexManager->>IndexManager: traverse_schema_tree_and_update_metadata(schema_tree)
    IndexManager-->>User: Ready for indexing

Possibly related PRs

  • y-scope/clp#831: Refactors CLP metadata DB table-creation logic into utility functions and constants, directly relating to the updates in table name construction and dataset prefix handling in this PR.

Suggested reviewers

  • kirkrodrigues

<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 973f76c6884118f735c5059776d9cf0aeedd9d7a and 9157da239a0ff178cc243baf1348171d9645212b.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `components/core/src/clp_s/indexer/MySQLIndexStorage.cpp` (2 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* components/core/src/clp_s/indexer/MySQLIndexStorage.cpp

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (6)</summary>

* GitHub Check: build-macos (macos-15, true)
* GitHub Check: build-macos (macos-14, true)
* GitHub Check: build-macos (macos-14, false)
* GitHub Check: lint-check (ubuntu-latest)
* GitHub Check: lint-check (macos-latest)
* GitHub Check: build (macos-latest)

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNxU3bABsvkCiQBHbGlcABpIcVwvOkgAIn8AMzQxfAoACngMJQAPSgBKLhsyNDYefER1eHwMNF9nIkd2SAADXBVosBq2Zoj8FtpqNEQSXE6Skh6E1MYvZ3VZAG5IA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4GBusKkX0CpNZBCRNAsgEoF4GHlV8S8fUqqvX2nmN8ewPoaDjeQYiP9BhxIUxV2ANQ9U6Qe4FKBUjPBwRBJKk4YZ3QuJIKooAAaliXYZNUuHcBX0PhBS4xwhwkLmADzyMgzYfoMALexzBDBB5kAetN6F9A5FxE44XxVc0tZvNGCuolhldh9gxBj5hwyVhi2lZbUKZbeeZgVGZpRLQF2wCxdBFCXWR+F+ALDAFlgaJLmkiPFJWAPTTFLaawAxBi0KnDhEJZn2ZRUKXoxyyxSCsiUsrO0Wyl1ZBgPRY2AMUNQDAS0JpGrA2j5tdoeKAaH4DQBHQJ5p0L2BdBmhqBroC0O6DcqaiyJ1A+BABvFHALYVwq0cMztctuUCAAAbAwAABMFIAAJwAAGBIAAEYsVaAeFWgCRVYqkV6K1FcvLQjIqAAzFipJAMAsVFICkGgHRW0B4VZIMkAwAEBYrbohgW5YtJUA4qSQTKilSQFRUUqKVZIGcCyoADsqgRlUivhUCAmV8KpFehDQCSqyQJIJFUislVcrAVEASAKislUUqEgkqxFfCpJDkh+VxqilRSAYAUh0VaKyVSatoCoqGACQdFWgChLLhSVkqi4ItCBWoq6VkqgYEiopWorGV8cLFZKppXIqyQFKtwtirFUkhI1WK51SyopCEqkVAgHVbqqgB7QQVAkbwRCtMj74WoXKoAA== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details>
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=y-scope/clp&utm_content=845):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🔭 Outside diff range comments (1)
components/core/src/clp_s/indexer/CommandLineArguments.cpp (1)

58-59: ⚠️ Potential issue

Inconsistency in positional option description.

While the option name was updated to "dataset-name" on line 48, the positional description still uses "table-name" which will cause incorrect argument parsing.

Fix this by updating the positional description:

-    positional_options_description.add("table-name", 1);
+    positional_options_description.add("dataset-name", 1);
     positional_options_description.add("archive-path", 1);
🧹 Nitpick comments (4)
components/clp-py-utils/clp_py_utils/clp_metadata_db_utils.py (1)

84-93: Parameter naming could be misleading & lacks minimal validation

_create_column_metadata_table now receives a full table name prefix rather than a true “prefix”. Calling this variable table_prefix can be confusing, especially because every other helper in the module expects an actual prefix (without dataset / trailing underscore). In addition, the value is interpolated directly into the SQL string, which means a malformed prefix could break the statement or even be abused for SQL-injection of identifiers.

Consider:

-def _create_column_metadata_table(db_cursor, table_prefix: str) -> None:
+def _create_column_metadata_table(db_cursor, full_table_prefix: str) -> None:

and, before executing, validate that full_table_prefix only contains allowed characters ([A-Za-z0-9_]+).

components/core/src/clp_s/indexer/IndexManager.hpp (1)

39-45: Boolean construction flag hurts readability

The constructor now has four positional parameters, two of which are strings that differ only semantically and a raw bool whose purpose is not obvious at the call-site. Consider replacing the bool should_create_table with an enum or a strong typedef (e.g. TableCreation::Yes/No) or providing a named builder/factory to avoid accidental misuse.

components/core/src/clp_s/indexer/MySQLIndexStorage.cpp (1)

44-45: Unnecessary reset() before first use

m_insert_field_statement.reset(); is called immediately after construction, but the smart-pointer is already empty. The call is harmless yet redundant and can be removed to reduce noise.

components/core/src/clp_s/indexer/MySQLIndexStorage.hpp (1)

43-49: Missing documentation for new parameters

The doxygen block still talks about “table” but not “dataset” or the should_create_table flag.
Please add brief parameter docs so downstream users (and IDE tooltips) know what each argument does.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6300fa5 and b6c2590.

📒 Files selected for processing (9)
  • components/clp-py-utils/clp_py_utils/clp_metadata_db_utils.py (2 hunks)
  • components/core/src/clp_s/indexer/CommandLineArguments.cpp (3 hunks)
  • components/core/src/clp_s/indexer/CommandLineArguments.hpp (2 hunks)
  • components/core/src/clp_s/indexer/IndexManager.cpp (1 hunks)
  • components/core/src/clp_s/indexer/IndexManager.hpp (1 hunks)
  • components/core/src/clp_s/indexer/MySQLIndexStorage.cpp (3 hunks)
  • components/core/src/clp_s/indexer/MySQLIndexStorage.hpp (2 hunks)
  • components/core/src/clp_s/indexer/indexer.cpp (1 hunks)
  • components/job-orchestration/job_orchestration/executor/compress/compression_task.py (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}`: - Prefer `false == ` rather than `!`.

**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}: - Prefer false == <expression> rather than !<expression>.

  • components/core/src/clp_s/indexer/CommandLineArguments.hpp
  • components/core/src/clp_s/indexer/CommandLineArguments.cpp
  • components/core/src/clp_s/indexer/indexer.cpp
  • components/core/src/clp_s/indexer/IndexManager.hpp
  • components/core/src/clp_s/indexer/IndexManager.cpp
  • components/core/src/clp_s/indexer/MySQLIndexStorage.cpp
  • components/core/src/clp_s/indexer/MySQLIndexStorage.hpp
🧬 Code Graph Analysis (3)
components/core/src/clp_s/indexer/CommandLineArguments.cpp (1)
components/core/src/clp_s/indexer/CommandLineArguments.hpp (1)
  • m_dataset_name (31-31)
components/core/src/clp_s/indexer/MySQLIndexStorage.cpp (1)
components/core/src/clp_s/indexer/MySQLIndexStorage.hpp (2)
  • MySQLIndexStorage (29-38)
  • MySQLIndexStorage (41-41)
components/core/src/clp_s/indexer/MySQLIndexStorage.hpp (1)
components/core/src/clp_s/indexer/MySQLIndexStorage.cpp (3)
  • MySQLIndexStorage (16-67)
  • MySQLIndexStorage (69-72)
  • MySQLIndexStorage (69-69)
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: centos-stream-9-dynamic-linked-bins
  • GitHub Check: ubuntu-jammy-lint
  • GitHub Check: ubuntu-jammy-dynamic-linked-bins
  • GitHub Check: centos-stream-9-static-linked-bins
  • GitHub Check: ubuntu-jammy-static-linked-bins
  • GitHub Check: build-macos (macos-13, false)
  • GitHub Check: build-macos (macos-15, false)
  • GitHub Check: build-macos (macos-14, false)
  • GitHub Check: build-macos (macos-13, true)
  • GitHub Check: lint-check (ubuntu-latest)
  • GitHub Check: build (macos-latest)
🔇 Additional comments (10)
components/job-orchestration/job_orchestration/executor/compress/compression_task.py (2)

14-14: Good addition of the CLP_DEFAULT_DATASET_NAME import.

This import is necessary for the usage of the constant at line 382.


382-382: Great replacement of hardcoded string with constant.

Replacing the hardcoded string "default" with CLP_DEFAULT_DATASET_NAME improves maintainability and consistency. This change aligns with the renaming from "table-name" to "dataset-name" for clarity.

components/core/src/clp_s/indexer/CommandLineArguments.hpp (2)

31-31: Appropriate method name change for clarity.

Renaming get_table_name() to get_dataset_name() improves the clarity of the codebase by using more accurate terminology.


47-47: Appropriate member variable renaming for clarity.

Renaming m_table_name to m_dataset_name ensures consistency with the function and parameter naming changes.

components/core/src/clp_s/indexer/CommandLineArguments.cpp (3)

48-50: Option name updated correctly.

The positional option description was appropriately updated from "table-name" to "dataset-name".


92-94: Correctly updated validation for dataset name.

The validation logic has been properly updated to check for an empty dataset name.


130-131: Usage message updated correctly.

The usage message correctly reflects the renamed parameter "DATASET_NAME" instead of "TABLE_NAME".

components/core/src/clp_s/indexer/indexer.cpp (1)

35-40: Successfully applied RAII principle to IndexManager.

The construction of IndexManager now accepts all necessary parameters directly, which aligns with the Resource Acquisition Is Initialization (RAII) principle. This is a good improvement that eliminates the need for a separate update_metadata call after construction.

components/clp-py-utils/clp_py_utils/clp_metadata_db_utils.py (1)

136-138: Column-metadata table name may contain unwanted double “_” and ignores dataset parameter

When a non-default dataset is passed, table_prefix already includes <dataset>_.
You then append CLP_DEFAULT_DATASET_NAME and another “_”, resulting in e.g.

myprefix_orders_default__column_metadata
                       ^ extra underscore

This also means the metadata table is always created for the default dataset, never for the user-supplied one, which is probably not what you want once datasets become first-class.

Please double-check the desired naming scheme. If the intent is to skip creation for non-CLP_S datasets, wrap the call in a guard instead of hard-coding the default name.

components/core/src/clp_s/indexer/MySQLIndexStorage.hpp (1)

40-42: Make the destructor noexcept

m_db.close() is invoked in the dtor. If close() can throw, unwinding through a destructor during another exception will std::terminate.
Either:

  1. Guarantee MySQLDB::close() is noexcept, or
  2. Catch and log inside the destructor, then mark the destructor noexcept.
-    ~MySQLIndexStorage();
+    ~MySQLIndexStorage() noexcept;

Remember to wrap the body with try { ... } catch (...) { SPDLOG_ERROR(...); }.

Comment thread components/core/src/clp_s/indexer/IndexManager.cpp Outdated
Comment thread components/core/src/clp_s/indexer/MySQLIndexStorage.cpp Outdated
Comment thread components/core/src/clp_s/indexer/MySQLIndexStorage.hpp Outdated
Comment thread components/core/src/clp_s/indexer/MySQLIndexStorage.hpp

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (2)
components/core/src/clp_s/indexer/MySQLIndexStorage.hpp (2)

19-19: ⚠️ Potential issue

The cColumnMetadataSuffix constant is missing a separator, which could lead to malformed table names

As mentioned in a previous review, without a leading underscore, table name formation requires callers to remember to include a delimiter in table_prefix. Based on the implementation in MySQLIndexStorage.cpp, table names are constructed as table_prefix + dataset_name + "_" + cColumnMetadataSuffix, which means there's no separator between table_prefix and dataset_name.

-    static constexpr auto cColumnMetadataSuffix = "column_metadata";
+    static constexpr auto cColumnMetadataSuffix = "_column_metadata";

Alternatively, modify the format string in the implementation to ensure consistent delimiter insertion.


29-39: 🛠️ Refactor suggestion

Constructor should be marked as explicit to prevent accidental implicit conversions

The constructor takes multiple parameters, making it susceptible to accidental implicit conversions if only one argument is provided. Marking it as explicit helps prevent these issues.

-    // Constructor
-    MySQLIndexStorage(
+    // Constructor
+    explicit MySQLIndexStorage(
            std::string const& host,
            int port,
            std::string const& username,
            std::string const& password,
            std::string const& database_name,
            std::string const& table_prefix,
            std::string const& dataset_name,
            bool should_create_table
    );
🧹 Nitpick comments (1)
components/core/src/clp_s/indexer/MySQLIndexStorage.hpp (1)

49-51: Missing documentation for the destructor

For consistency with the rest of the class, please add documentation for the destructor to explain that it releases database resources. This would help maintainers understand the resource cleanup process.

    // Destructor
+    /**
+     * Releases database resources and closes the connection
+     */
    ~MySQLIndexStorage();
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b6c2590 and ccab118.

📒 Files selected for processing (5)
  • components/core/src/clp_s/indexer/IndexManager.cpp (2 hunks)
  • components/core/src/clp_s/indexer/IndexManager.hpp (2 hunks)
  • components/core/src/clp_s/indexer/MySQLIndexStorage.cpp (3 hunks)
  • components/core/src/clp_s/indexer/MySQLIndexStorage.hpp (2 hunks)
  • taskfiles/lint.yaml (0 hunks)
💤 Files with no reviewable changes (1)
  • taskfiles/lint.yaml
🚧 Files skipped from review as they are similar to previous changes (3)
  • components/core/src/clp_s/indexer/MySQLIndexStorage.cpp
  • components/core/src/clp_s/indexer/IndexManager.cpp
  • components/core/src/clp_s/indexer/IndexManager.hpp
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}`: - Prefer `false == ` rather than `!`.

**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}: - Prefer false == <expression> rather than !<expression>.

  • components/core/src/clp_s/indexer/MySQLIndexStorage.hpp
🧬 Code Graph Analysis (1)
components/core/src/clp_s/indexer/MySQLIndexStorage.hpp (1)
components/core/src/clp_s/indexer/MySQLIndexStorage.cpp (3)
  • MySQLIndexStorage (16-66)
  • MySQLIndexStorage (68-71)
  • MySQLIndexStorage (68-68)
⏰ Context from checks skipped due to timeout of 90000ms (11)
  • GitHub Check: centos-stream-9-static-linked-bins
  • GitHub Check: centos-stream-9-dynamic-linked-bins
  • GitHub Check: ubuntu-jammy-dynamic-linked-bins
  • GitHub Check: ubuntu-jammy-lint
  • GitHub Check: ubuntu-jammy-static-linked-bins
  • GitHub Check: build-macos (macos-15, true)
  • GitHub Check: build-macos (macos-13, true)
  • GitHub Check: build-macos (macos-15, false)
  • GitHub Check: build-macos (macos-13, false)
  • GitHub Check: lint-check (macos-latest)
  • GitHub Check: lint-check (ubuntu-latest)
🔇 Additional comments (3)
components/core/src/clp_s/indexer/MySQLIndexStorage.hpp (3)

41-48: Good application of move semantics and preventing object slicing

The explicit deletion of copy operations and defaulting of move operations with noexcept is excellent practice for a resource-owning class. This properly enforces RAII semantics and prevents potential issues with double-closing database connections.


58-58: Using trailing return type syntax for method declaration

The change from void add_field(...) to auto add_field(...) -> void uses modern C++ trailing return type syntax. While this is stylistically valid, ensure this pattern is applied consistently across the codebase.


62-64: Good RAII implementation with simplified member variables

The reduction of member variables to just the essentials (database connection and prepared statement) is consistent with RAII principles. This simplification makes the class easier to understand and maintain.

@Bill-hbrhbr Bill-hbrhbr changed the title refactor(indexer): Rename positional argument table-name to dataset-name for clarity; Update the default column metadata table name; Apply RAII to all classes. refactor(indexer): Apply RAII to all classes. Apr 24, 2025
@Bill-hbrhbr
Bill-hbrhbr marked this pull request as draft April 24, 2025 16:11

@gibber9809 gibber9809 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this PR superseded by #855 (and maybe some other PRs I haven't found)/can we close it?

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.

3 participants