Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

pds-api-56: crawl the hierarchical tree #29

Merged
merged 15 commits into from
May 20, 2021
Merged

pds-api-56: crawl the hierarchical tree #29

merged 15 commits into from
May 20, 2021

Conversation

al-niessner
Copy link
Contributor

@al-niessner al-niessner commented May 18, 2021

Summary*
Work was done in branches off this branch that match this epic's dependents. All now work according to ./verify/issue_56.py.

Test Data and/or Report
./verify/issue_56.py

Related Issues
Fixed PDS-API issues

  • nasa-pds/pds-api#56

And sub-tickets:

  • nasa-pds/pds-api#59
  • nasa-pds/pds-api#60
  • nasa-pds/pds-api#61
  • nasa-pds/pds-api#62

Al Niessner added 11 commits May 11, 2021 10:18
The POM needs to request the correct version of the api JAR file.

Update the 3 API interfaces with the new methods. Currently they are blank place holders and the appropriate branches will be created to fill in each of the bodies. The branches will be created from here then merged back.
Basically use the search capabilities to find where the collection lid shows up in the ref_lid_collection variable. Pretty straight forward.
Pretty straight foward finding all collections that hold a this product then all bundles that reference those collections.
@al-niessner
Copy link
Contributor Author

@tloubrieu-jpl @jordanpadams

All sub items of PDS API 56 are implemented and tested. Please review.

Copy link
Member

@tloubrieu-jpl tloubrieu-jpl left a comment

Choose a reason for hiding this comment

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

This request returns observational_products:
curl --location --request GET 'http://localhost:8080/products/urn:nasa:pds:orex.ovirs:data_raw:20191117t030457s365_ovr_scil0.fits::1.0/bundles'

I am expecting to only see bundles in the result.

I don't have a result with this request:

curl --location --request GET 'http://localhost:8080/products/urn:nasa:pds:orex.ovirs:data_raw:20191117t030457s365_ovr_scil0.fits::1.0/collections'

I am testing with the following bundle archive loaded in my registry:
dph.tar.gz

The other request work for me, I will close the tickets so that we can focus on the remaining one.


if (getCollectionResponse.isExists())
{
MyBundlesApiController.log.info("get ref response " + getCollectionResponse.toString());
Copy link
Member

Choose a reason for hiding this comment

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

The iteratable class available on https://github.com/NASA-PDS/registry-api-service/tree/master/src/main/java/gov/nasa/pds/api/engineering/elasticsearch/business can be used to find the list of products of a collection between start and start+limit without having to load all products in memory.

This method could also be implemented as an iterator.

That will be convenient to re-use the code since we want also to optimize the code which access the products of the collection by doing a single request for all the products instead of one per product as you do in line 277.

Since that works anyway here, we can work on the code re-useability in the optimization ticket #13

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It cannot. In order to complete the search, first have to get the bundle then all collections then all products. The limits and pagination are over all products not bundles and collections, therefore bundle and collections have to be read to build the products list before pagination can take place. Ugly, but that is part of one of the various emails with @jordanpadams were the punch line was pagination is products not collections in this case.

As I stated in that email also, the iterator also reads all the data. It is not possible to do fractional searches unless state is saved and all these interfaces are REST.

@al-niessner
Copy link
Contributor Author

This request returns observational_products:
curl --location --request GET 'http://localhost:8080/products/urn:nasa:pds:orex.ovirs:data_raw:20191117t030457s365_ovr_scil0.fits::1.0/bundles'

I am expecting to only see bundles in the result.

I don't have a result with this request:

curl --location --request GET 'http://localhost:8080/products/urn:nasa:pds:orex.ovirs:data_raw:20191117t030457s365_ovr_scil0.fits::1.0/collections'

@tloubrieu-jpl

What are observational_products? How are they different than bundles?

Good find on /products/x/collections. I was returning the contents from registry-ref not registry. Added content to pull actual collection so it should work correctly now.

@al-niessner
Copy link
Contributor Author

@tloubrieu-jpl

Please post the registry-ref JSON object that you have here.

@tloubrieu-jpl
Copy link
Member

@al-niessner actually the first request (products/x/bunldes) works when the lidivid is available in registry-refs.

I made a mistake by using a lidvid which had no bundle. In this case something weird is happening since we have some responses with your code. Maybe an unexpected elasticSearch request behavior is causing that ?

@al-niessner
Copy link
Contributor Author

@al-niessner actually the first request (products/x/bunldes) works when the lidivid is available in registry-refs.

I made a mistake by using a lidvid which had no bundle. In this case something weird is happening since we have some responses with your code. Maybe an unexpected elasticSearch request behavior is causing that ?

@tloubrieu-jpl Did the lidvid not exist at all or did it identify something not a bundle? I find this behavior very intriguing.

If the lidvid is wrong, make sure that nothing is returned. This was added because it was found that the double search of /products/x/bundles returned multiple responses instead of 0. Because the second search had no criteria it returned the entire database. Added code to prevent this then added negative checks for all URLs.
@al-niessner
Copy link
Contributor Author

@tloubrieu-jpl

Identified problem and fixed it.

@tloubrieu-jpl
Copy link
Member

Thanks @al-niessner I will look at that now.

Per your question on bundles/obserational products you can look at the representation of the PDS4 model in section 4. Scope https://pds.nasa.gov/datastandards/documents/im/v1/index_1F00.html

We can discuss that during the breakout.

@tloubrieu-jpl tloubrieu-jpl merged commit 9c8d291 into master May 20, 2021
@tloubrieu-jpl
Copy link
Member

@al-niessner actually the first request (products/x/bunldes) works when the lidivid is available in registry-refs.
I made a mistake by using a lidvid which had no bundle. In this case something weird is happening since we have some responses with your code. Maybe an unexpected elasticSearch request behavior is causing that ?

@tloubrieu-jpl Did the lidvid not exist at all or did it identify something not a bundle? I find this behavior very intriguing.

@al-niessner the lidvid exists but it does not belong to a collection. So it is available in the registry index but not in the registry-refs index.

@tdddblog tdddblog deleted the pds-api-56 branch September 21, 2021 20:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants