-
Notifications
You must be signed in to change notification settings - Fork 101
End to end tests for Redis. #1405
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
base: master
Are you sure you want to change the base?
Conversation
# Conflicts: # .gitignore # core-tests/e2e-tests/pom.xml
| .filter(command -> command.getType().shouldCalculateHeuristic()) | ||
| .forEach(redisCommand -> { | ||
| RedisDistanceWithMetrics distanceWithMetrics = computeDistance(redisCommand, redisClient); | ||
| RedisDistanceWithMetrics distanceWithMetrics = computeDistance(redisCommand, (RedisClient) redisClient); |
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.
hi. thx @aszyrej i think it is best if @jgaleotti gives first round of comments, and then, after updating, i ll give my pass. but one thing here that caught my eyes is: why turning RedisClient into Object reference if anyway you do a cast to (RedisClient) here?
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.
Hi @arcuri82 . The reason why I'm using Object is just to be aligned with the solutions for Mongo and OpenSearch where they used Object for the clients. It's not necessary to keep it this way and since I have a dedicated class for encapsulating the client logic, I could refactor it and keep that class instead of Object.
I'll proceed with this if you agree.
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.
the reason for using private Object mongoClient is that cannot have dependencies to actual Mongo code, and must do access via reflection. if for Redis you encapsulate all the code for reflection in your own RedisClient that is different from io.lettuce.core.RedisClient, then no point in storing it as an Object reference. Btw, for clarity, your own RedisClient could be renamed into ReflectionBasedRedisClient (or something like that)
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.
Hi @arcuri82, I've renamed that class into ReflectionBasedRedisClient as we discussed, and changed the type in RedisHandler.
|
hi @jgaleotti it would be best if you look at this PR first, and then, after you approve it, i review it as well |
First e2e-test for Redis.
Includes GET and SET commands, applying Redis heuristics.