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

Add ScalarDB Dao and related files #2417

Merged
merged 38 commits into from
Jan 31, 2025
Merged

Conversation

inv-jishnu
Copy link
Contributor

@inv-jishnu inv-jishnu commented Dec 17, 2024

Description

I have added scalarDB dao and related files used in data loader

Related issues and/or PRs

Please review this PR once the following PR is reviewed and merged (Once the PR is merged, I will merge the master to this one to resolve the spotbugs issue).

Changes made

I have added scalarDB dao and related files used in data loader

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)

Road map to merge remaining data loader core files. Current status

  • General

  • Export

  • Import

    • Dto classes and utilities: 1 PR incoming
    • Import processor and task code: 2-3 PRs incoming
    • Code for Import transaction batch and data chunk import: 1 PR Incoming
    • ControlFile related Dtos: 1 PR incoming
    • Import logger: 1 PR incoming
    • Import Manager: 1 PR incoming

Release notes

NA

@inv-jishnu inv-jishnu marked this pull request as draft December 17, 2024 11:49
@inv-jishnu inv-jishnu changed the title ScalarDB Dao and related files Add ScalarDB Dao and related files Dec 17, 2024
@inv-jishnu inv-jishnu self-assigned this Dec 19, 2024
@inv-jishnu inv-jishnu requested a review from komamitsu January 16, 2025 08:19
@inv-jishnu
Copy link
Contributor Author

@komamitsu san,
I have made changes based on your feedback.
Please take a look at this again when you get a chance.
Thank you.

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, thank you!

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.

Left a comment. Other than that, LGTM! Thank you!

@@ -0,0 +1,425 @@
package com.scalar.db.dataloader.core.dataimport.dao;

import com.scalar.db.api.*;
Copy link
Collaborator

@brfrn169 brfrn169 Jan 17, 2025

Choose a reason for hiding this comment

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

Please don't use the wildcard * for import.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated to removed usage of wildcard.
Thank you

Copy link
Contributor

@Torch3333 Torch3333 left a comment

Choose a reason for hiding this comment

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

Sorry for the late review, I left some comments, PTAL.

import java.io.IOException;
import javax.annotation.Nullable;

public class ScalarDbStorageManger {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public class ScalarDbStorageManger {
public class ScalarDbStorageManager {

import com.scalar.db.service.TransactionFactory;
import java.io.IOException;

public class ScalarDbTransactionManger {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public class ScalarDbTransactionManger {
public class ScalarDbTransactionManager {

storageAdmin = storageFactory.getStorageAdmin();
}

/** @return storage for ScalarDB connection that is running in storage mode */
Copy link
Contributor

@Torch3333 Torch3333 Jan 28, 2025

Choose a reason for hiding this comment

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

Is it repetitive but without doing this, a warning appears when compiling the code. Even if you follow the Google style guide recommendation, another warning is triggered.

 warning: [MissingSummary] A summary fragment is required; consider using the value of the @return block as a summary fragment instead.
   * @return Distributed Transaction manager for ScalarDB connection that is running in transaction
     ^
    (see https://google.github.io/styleguide/javaguide.html#s7.2-summary-fragment)
  Did you mean '*Returns distributed Transaction manager for ScalarDB connection that is running in transaction'?

Suggested change
/** @return storage for ScalarDB connection that is running in storage mode */
Returns storage for ScalarDB connection that is running in storage mode
/** @return storage for ScalarDB connection that is running in storage mode */

@inv-jishnu
Copy link
Contributor Author

@Torch3333 san,
I have made changes based on your feedback.
Please take a look at this again when you get a chance.
Thank you.

Copy link
Contributor

@Torch3333 Torch3333 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants