Repository navigation
Conversation
…etAccessor [libcurl])
cbielow
left a comment
There was a problem hiding this comment.
interesting feature.
Some code beween S3InputSource and S3ChunkedInputSource seems repetitive and might benefit from refactor?!
| #include <aws/s3/model/GetObjectRequest.h> | ||
| #include <aws/core/Aws.h> | ||
| #include <aws/s3/S3Client.h> |
There was a problem hiding this comment.
this will choke without S3's headers?
make conditional?
| option(WITH_GUI "Build GUI parts of OpenMS (TOPPView&Co). This requires QtGui." ON) | ||
| option(NO_WEBENGINE_WIDGETS "Do not use QtWebengineWidgets. Disables Javascript views in TOPPView." OFF) | ||
| option(WITH_HDF5 "Build HDF5 parts of OpenMS." OFF) | ||
| option(WITH_S3 "Build with S3 loading support" OFF) |
There was a problem hiding this comment.
| option(WITH_S3 "Build with S3 loading support" OFF) | |
| option(WITH_S3 "Build with Amazon-S3 loading support" OFF) |
| #include <xercesc/util/BinInputStream.hpp> | ||
| #include <aws/s3/model/GetObjectResult.h> | ||
| #include <aws/s3/model/GetObjectRequest.h> | ||
| #include <aws/core/Aws.h> |
There was a problem hiding this comment.
this should (!) be Apache2 licensed, and compatible to our stuff. Nice.
| Aws::S3::Model::GetObjectRequest getObjectRequest; | ||
| getObjectRequest.WithBucket(m_bucketName).WithKey(m_objectKey); | ||
|
|
||
| auto getObjectOutcome = new Aws::S3::Model::GetObjectOutcome(s3Client.GetObject(getObjectRequest)); |
There was a problem hiding this comment.
this is a potential memleak.
Use uniquePtr
| m_bzStream.next_in = NULL; | ||
|
|
||
| if (BZ2_bzDecompressInit(&m_bzStream, 0, 0) != BZ_OK) { | ||
| throw new std::runtime_error("Error occurred during bzip decompression"); |
There was a problem hiding this comment.
now need to dynamically allocate a new object. Just throw the thing!
(more occurrences below)
| Aws::S3::Model::GetObjectRequest getObjectRequest; | ||
| getObjectRequest.WithBucket(m_bucketName).WithKey(m_objectKey); | ||
|
|
||
| auto getObjectOutcome = new Aws::S3::Model::GetObjectOutcome(s3Client.GetObject(getObjectRequest)); |
| FileTypes::Type ft_name = FileHandler::getTypeByFileName(file_); | ||
| FileTypes::Type ft_content = FileHandler::getTypeByContent(file_); | ||
| if (ft_name != ft_content) | ||
| if (!file_.hasPrefix("http://") && !file_.hasPrefix("https://") && !file_.hasPrefix("ftp://") && !file_.hasPrefix("s3://")) |
There was a problem hiding this comment.
this kind of query looks useful in a more general scope.
Since its used repetitively here, can this the externalized to something like:
/// check if filename starts with http, https, ftp or s3 followed by `://`
bool File::isRemoteFile(const std::string& filename);|
Thanks a lot! Yes, I was thinking about re-using a bit more. I will check what's doable. I am also not sure if and how I should offer the two types of "reading". Should probably go in some configuration of the XMLHandler or decide based on file size. I just figured out late, that by default it loads the whole file into memory first. Better safeguarding against missing SDK is also on the list. |
Good point. Given the large files these days, probably chunked is enough and more memory efficient? Maybe a quick benchmark can tell if chunked is even noticeably slower and depending on the outcome, just keeping chunked?! |
|
@timosachsenberg We should revisit this, now that parquet has the AWS dependency anyway. |
|
@timosachsenberg this would also be really cool to finish. Now that we have AWS for arrow anyway. And will need curl if we get rid of qtnetwork, we would get this for freee |
|
It was basically finished but badly tested. Now there are some conflicts of course |
|
Ok I can bring it up to current state I think |
Code Review & FixesI've reviewed this PR and made several fixes in commit f59ba4f. Here's a summary: Critical Fixes (would break build or cause crashes)
Medium Priority Fixes
Minor Fixes
Remaining TODOs from PR description
The PR should now compile correctly with |
|
Closing in favor of #8671 - Claude Code couldn't push to this branch due to GitHub OAuth workflow permissions, so opened a new PR with the rebased and fixed code. |
S3: AWS SDK if present
FTP/HTTP(S): Xerces NetAccessor, i.e. if built with libcurl support (apt, brew = default, but not in contrib)
TODO:
Description
Checklist
How can I get additional information on failed tests during CI
Click to expand
If your PR is failing you can check outIf you click in the column that lists the failed tests you will get detailed error messages.
Advanced commands (admins / reviewer only)
Click to expand
/reformat(experimental) applies the clang-format style changes as additional commit. Note: your branch must have a different name (e.g., yourrepo:feature/XYZ) than the receiving branch (e.g., OpenMS:develop). Otherwise, reformat fails to push.rebuild jenkinswill retrigger Jenkins-based CI builds