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 automatic namespacing #3781
base: master
Are you sure you want to change the base?
Conversation
- Demonstrated automatic key-prefixing for all subclasses of UnifiedJedis: JedisCluster, JedisPooled, and JedisSentineled - Key-prefixing is possible as long as the underlying CommandObjects can be customized. - CommandObjects cannot use commandArguments in its constructor since in the specific case of key-prefixing, commandArguments depends on the child constructor running first. So we lose caching of argument-less CommandObjects. - Based on this POC, the minimum changes required to jedis would be: - public constructors that allow UnifiedJedis and its subclasses to take a custom CommandObjects. - Consistent use of supplied CommandObjects throughout code (e.g. in Pipeline, Transaction, etc). - Removal of caching of argument-less CommandObjects in the constructor of CommandObjects. - Applications can then supply CommandObjects with custom behavior as necessary. Sample classes that implement the behavior of prefixed keys, etc are provided but these can be supplied by the application as long as required constructors are available.
- Restore cached key-less commands in CommandObjects - Support Transactions - New constructors do not take CommandExecutor - Requested JavaDoc regarding new constructors specifying RedisProtocol - New classes moved into 'prefix' packages - De-duplicate prefixing code
- Restore public Transaction constructor that was removed - Use Connection.executeCommand instead of Connection.sendCommand
Pasting my thoughts from #3770:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3781 +/- ##
============================================
- Coverage 82.15% 82.11% -0.04%
- Complexity 6016 6035 +19
============================================
Files 301 302 +1
Lines 15273 15329 +56
Branches 1190 1198 +8
============================================
+ Hits 12547 12588 +41
- Misses 2159 2168 +9
- Partials 567 573 +6 ☔ View full report in Codecov by Sentry. |
Support automatic namespacing (key prefixing) by handler (key pre-processing) interface.
This is based on #3770 by @killergerbah