Skip to content

Commit

Permalink
OSS Broadcast support (#3285)
Browse files Browse the repository at this point in the history
* OSS Cluster Broadcast - Approach 2

* modify

* Added doc

* Added configSet

* Added example as Java class

* Added exception message from code review

* Added the link of examples package in README

* Deleted doc

* Addressed review
  • Loading branch information
sazzad16 authored Feb 27, 2023
1 parent 6219196 commit 6d60ed6
Show file tree
Hide file tree
Showing 13 changed files with 229 additions and 256 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,22 @@ Now you can use the `JedisCluster` instance and send commands like you would wit
jedis.sadd("planets", "Mars");
```

## Documentation

The [Jedis wiki](http://github.com/redis/jedis/wiki) contains several useful articles for using Jedis.

You can also check the [latest Jedis Javadocs](https://www.javadoc.io/doc/redis.clients/jedis/latest/index.html).

Some specific use-case examples can be found in [`redis.clients.jedis.examples`
package](src/test/java/redis/clients/jedis/examples/) of the test source codes.

## Using Redis modules

Jedis includes support for [Redis modules](https://redis.io/docs/modules/) such as
[RedisJSON](https://oss.redis.com/redisjson/) and [RediSearch](https://oss.redis.com/redisearch/).

See the [RedisJSON Jedis](docs/redisjson.md) or [RediSearch Jedis](docs/redisearch.md) for details.

## Documentation

The [Jedis wiki](http://github.com/redis/jedis/wiki) contains several useful articles for using Jedis.

You can also check the [latest Jedis Javadocs](https://www.javadoc.io/doc/redis.clients/jedis/latest/index.html).

## Troubleshooting

If you run into trouble or have any questions, we're here to help!
Expand Down
28 changes: 0 additions & 28 deletions src/main/java/redis/clients/jedis/BroadcastResponse.java

This file was deleted.

30 changes: 30 additions & 0 deletions src/main/java/redis/clients/jedis/CommandObjects.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ protected CommandArguments commandArguments(ProtocolCommand command) {
return new CommandArguments(command);
}

private final CommandObject<String> PING_COMMAND_OBJECT = new CommandObject<>(commandArguments(PING), BuilderFactory.STRING);

public final CommandObject<String> ping() {
return PING_COMMAND_OBJECT;
}

private final CommandObject<String> FLUSHALL_COMMAND_OBJECT = new CommandObject<>(commandArguments(FLUSHALL), BuilderFactory.STRING);

public final CommandObject<String> flushAll() {
return FLUSHALL_COMMAND_OBJECT;
}

public final CommandObject<String> configSet(String parameter, String value) {
return new CommandObject<>(commandArguments(Command.CONFIG).add(Keyword.SET).add(parameter).add(value), BuilderFactory.STRING);
}

// Key commands
public final CommandObject<Boolean> exists(String key) {
return new CommandObject<>(commandArguments(Command.EXISTS).key(key), BuilderFactory.BOOLEAN);
Expand Down Expand Up @@ -2765,15 +2781,29 @@ public final CommandObject<Object> evalshaReadonly(byte[] sha1, List<byte[]> key
BuilderFactory.RAW_OBJECT);
}

public final CommandObject<List<Boolean>> scriptExists(List<String> sha1s) {
return new CommandObject<>(commandArguments(SCRIPT).add(Keyword.EXISTS).addObjects(sha1s), BuilderFactory.BOOLEAN_LIST);
}

public final CommandObject<List<Boolean>> scriptExists(String sampleKey, String... sha1s) {
return new CommandObject<>(commandArguments(SCRIPT).add(Keyword.EXISTS).addObjects((Object[]) sha1s)
.processKey(sampleKey), BuilderFactory.BOOLEAN_LIST);
}

public final CommandObject<String> scriptLoad(String script) {
return new CommandObject<>(commandArguments(SCRIPT).add(LOAD).add(script), BuilderFactory.STRING);
}

public final CommandObject<String> scriptLoad(String script, String sampleKey) {
return new CommandObject<>(commandArguments(SCRIPT).add(LOAD).add(script).processKey(sampleKey), BuilderFactory.STRING);
}

private final CommandObject<String> SCRIPT_FLUSH_COMMAND_OBJECT = new CommandObject<>(commandArguments(SCRIPT).add(FLUSH), BuilderFactory.STRING);

public final CommandObject<String> scriptFlush() {
return SCRIPT_FLUSH_COMMAND_OBJECT;
}

public final CommandObject<String> scriptFlush(String sampleKey) {
return new CommandObject<>(commandArguments(SCRIPT).add(FLUSH).processKey(sampleKey), BuilderFactory.STRING);
}
Expand Down
180 changes: 0 additions & 180 deletions src/main/java/redis/clients/jedis/JedisBroadcast.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package redis.clients.jedis;

public interface JedisBroadcastAndRoundRobinConfig {

public enum RediSearchMode {
DEFAULT, LIGHT;
}

RediSearchMode getRediSearchModeInCluster();
}
Loading

0 comments on commit 6d60ed6

Please sign in to comment.