-
Notifications
You must be signed in to change notification settings - Fork 263
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
Provide byte-range reading of remote datasets #1267
Conversation
re: issue #1251 Assume that you have the URL to a remote dataset which is a normal netcdf-3 or netcdf-4 file. This PR allows the netcdf-c to read that dataset's contents as a netcdf file using HTTP byte ranges if the remote server supports byte-range access. Originally, this PR was set up to access Amazon S3 objects, but it can also access other remote datasets such as those provided by a Thredds server via the HTTPServer access protocol. It may also work for other kinds of servers. Note that this is not intended as a true production capability because, as is known, this kind of access to can be quite slow. In addition, the byte-range IO drivers do not currently do any sort of optimization or caching. An additional goal here is to gain some experience with the Amazon S3 REST protocol. This architecture and its use documented in the file docs/byterange.dox. There are currently two test cases: 1. nc_test/tst_s3raw.c - this does a simple open, check format, close cycle for a remote netcdf-3 file and a remote netcdf-4 file. 2. nc_test/test_s3raw.sh - this uses ncdump to investigate some remote datasets. This PR also incorporates significantly changed model inference code (see the superceded PR #1259). 1. It centralizes the code that infers the dispatcher. 2. It adds support for byte-range URLs Other changes: 1. NC_HDF5_finalize was not being properly called by nc_finalize(). 2. Fix minor bug in ncgen3.l 3. fix memory leak in nc4info.c 4. add code to walk the .daprc triples and to replace protocol= fragment tag with a more general mode= tag. Final Note: Th inference code is still way too complicated. We need to move to the validfile() model used by netcdf Java, where each dispatcher is asked if it can process the file. This decentralizes the inference code. This will be done after all the major new dispatchers (PIO, Zarr, etc) have been implemented.
This pull request introduces 2 alerts when merging bf2746b into b16ecea - view on LGTM.com new alerts:
Comment posted by LGTM.com |
Ok, I fixed the alerts, but I am baffled by the appveyor complaint. |
Ok, so I compared the problem structure (in H5FDpublic.h) for versions 1.8.17 |
between HDF5 versions 1.8 and 1.10. So modify H5FDhttp.c to be conditional on the HDF5 major+minor version from H5public.h
Merged in modifications from |
Seeing failures in the following tests when running which
Details available at http://cdash.unidata.ucar.edu/viewTest.php?onlyfailed&buildid=7195 |
I think I forgot to enable pnetcdf. Without pnetcdf, I get no failures. |
I've updated the travis images so that the proper errors are being reported now. |
So, fixed the following: 1. Forgot to check for NC_FORMATX_PNETCDF case in one of the switches in NC_infermodel. 2. Accidentally turned on both the NC_64BIT_OFFSET and the NC_64BIT_DATA mode flags.
Added fixes for the parallel case. |
conflictset(MF,model->format,NC_FORMAT_64BIT_DATA); | ||
} | ||
if(fIsSet(cmode,NC_NETCDF4)) { | ||
conflictset(MF,model->format,NC_FORMAT_NETCDF4); |
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'm looking at an issue where passing NC_NOWRITE | NC_64BIT_OFFSET | NC_NETCDF4 | NC_CLASSIC_MODEL
flags worked in 4.6.2, but fails in 4.7.0 in this function. It seems to be detecting that we have the NC_FORMAT_64BIT_OFFSET
as the format and then fails here because the format has already been set. Is this intended? Should it have worked before?
I would say that since NC_64BIT_OFFSET => classic format |
Thanks. Removing the |
NetCDF 4.7.0 now detects this as an error because the mode is requesting a 64-bit offset format and a netcdf4 format and errors due to a conflicting format being requested. Upstream says that mixing these is an error. See: Unidata/netcdf-c#1267
Assume that you have the URL to a remote dataset
which is a normal netcdf-3 or netcdf-4 file.
This PR allows the netcdf-c to read that dataset's
contents as a netcdf file using HTTP byte ranges
if the remote server supports byte-range access.
Originally, this PR was set up to access Amazon S3 objects,
but it can also access other remote datasets such as those
provided by a Thredds server via the HTTPServer access protocol.
It may also work for other kinds of servers.
Note that this is not intended as a true production
capability because, as is known, this kind of access to
can be quite slow. In addition, the byte-range IO drivers
do not currently do any sort of optimization or caching.
An additional goal here is to gain some experience with
the Amazon S3 REST protocol.
This architecture and its use documented in
the file docs/byterange.dox.
There are currently two test cases:
for a remote netcdf-3 file and a remote netcdf-4 file.
datasets.
This PR also incorporates significantly changed model inference code
(see the superceded PR #1259).
Other changes:
fragment tag with a more general mode= tag.
Final Note:
Th inference code is still way too complicated. We need to move
to the validfile() model used by netcdf Java, where each
dispatcher is asked if it can process the file. This decentralizes
the inference code. This will be done after all the major new
dispatchers (PIO, Zarr, etc) have been implemented.