[DO NOT MERGE] fix: asyncbulkget when mix of hashed and unhashed keys #180
+267
−156
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: superceded by #181
Bug: if any hashed keys were present in asyncbulkget, EVCacheTranscoder would be applied to all results, and where the app had applied its own transcoder it would fallback to decoding the value to a String.
This is work in progress: need to fix TODOs, need to fix
getBulkAPI, write tests, and some cleanup.The approach taken is to pass 2 sets of keys (unhashed and hashed) and 2 transcoders down to
EVCacheClient::getAsyncBulkand then toEVCacheMemcachedClient::asyncGetBulkso that itsgotDatalistener can inspect the key and apply the right transcoder.When picking which transcoder to apply, if the key was hashed we apply the
EVCacheTranscoderbut if the key was not hashed we apply the customTranscoder- I'm not 100% sure if that is semantically the best approach (vs. say checking if the data is an EVCacheValue and if it is then applying theEVCacheTranscoder) - would appreciate a second opinion on that.Alternative approach considered was to implement a smart transcoder implementing
net.spy.memcached.transcoders.Transcoderto do the right thing, but since the transcoder's decode doesn't know the key to lookup and it'd have to rely entirely on flags and data- i dont think that would cover all the cases either but happy to be proven wrong.