File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
src/main/java/redis/clients/jedis/csc Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -62,25 +62,23 @@ public void disconnect() {
62
62
63
63
@ Override
64
64
public <T > T executeCommand (final CommandObject <T > commandObject ) {
65
- CacheKey key = new CacheKey <> (commandObject );
66
- if (!clientSideCache .isCacheable (key )) {
65
+ final CacheKey cacheKey = new CacheKey (commandObject );
66
+ if (!clientSideCache .isCacheable (cacheKey )) {
67
67
clientSideCache .getStats ().nonCacheable ();
68
68
return super .executeCommand (commandObject );
69
69
}
70
70
71
- final CacheKey cacheKey = new CacheKey (commandObject );
72
71
CacheEntry <T > cacheEntry = clientSideCache .get (cacheKey );
73
-
74
- // CACHE HIT !!
75
- if (cacheEntry != null ) {
72
+ if (cacheEntry != null ) { // (probable) CACHE HIT !!
76
73
cacheEntry = validateEntry (cacheEntry );
77
74
if (cacheEntry != null ) {
75
+ // CACHE HIT confirmed !!!
78
76
clientSideCache .getStats ().hit ();
79
- return ( T ) cacheEntry .getValue ();
77
+ return cacheEntry .getValue ();
80
78
}
81
79
}
82
80
83
- // CACHE MISS!!
81
+ // CACHE MISS !!
84
82
clientSideCache .getStats ().miss ();
85
83
T value = super .executeCommand (commandObject );
86
84
if (value != null ) {
You can’t perform that action at this time.
0 commit comments