Skip to content
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 white-list and black-list commands and keys #3740

Closed
wants to merge 12 commits into from

Conversation

sazzad16
Copy link
Collaborator

  • Separate csc package
  • Add config interface for only client-side caching
  • Support white-list and black-list commands and keys

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 78.04878% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 75.10%. Comparing base (26606b9) to head (2f3d98a).

❗ Current head 2f3d98a differs from pull request most recent head ae3b2e3. Consider uploading reports for the commit ae3b2e3 to get more accurate results

Files Patch % Lines
...StringWhiteListBlackListClientSideCacheConfig.java 66.66% 0 Missing and 5 partials ⚠️
.../java/redis/clients/jedis/util/JedisURIHelper.java 0.00% 2 Missing ⚠️
...ava/redis/clients/jedis/JedisClusterInfoCache.java 0.00% 1 Missing ⚠️
...redis/clients/jedis/csc/ClientSideCacheConfig.java 0.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##              5.2.0    #3740      +/-   ##
============================================
- Coverage     75.54%   75.10%   -0.44%     
+ Complexity     4984     4981       -3     
============================================
  Files           300      303       +3     
  Lines         15241    15261      +20     
  Branches       1157     1163       +6     
============================================
- Hits          11514    11462      -52     
- Misses         3221     3286      +65     
- Partials        506      513       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yangbodong22011
Copy link
Collaborator

Should we use allow-list and deny-list?

@sazzad16
Copy link
Collaborator Author

Should we use allow-list and deny-list?

@uglide Should we?
@chayim ?

Copy link
Contributor

@gerzse gerzse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some naming related commends.

src/main/java/redis/clients/jedis/Connection.java Outdated Show resolved Hide resolved
}

@Override
public boolean isCacheable(ProtocolCommand command, Object... keys) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that there is a default in the interface, this is not needed.

@@ -74,7 +78,7 @@ public static RedisProtocol getRedisProtocol(URI uri) {

private static final Integer ZERO_INTEGER = 0;

public static ClientSideCache getClientSideCache(URI uri) {
public static ClientSideCacheConfig getClientSideCache(URI uri) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a new argument, a cache config builder? Can be Function<ClientSideCache, ClientSideCacheConfig>. That might be a breaking change, so it can be a new method, to have an alternative.

@sazzad16 sazzad16 closed this Mar 6, 2024
@sazzad16 sazzad16 deleted the csc-white-black-config branch March 6, 2024 08:04
@uglide
Copy link
Contributor

uglide commented Mar 11, 2024

@sazzad16 LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants