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
add user rdf types cache #1935
add user rdf types cache #1935
Conversation
assertThat(types, containsInAnyOrder(ANIMAL_TYPE)); | ||
|
||
types = cache.getUserTypes(fedoraId, sessionId2, rdfSupplier(ANIMAL_TYPE, CAT_TYPE)); | ||
assertThat(types, containsInAnyOrder(ANIMAL_TYPE, CAT_TYPE)); |
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 think I get what you mean here, but just wondering. If you called
types = cache.getUserTypes(fedoraId, sessionId2, noCallSupplier());
would types == emptyList()
?
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, because the noCallSupplier()
throws an exception when it's called. It's just used in the tests to ensure that the values are returned from the cache and were not newly loaded.
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.
👍
JIRA Ticket: https://fedora-repository.atlassian.net/browse/FCREPO-3732
What does this Pull Request do?
Adds a cache for user rdf types so that they do not need to be repeatedly loaded from disk.
How should this be tested?
Everything should work the same as before except triples should never be loaded from disk when creating or updating resources. I added a new debug log that will log every time a resource's triples are loaded. If you enable debug logging you should be able to confirm that the triples are no longer read when creating resources.
Key things to look at:
Interested parties
@fcrepo/committers