-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Support for client-side caching - phase 2 #3673
Conversation
@@ -24,7 +24,7 @@ public JedisClientSideCache(final HostAndPort hostPort, final JedisClientConfig | |||
|
|||
private void clientTrackingOn() { | |||
String reply = connection.executeCommand(new CommandObject<>( | |||
new CommandArguments(Protocol.Command.CLIENT).add("TRACKING").add("ON").add("BCAST"), | |||
new CommandArguments(Protocol.Command.CLIENT).add("TRACKING").add("ON"), |
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.
Correct, though make sure you're cognizant of (hopefully) future support for broadcast and friends.
ensureFillSafe(); | ||
return buf[count]; | ||
public boolean peek(byte b) throws JedisConnectionException { | ||
ensureFill(); // in current design, at least one reply is expected. so ensureFillSafe() is not necessary. |
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.
But, what happens if there is no reply? It shouldn't occur, but maybe there's something we can do for resiliency here. At the very least raise a data specific exception so that we can know this happened?
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.
@chayim A JedisConnectionException wrapping a ReadTimeoutException will be thrown.
jedis.set("foo", "bar"); | ||
assertEquals("bar", jCache.get("foo")); | ||
jedis.del("foo"); | ||
assertNull(jCache.get("foo")); | ||
assertThat(jCache.get("foo"), Matchers.oneOf("bar", null)); // ? |
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.
Can this be achieved without adding this import?
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.
@chayim We'd have to write a "utility" method.
But why bother? We already have these as our test dependency and being used in some other tests.
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.
General desire to have fewer dependencies.. even if it's just for test. Not a hard requirement.
No description provided.