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

pds-api 68 : Add hits and took #61

Merged
merged 5 commits into from
Sep 2, 2021
Merged

pds-api 68 : Add hits and took #61

merged 5 commits into from
Sep 2, 2021

Conversation

al-niessner
Copy link
Contributor

Summary*
Added hits and took to the swagger. Adjusted the logic to fill in these items.

Test Data and/or Report

Using a standard curl, the results now show 'hits' and 'took':

$ curl --header 'Accept: application/json' "http://localhost:8080/bundles/urn:nasa:pds:izenberg_pdart14_meap::1.0/products?limit=1&start=0&fields=ops:Label_File_Info.ops:md5_checksum&only-summary=true"

{"summary":{

  "hits":65, "took":168,

"start":0,"limit":1,"sort":[],"properties":["vid","product_class","ops:Label_File_Info/ops:md5_checksum","ref_lid_instrument_host","ref_lid_investigation","lidvid","ref_lid_target","title","ref_lid_instrument","ops:Label_File_Info/ops:file_ref"]}}

Stating that there are 65 possibilities (hits) and it the processing time was 168 ms (took).

Related Issues

* fixes issues in [pds-api] repo:
    - [68](https://github.com/NASA-PDS/pds-api/issues/68)
    - [87](https://github.com/nasa-pds/pds-api/issues/87)
    - [105](https://github.com/NASA-PDS/pds-api/issues/105)
    - #31 (actually this repo)

Al Niessner added 2 commits August 18, 2021 12:54
Found that the API had removed the keyword in the arguments but never updated any of the code. Not sure on the correct fix, so just half removed it in this commit. If it really should be removed, then that is another ticket to finish the job.
Used the eclipse search to find all creations of the Summary then added hits and tooks to all of them.
@al-niessner al-niessner requested a review from a team as a code owner August 18, 2021 21:12
@al-niessner
Copy link
Contributor Author

@jordanpadams @tloubrieu-jpl

None of the checks run because cannot reliably update the api artifact for your automatic scripts to use. Anyway, ready for review as all 4 tickets are complete and tested as shown in the initial block of this pull request.

@tloubrieu-jpl
Copy link
Member

@al-niessner I am expecting an update of the swagger definition of the API with the new hits and took attributes. I am not seeing a branch on the swagger-ui or on the pds-qpi-javalib repository for that. The registry-api-service repo does not build without these updates apparently.

Thanks,

Thomas

@tloubrieu-jpl
Copy link
Member

@al-niessner I am expecting an update of the swagger definition of the API with the new hits and took attributes. I am not seeing a branch on the swagger-ui or on the pds-qpi-javalib repository for that. The registry-api-service repo does not build without these updates apparently.

Thanks,

Thomas

@al-niessner you can ignore this comment, I found the branch on swagger I did not scroll down the version menu.

@tloubrieu-jpl
Copy link
Member

@al-niessner , @jordanpadams, I am wondering what "-1 indicating an excessive amount of resource required to compute it" does mean ? I guess we are sometimes unable to get the number of results matching the request criteria. Is that what it means ?

@al-niessner
Copy link
Contributor Author

@al-niessner , @jordanpadams, I am wondering what "-1 indicating an excessive amount of resource required to compute it" does mean ? I guess we are sometimes unable to get the number of results matching the request criteria. Is that what it means ?

There could be cases because of nested looping where it may be desirable not to spend the hours (excessive time/resources) computing the total number of hits but rather return in the millisecond of getting the information the user requested.

Currently, we spend the excessive time/resources with a future option being to once again optimize it when the extra delays are better understood. I just left the -1 in the API for the future.

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.

The keyword parameter should be added back in the code.
The naming of the variable still makes it unclear to me how the code works.

Thanks

@jordanpadams
Copy link
Member

@al-niessner would you mind quickly reviewing my changes here (revert keyword removal) and here (fix merge conflicts) so we can merge the PR?

@al-niessner
Copy link
Contributor Author

@al-niessner would you mind quickly reviewing my changes here (revert keyword removal) and here (fix merge conflicts) so we can merge the PR?

Keyword revert is fine if changes from main support it. Problem I had was that it only appeared in code but not in api maven artifact. If it is in api maven artifact, then it should be reinstated in the code.

The second change should not be returned to service. There is more comprehensive code for lid to lidvid lookups and the fix for returning 404 when lid/lidvid do not exist requires that those lines be removed. Looks like you may have a bad merge somewhere back on the main branch.

Copy link
Contributor Author

@al-niessner al-niessner left a comment

Choose a reason for hiding this comment

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

The if part is no longer desired.

The call to convert lid to lidvid is more comprehensive than the if states which in turn will break the desire that non-existent lidvid return a 404.
@al-niessner
Copy link
Contributor Author

@jordanpadams @jimmie

Fixed the fix. Should be good for a merge.

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.

3 participants