-
Notifications
You must be signed in to change notification settings - Fork 37
Add import command for data loader CLI #2618
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
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.
Left a few comments. PTAL!
TableMetadataService tableMetadataService = | ||
new TableMetadataService(storageFactory.getStorageAdmin()); |
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.
You should close the DistributedStorageAdmin
instance after use.
DistributedStorageAdmin admin = storageFactory.getStorageAdmin();
// ...
admin.close();
If there are other parts that need the same fix, could you take care of them in a separate PR?
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.
I will update the code to close it and will add necessary changes to close other instances in another PR.
} | ||
if (importOptions.getLogMode().equals(LogMode.SPLIT_BY_DATA_CHUNK)) { | ||
importManager.addListener(new SplitByDataChunkImportLogger(config, logWriterFactory)); | ||
} else importManager.addListener(new SingleFileImportLogger(config, logWriterFactory)); |
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.
Small nit:
} else importManager.addListener(new SingleFileImportLogger(config, logWriterFactory)); | |
} else { | |
importManager.addListener(new SingleFileImportLogger(config, logWriterFactory)); | |
} |
File configFile = new File(configFilePath); | ||
StorageFactory storageFactory = StorageFactory.create(configFile); | ||
TableMetadataService tableMetadataService = | ||
new TableMetadataService(storageFactory.getStorageAdmin()); |
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.
Will this DistributedStorageAdmin be closed?
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.
No, I will update the code to close it once the use is completed.
importProcessorFactory, | ||
ScalarDbMode.TRANSACTION, | ||
null, | ||
scalarDbTransactionManager.getDistributedTransactionManager()); |
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.
Will this instance be closed?
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.
Currently No. I will created another PR to make necessary changes to confirm that both transaction manager and storage are closed once the process is completed. I will make this change in core part as we can confirm the import process completion in the import manager class.
importOptions, | ||
importProcessorFactory, | ||
ScalarDbMode.STORAGE, | ||
scalarDbStorageManager.getDistributedStorage(), |
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.
Same as above
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.
No, I will update it as mentioned in the above comment,
} | ||
if (importOptions.getLogMode().equals(LogMode.SPLIT_BY_DATA_CHUNK)) { | ||
importManager.addListener(new SplitByDataChunkImportLogger(config, logWriterFactory)); | ||
} else importManager.addListener(new SingleFileImportLogger(config, logWriterFactory)); |
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.
Can you wrap this with braces?
@brfrn169 san, @komamitsu san, |
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! 👍
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.
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.
LGTM, thank you!
Co-authored-by: Peckstadt Yves <[email protected]> Co-authored-by: Toshihiro Suzuki <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]> Co-authored-by: Toshihiro Suzuki <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]> Co-authored-by: Toshihiro Suzuki <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]> Co-authored-by: Toshihiro Suzuki <[email protected]>
Co-authored-by: Peckstadt Yves <[email protected]> Co-authored-by: Toshihiro Suzuki <[email protected]>
Description
In this PR I am adding data loader import command and command options for data import.
Related issues and/or PRs
Please review this PR once the below PRs is merged and latest changes from master are merged to this branch
Changes made
I have added the import command options and import command as a CLI command for data import
Checklist
Additional notes (optional)
This is the third PR for data loader CLI.
Release notes
NA