-
Notifications
You must be signed in to change notification settings - Fork 37
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
Export options and basic export report dto #2397
Conversation
@@ -34,4 +34,9 @@ | |||
<Bug pattern="ODR_OPEN_DATABASE_RESOURCE"/> | |||
</Or> | |||
</Match> | |||
<!-- Ignore mutable object exposure warnings(caused by Lombok) for all classes in dataloader.core --> | |||
<Match> |
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.
Lombok does not work well with Spotbugs. To avoid having to disable the bug patterns for all projects, the rules are only disabled for the com.scalar.db.dataloader.core.*
package.
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.
LGTM! 👍
* exported file. AtomicInteger is used because it is thread safe and this parameter is a counter | ||
* which is updated inside threads | ||
*/ | ||
private final AtomicInteger exportedRowCount; |
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.
[minor] This can be initialized here.
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.
I have moved the initialisation as suggested (I have changed AtomicInteger to LongAdder based on Suzuki-san suggestion).
Thank you.
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.
LGTM, thank you!
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.
Left a couple of comments. Please take a look when you have time!
* exported file. AtomicInteger is used because it is thread safe and this parameter is a counter | ||
* which is updated inside threads | ||
*/ | ||
private final AtomicInteger exportedRowCount; |
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.
LongAdder
might be useful here:
https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/atomic/LongAdder.html
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.
Thank you for the suggestion.
I have replaced AtomicInteger
with LongAdder
.
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class ExportReportTest { |
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.
public class ExportReportTest { | |
class ExportReportTest { |
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.
I have updated it as suggested.
Thank you.
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.
It looks like it's not updated?
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.
@brfrn169
My apologies, I think I missed to commit the file. I have pushed the change now.
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.
LGTM! Thank you!
Co-authored-by: Peckstadt Yves <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]>
Description
Added export options builder and export report class
Related issues and/or PRs
PR dependency
Changes made
Added export options builder and export report class
Checklist
Additional notes (optional)
This PR is part of the on-going process of merging all ScalarDB Data Loader code into the main repository.
Release notes
NA