Skip to content

Cache index using hashcodes of cache member identifiers#16

Merged
asgeirn merged 13 commits intomasterfrom
hashcodes
Nov 8, 2019
Merged

Cache index using hashcodes of cache member identifiers#16
asgeirn merged 13 commits intomasterfrom
hashcodes

Conversation

@asgeirn
Copy link
Copy Markdown
Contributor

@asgeirn asgeirn commented Dec 7, 2018

This PR enables an index for cache members based on hashcodes of their identifiers.

The hashcodes must be provided externally, hence CacheService adds an updateCache() method where implementing caches can provide the cache members already wrapped in CacheObject with the index hashcodes calculated.

Cache gets a new filter(hashcode, Predicate) method to do a first-pass of retrieving all members with matching hashcodes before evaluating the Predicate.

The change is backwards compatible, as the methods maintaining and using the index is added alongside the original CacheService.update() and Cache.filter() methods.

In order to actually use the index, the consumer must be updated to use these new methods in the model cache services. Code for this is in FINTLabs/fint-consumer#10

Initial tests of this index suggests up to 10x quicker responses on model cache service getXXbyID() method calls.

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 18, 2018

Coverage Status

Coverage decreased (-16.4%) to 78.916% when pulling bffbb81 on hashcodes into 6f2b6ed on master.

Copy link
Copy Markdown
Contributor

@fsjovatsen fsjovatsen left a comment

Choose a reason for hiding this comment

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

@asgeirn fikser du konfliktene så merger vi etterpå?

# Conflicts:
#	build.gradle
#	src/test/groovy/no/fint/cache/FintCacheIntegrationSpec.groovy
#	src/test/groovy/no/fint/cache/HazelcastCacheIntegrationSpec.groovy
@asgeirn asgeirn requested a review from fsjovatsen September 25, 2019 13:10
@asgeirn
Copy link
Copy Markdown
Contributor Author

asgeirn commented Sep 25, 2019

@asgeirn fikser du konfliktene så merger vi etterpå?

@fsjovatsen Fikset nå!

@asgeirn asgeirn merged commit 0585aa3 into master Nov 8, 2019
@asgeirn asgeirn deleted the hashcodes branch November 8, 2019 10:43
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.

3 participants