-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Second iteration on key-prefixing POC
- 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
- Loading branch information
R-J Lim
committed
Mar 16, 2024
1 parent
84ee29d
commit 872fcfd
Showing
21 changed files
with
307 additions
and
194 deletions.
There are no files selected for viewing
46 changes: 0 additions & 46 deletions
46
src/main/java/redis/clients/jedis/ClusterCommandArgumentsWithPrefixedKeys.java
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
src/main/java/redis/clients/jedis/CommandArgumentsWithPrefixedKeys.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/redis/clients/jedis/util/prefix/ClusterCommandArgumentsWithPrefixedKeys.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package redis.clients.jedis.util.prefix; | ||
|
||
import redis.clients.jedis.ClusterCommandArguments; | ||
import redis.clients.jedis.CommandArguments; | ||
import redis.clients.jedis.commands.ProtocolCommand; | ||
|
||
public class ClusterCommandArgumentsWithPrefixedKeys extends ClusterCommandArguments { | ||
private final byte[] prefixBytes; | ||
private final String prefixString; | ||
|
||
public ClusterCommandArgumentsWithPrefixedKeys(ProtocolCommand command, String prefixString, byte[] prefixBytes) { | ||
super(command); | ||
this.prefixString = prefixString; | ||
this.prefixBytes = prefixBytes; | ||
} | ||
|
||
public CommandArguments key(Object key) { | ||
return super.key(Prefixer.prefixKey(key, prefixString, prefixBytes)); | ||
} | ||
} |
9 changes: 7 additions & 2 deletions
9
...lusterCommandObjectsWithPrefixedKeys.java → ...lusterCommandObjectsWithPrefixedKeys.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
package redis.clients.jedis; | ||
package redis.clients.jedis.util.prefix; | ||
|
||
import redis.clients.jedis.ClusterCommandArguments; | ||
import redis.clients.jedis.ClusterCommandObjects; | ||
import redis.clients.jedis.commands.ProtocolCommand; | ||
import redis.clients.jedis.util.SafeEncoder; | ||
|
||
public class ClusterCommandObjectsWithPrefixedKeys extends ClusterCommandObjects { | ||
private final String prefixString; | ||
private final byte[] prefixBytes; | ||
|
||
public ClusterCommandObjectsWithPrefixedKeys(String prefixString) { | ||
this.prefixString = prefixString; | ||
prefixBytes = SafeEncoder.encode(prefixString); | ||
} | ||
|
||
@Override | ||
protected ClusterCommandArguments commandArguments(ProtocolCommand command) { | ||
return new ClusterCommandArgumentsWithPrefixedKeys(command, prefixString); | ||
return new ClusterCommandArgumentsWithPrefixedKeys(command, prefixString, prefixBytes); | ||
} | ||
} |
Oops, something went wrong.