Skip to content
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

378 persisted disk cache for cardinality queries #379

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

keski
Copy link
Collaborator

@keski keski commented Jan 27, 2025

No description provided.

@keski keski linked an issue Jan 27, 2025 that may be closed by this pull request
Copy link
Member

@hartig hartig left a comment

Choose a reason for hiding this comment

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

Good idea with the time difference for the unit tests!

Yet, I have some requests for changes to make this fit better into the overall structure of interfaces and classes that we already have.

keski and others added 8 commits January 29, 2025 10:48
…ion/access/impl/FederationAccessManagerWithPersistedDiskCacheTest.java

Co-authored-by: Olaf Hartig <[email protected]>
…ion/access/impl/FederationAccessManagerWithPersistedDiskCacheTest.java

Co-authored-by: Olaf Hartig <[email protected]>
…ion/access/impl/CardinalityCacheMap.java

Co-authored-by: Olaf Hartig <[email protected]>
…ion/access/impl/CardinalityCacheKey.java

Co-authored-by: Olaf Hartig <[email protected]>
@keski
Copy link
Collaborator Author

keski commented Jan 29, 2025

The requested changes have been addressed. @hartig, could you check if looks okay?

*
* @param entries a map of IDs to objects to be added to the cache
*/
void putAll( Map<IdType, ObjectType> map );
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand the purpose of adding this method in this particular interface. In fact, this method doesn't even seem to be used anywhere.

Shouldn't save() and load() be methods of this interface?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, putAll is no longer used. Adding save and load to the interface makes sense.

*
* @param <K> The key type for caching cardinality responses.
*/
public class CardinalityCacheMap<K> implements PersistableCache<K, CompletableFuture<CardinalityResponse>> {
Copy link
Member

Choose a reason for hiding this comment

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

I would rename this class to PersistableCardinalityCacheImpl.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this fits better with the naming scheme.

Comment on lines +58 to +59
public CompletableFuture<CardinalityResponse> issueCardinalityRequest( final SPARQLRequest req,
final SPARQLEndpoint fm )
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the other issueCardinalityRequest methods have an implementation in this class as well?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, they should. I'll add them and the corresponding tests.

Copy link
Member

Choose a reason for hiding this comment

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

Is this ready for me to look at again?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not yet, but I will let you know when it's ready. Working on it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Persisted disk cache for cardinality queries
2 participants