Skip to content
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

Refactor to partially remove deprecated Value classes usage #2328

Merged
merged 5 commits into from
Nov 7, 2024

Conversation

Torch3333
Copy link
Contributor

@Torch3333 Torch3333 commented Nov 6, 2024

Description

ScalarDB core still uses the deprecated Value interface heavily. Since I don't want to have to implement the time-related types for this deprecated interface such as TimestampValue, TimeValue, etc. I needed to replace the usage of the Value interface with the Column interface.
I refactored partially the integration test and some parts of the core main package.

I will refactor unit tests for the same reason in a later PR if necessary.

Related issues and/or PRs

Changes made

Refactor some integration tests and some classes of the core/main package to replace the usage of the Value interface by the Column interface.

Checklist

The following is a best-effort checklist. If any items in this checklist are not applicable to this PR or are dependent on other, unmerged PRs, please still mark the checkboxes after you have read and understood each item.

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

Additional notes (optional)

N/A

Release notes

N/A

@Torch3333 Torch3333 changed the base branch from master to add_time_related_types November 6, 2024 07:59
@Torch3333 Torch3333 changed the title Refactor to remove values partially Refactor to remove partially remove deprecated Values usage Nov 6, 2024
@Torch3333 Torch3333 self-assigned this Nov 6, 2024
@Torch3333 Torch3333 changed the title Refactor to remove partially remove deprecated Values usage Refactor to partially remove deprecated Values usage Nov 7, 2024
@Torch3333 Torch3333 changed the title Refactor to partially remove deprecated Values usage Refactor to partially remove deprecated Value classes usage Nov 7, 2024
@Torch3333 Torch3333 force-pushed the refactor_to_remove_values_partially branch from 35f0169 to 4281076 Compare November 7, 2024 00:29
@Torch3333 Torch3333 force-pushed the refactor_to_remove_values_partially branch from 4281076 to 68f46ef Compare November 7, 2024 00:36
col7Value);
}

private void assertResult(
Copy link
Contributor Author

@Torch3333 Torch3333 Nov 7, 2024

Choose a reason for hiding this comment

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

I refactored this class's integration test cases assertion in a common method.

@Torch3333 Torch3333 marked this pull request as ready for review November 7, 2024 01:24
// Arrange
Scan scan = prepareScan(partitionKeyType, partitionKeyValue);

// Act Assert
try (Scanner scanner = storage.scan(scan)) {
Optional<Result> result = scanner.one();
Optional<Result> optResult = scanner.one();
Copy link
Contributor

Choose a reason for hiding this comment

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

[trivial] You used resultOpt at https://github.com/scalar-labs/scalardb/pull/2328/files#diff-d6e999e6390b76c30190d9b158a27634af73f3db28349b60430a5378bf681283R271. Using unified naming convention would be better? (Either of resultOpt or optResult is fine with me)

Copy link
Contributor Author

@Torch3333 Torch3333 Nov 7, 2024

Choose a reason for hiding this comment

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

Thank you! I will use optResult.
At first, I used resultOpt but changed midway to optResult and forgot to rename that one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revised in 4031a79

Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@Torch3333
Copy link
Contributor Author

Torch3333 commented Nov 7, 2024

@komamitsu @brfrn169 @feeblefakie
Eventually, I need to merge this PR to the master branch and not the add_time_related_types feature branch since Toshi is also working on the code this PR modifies.

I will move the PR back to draft and notify you again once it is ready for review.

@Torch3333 Torch3333 marked this pull request as draft November 7, 2024 07:02
@Torch3333 Torch3333 changed the base branch from add_time_related_types to master November 7, 2024 07:28
@Torch3333 Torch3333 marked this pull request as ready for review November 7, 2024 08:22
@Torch3333
Copy link
Contributor Author

Torch3333 commented Nov 7, 2024

@komamitsu @brfrn169 @feeblefakie
I changed the base branch of the PR to the master branch. Please have a look.

I reverted some changes with 97f5c90 that should not be merged into the master branch at the moment.

Copy link
Collaborator

@brfrn169 brfrn169 left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@brfrn169 brfrn169 merged commit 8c82415 into master Nov 7, 2024
48 checks passed
@brfrn169 brfrn169 deleted the refactor_to_remove_values_partially branch November 7, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants