Skip to content

Commit

Permalink
Merge branch 'master' into bsb/feature-triggers-and-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bsbodden authored Sep 18, 2023
2 parents d0a4fe2 + bb38c97 commit d4a9ca1
Show file tree
Hide file tree
Showing 100 changed files with 1,735 additions and 807 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/doctests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Documentation Tests

on:
push:
tags-ignore:
- '*'
pull_request:
workflow_dispatch:

Expand Down Expand Up @@ -32,4 +34,4 @@ jobs:
distribution: 'temurin'
- name: Run doctests
run: |
mvn -Pdoctests test
mvn -Pdoctests test
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021-2023, Redis, inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 0 additions & 22 deletions LICENSE.txt

This file was deleted.

58 changes: 32 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,23 @@ Jedis is a Java client for [Redis](https://github.com/redis/redis "Redis") desig

Are you looking for a high-level library to handle object mapping? See [redis-om-spring](https://github.com/redis/redis-om-spring)!

## Contributing

We'd love your contributions!

**Bug reports** are always welcome! [You can open a bug report on GitHub](https://github.com/redis/jedis/issues/new).

You can also **contribute documentation** -- or anything to improve Jedis. Please see
[contribution guideline](https://github.com/redis/jedis/blob/master/.github/CONTRIBUTING.md) for more details.

## Supported Redis versions

The most recent version of this library supports redis version [5.0](https://github.com/redis/redis/blob/5.0/00-RELEASENOTES), [6.0](https://github.com/redis/redis/blob/6.0/00-RELEASENOTES), [6.2](https://github.com/redis/redis/blob/6.2/00-RELEASENOTES), and [7.0](https://github.com/redis/redis/blob/7.0/00-RELEASENOTES).
The most recent version of this library supports redis version
[5.0](https://github.com/redis/redis/blob/5.0/00-RELEASENOTES),
[6.0](https://github.com/redis/redis/blob/6.0/00-RELEASENOTES),
[6.2](https://github.com/redis/redis/blob/6.2/00-RELEASENOTES),
[7.0](https://github.com/redis/redis/blob/7.0/00-RELEASENOTES) and
[7.2](https://github.com/redis/redis/blob/7.2/00-RELEASENOTES).

The table below highlights version compatibility of the most-recent library versions and Redis versions. Compatibility means communication features, and Redis command capabilities.

| Library version | Supported redis versions |
|-----------------|-------------------|
| 3.9+ | 5.0 and 6.2 Family of releases |
| >= 4.0 | Version 5.0 to current |

| Jedis version | Supported Redis versions | JDK Compatibility |
|---------------|--------------------------------|-------------------|
| 3.9+ | 5.0 and 6.2 Family of releases | 8, 11 |
| >= 4.0 | Version 5.0 to current | 8, 11, 17 |
| >= 5.0 | Version 6.0 to current | 8, 11, 17 |

## Getting started

Expand All @@ -42,7 +40,7 @@ To get started with Jedis, first add it as a dependency in your Java project. If
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>4.4.3</version>
<version>5.0.0</version>
</dependency>
```

Expand Down Expand Up @@ -78,7 +76,7 @@ for the complete list of supported commands.

### Easier way of using connection pool

Using a *try-with-resources* block for each command may be cumbursome, so you may consider using JedisPooled.
Using a *try-with-resources* block for each command may be cumbersome, so you may consider using JedisPooled.

```java
JedisPooled jedis = new JedisPooled("localhost", 6379);
Expand Down Expand Up @@ -108,6 +106,13 @@ Now you can use the `JedisCluster` instance and send commands like you would wit
jedis.sadd("planets", "Mars");
```

## 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.

## Failover

Jedis supports retry and failover for your Redis deployments. This is useful when:
Expand All @@ -126,25 +131,26 @@ You can also check the [latest Jedis Javadocs](https://www.javadoc.io/doc/redis.
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
## Troubleshooting

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/).
If you run into trouble or have any questions, we're here to help!

See the [RedisJSON Jedis](docs/redisjson.md) or [RediSearch Jedis](docs/redisearch.md) for details.
Hit us up on the [Redis Discord Server](http://discord.gg/redis) or
[Jedis GitHub Discussions](https://github.com/redis/jedis/discussions) or
[Jedis mailing list](http://groups.google.com/group/jedis_redis).

## Troubleshooting
## Contributing

If you run into trouble or have any questions, we're here to help!
We'd love your contributions!

Hit us up on the [Redis Discord Server](http://discord.gg/redis) or [open an issue on GitHub](https://github.com/redis/jedis).
Bug reports are always welcome! [You can open a bug report on GitHub](https://github.com/redis/jedis/issues/new).

You can also find help on the [Jedis mailing list](http://groups.google.com/group/jedis_redis) or the
[GitHub Discussions](https://github.com/redis/jedis/discussions).
You can also contribute documentation -- or anything to improve Jedis. Please see
[contribution guideline](https://github.com/redis/jedis/blob/master/.github/CONTRIBUTING.md) for more details.

## License

Jedis is licensed under the [MIT license](https://github.com/redis/jedis/blob/master/LICENSE.txt).
Jedis is licensed under the [MIT license](https://github.com/redis/jedis/blob/master/LICENSE).

## Sponsorship

Expand Down
111 changes: 63 additions & 48 deletions docs/jedis5-breaking.md → docs/breaking-5.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Jedis 5 Breaking Changes

- All variants of `blmpop` and `bzmpop` methods now take `double timeout` parameter instead of `long timeout` parameter.
This is breaking ONLY IF you are using `Long` for timeout.

- `Reducer` abstract class is refactored:
- **`Reducer(String field)` constructor is removed; `Reducer(String name, String field)` constructor is added.**
- **`Reducer(String name)` constructor is added; it will cause runtime error with older `Reducer(String field)` constructor.**
- `getName` method is removed.
- `getAlias` method is removed.
- `setAlias` method is removed; use `as` method.
- `setAliasAsField` method is removed.
- `getOwnArgs` method is now abstract.
- `getArgs` method is removed.

- `quit()` method has been removed from `Connection` and `ServerCommands` interface and implementations.

- `updatePassword(String password)` method has been removed from `JedisClientConfig` and implementations.

- `setPassword(String password)` method has been removed from both `JedisFactory` and `ConnectionFactory` classes.

- Both `bzpopmax(double timeout, String... keys)` and `bzpopmin(double timeout, String... keys)` now return `KeyValue<String, Tuple>` (instead of `KeyedZSetElement`).

- Both `bzpopmax(double timeout, byte[]... keys)` and `bzpopmin(double timeout, byte[]... keys)` now return `KeyValue<byte[], Tuple>` (instead of `List<byte[]>`).
Expand Down Expand Up @@ -40,11 +59,35 @@
- `tsMRevRange(long fromTimestamp, long toTimestamp, String... filters)`
- `tsMRevRange(TSMRangeParams multiRangeParams)`

- `jsonNumIncrBy(String key, Path2 path, double value)` method now returns `Object` instead of `JSONArray`.
- The returning object would still be JSONArray for all previous cases. So simple type casting is enough to handle this change.
- The returning object will be `List<Double>` when running under RESP3 protocol.

- `getAgeSeconds()` in `AccessControlLogEntry` now returns `Double` instead of `String`.

- Both `ftConfigGet(String option)` and `ftConfigGet(String indexName, String option)` methods now return `Map<String, Object>` instead of `Map<String, String>`.

- `ftList()` method now returns `Set<String>` instead of `List<String>`.

- `graphSlowlog(String graphName)` now returns `List<List<Object>>` (instead of `List<List<String>>`).

- All _payload_ related parameters are removed from _search_ related classes; namely `Document`, `IndexDefinition`, `Query`.
- `CommandListFilterByParams` now throws `IllegalArgumentException` (instead of `JedisDataException`) in case of unfulfilling filter.

- `FailoverParams` now throws `IllegalArgumentException` (instead of `IllegalStateException`) in case of unfulfilling optional arguments.

- `XPendingParams` now throws `IllegalArgumentException` (instead of `IllegalStateException`) in case of unfulfilling optional arguments.

- `get()` option has been removed from `SetParams`. Following methods have been added in Jedis/UnifiedJedis for convenience:
- `setGet(String key, String value)` method has been added in `StringCommands` interface.
- `setGet(byte[] key, byte[] value)` method has been added in `StringBinaryCommands` interface.

- `xpending(String key, String groupName, StreamEntryID start, StreamEntryID end, int count, String consumerName)` method has been removed from everywhere.
- Use `xpending(java.lang.String, java.lang.String, redis.clients.jedis.params.XPendingParams)` instead.

- `xpending(byte[] key, byte[] groupName, byte[] start, byte[] end, int count, byte[] consumerName)` method has been removed from everywhere.
- Use `xpending(byte[], byte[], redis.clients.jedis.params.XPendingParams)` instead.

- `retentionTime(long retentionTime)` method in `TSAlterParams` has been removed. Use `retention(long)` method instead.

- Following classes have been removed:
- `KeyedZSetElement`
Expand All @@ -59,67 +102,47 @@
- `BINARY_MAP_FROM_PAIRS`
- `STRING_ORDERED_SET`

- All _payload_ related parameters are removed from _search_ related classes; namely `Document`, `IndexDefinition`, `Query`.

- `topkCount(String key, String... items)` method has been removed from everywhere.

- Following methods supporting JSON.RESP command have been removed:
- `jsonResp(String key)`
- `jsonResp(String key, Path path)`
- `jsonResp(String key, Path2 path)`

- `RedisJsonCommands` and `RedisJsonPipelineCommands` interfaces have been moved into `redis.clients.jedis.json.commands` package.

- `AbortedTransactionException` is removed.

- `Queable` class is removed.

- `Params` abstract class is removed.
- `toString()` support used by its sub-classes is now unavailable.

- `CommandListFilterByParams` now throws `IllegalArgumentException` (instead of `JedisDataException`) in case of unfulfilling filter.

- `FailoverParams` now throws `IllegalArgumentException` (instead of `IllegalStateException`) in case of unfulfilling optional arguments.

- `XPendingParams` now throws `IllegalArgumentException` (instead of `IllegalStateException`) in case of unfulfilling optional arguments.

- `getParams()` method is removed from `SortingParams` class.

- `addCommandEncodedArguments` and `addCommandBinaryArguments` methods have been removed from `FieldName` class.

- `getArgs` method is removed from `AggregationBuilder` class.

- `limit` and `getArgs` methods have been removed from `Group` class.

- `Reducer` abstract class is refactored:
- `Reducer(String field)` constructor is removed; `Reducer(String name, String field)` constructor is added.
- `Reducer(String name)` constructor is added; it will cause runtime error with older `Reducer(String field)` constructor.
- `getName` method is removed.
- `getAlias` method is removed.
- `setAlias` method is removed; use `as` method.
- `setAliasAsField` method is removed.
- `getOwnArgs` method is now abstract.
- `getArgs` method is removed.

- All variants of `blmpop` and `bzmpop` methods now take `double timeout` parameter instead of `long timeout` parameter.
This is breaking ONLY IF you are using `Long` for timeout.
- Both `SEARCH_AGGREGATION_RESULT` and `SEARCH_AGGREGATION_RESULT_WITH_CURSOR` implementations from `SearchBuilderFactory` class have been moved to `AggregationResult` class.

<!--- Deprecated in Jedis 4 --->
- All `AggregationResult` constructors have been made `private`.

- `quit()` method has been removed from `Connection` and `ServerCommands` interface and implementations.
- `getArgs()`, `getArgsString()` and `serializeRedisArgs(List<byte[]> redisArgs)` methods have been removed from `AggregationBuilder`.

- `updatePassword(String password)` method has been removed from `JedisClientConfig` and implementations.

- `setPassword(String password)` method has been removed from both `JedisFactory` and `ConnectionFactory` classes.

- `get()` option has been removed from `SetParams`. Following methods have been added in Jedis/UnifiedJedis for convenience:
- `setGet(String key, String value)` method has been added in `StringCommands` interface.
- `setGet(byte[] key, byte[] value)` method has been added in `StringBinaryCommands` interface.
- `totalResults` variable in `AggregationResult` has been made private. Use `getTotalResults()` method instead.

- `xpending(String key, String groupName, StreamEntryID start, StreamEntryID end, int count, String consumerName)` method has been removed from everywhere.
- Use `xpending(java.lang.String, java.lang.String, redis.clients.jedis.params.XPendingParams)` instead.
- `getArgs()` and `limit(Limit limit)` methods have been removed from `Group` class.

- `xpending(byte[] key, byte[] groupName, byte[] start, byte[] end, int count, byte[] consumerName)` method has been removed from everywhere.
- Use `xpending(byte[], byte[], redis.clients.jedis.params.XPendingParams)` instead.
- `addCommandEncodedArguments` and `addCommandBinaryArguments` methods have been removed from `FieldName` class.

- `topkCount(String key, String... items)` method has been removed from everywhere.
- `addObjects(int[] ints)` method has been removed from `CommandArguments`.

- Following methods have been removed:
- `strAlgoLCSStrings(String strA, String strB, StrAlgoLCSParams params)`
- `strAlgoLCSStrings(byte[] strA, byte[] strB, StrAlgoLCSParams params)`
- `strAlgoLCSKeys(String keyA, String keyB, StrAlgoLCSParams params)`
- `strAlgoLCSKeys(byte[] keyA, byte[] keyB, StrAlgoLCSParams params)`

- `StrAlgoLCSParams` has been removed.
- `StrAlgoLCSParams` class has been removed.

- Following methods have been removed from all Pipeline classes:
- `ftCursorRead(String indexName, long cursorId, int count)`
Expand All @@ -130,14 +153,6 @@
- `ftAliasUpdate(String aliasName, String indexName)`
- `ftAliasDel(String aliasName)`

- `addObjects(int[] ints)` method has been removed from `CommandArguments`.

- `getArgsString()` and `serializeRedisArgs(List<byte[]> redisArgs)` methods have been removed from `AggregationBuilder`.

- `totalResults` variable in `AggregationResult` has been made private. Use `getTotalResults()` method instead.

- `retentionTime(long retentionTime)` method in `TSAlterParams` has been removed. Use `retention(long)` method instead.

- `JedisSentineled(String masterName, Set<HostAndPort> sentinels, JedisClientConfig masterClientConfig, JedisClientConfig sentinelClientConfig)` and
`JedisSentineled(String masterName, Set<HostAndPort> sentinels, GenericObjectPoolConfig<Connection> poolConfig, JedisClientConfig masterClientConfig, JedisClientConfig sentinelClientConfig)`
constructors have been removed.
Expand Down
2 changes: 1 addition & 1 deletion docs/failover.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ FailoverReporter reporter = new FailoverReporter();
provider.setClusterFailoverPostProcessor(reporter);
```

The provider will call your `accept` whenver a faoliver occurs.
The provider will call your `accept` whenever a faoliver occurs.

## Failing back

Expand Down
4 changes: 2 additions & 2 deletions docs/jedis-maven.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>4.3.0</version>
<version>5.0.0</version>
</dependency>
```

Expand All @@ -28,7 +28,7 @@ and
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>4.4.0-SNAPSHOT</version>
<version>5.1.0-SNAPSHOT</version>
</dependency>
</dependencies>
```
Loading

0 comments on commit d4a9ca1

Please sign in to comment.