Skip to content

Commit d34f72d

Browse files
authored
Merge branch 'redis:master' into feature/hu-notifications
2 parents a67b5cb + 8cdc90f commit d34f72d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3929
-52
lines changed

.github/codecov.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,20 @@
1+
codecov: # see https://docs.codecov.com/docs/codecovyml-reference
2+
branch: master
3+
4+
coverage:
5+
status: # see https://docs.codecov.com/docs/commit-status
6+
project:
7+
default:
8+
target: auto # minimum coverage ratio that the commit must meet to be considered a success
9+
threshold: 5 # Allow the coverage to drop by <number>%, and posting a success status
10+
branches:
11+
- master
12+
- '[0-9].*'
13+
14+
comment: # see https://docs.codecov.com/docs/pull-request-comments
15+
layout: "condensed_header, condensed_files, condensed_footer"
16+
behavior: new
17+
require_changes: true
18+
119
ignore:
220
- "**/*.txt"

.github/workflows/format_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: |
3232
echo "::group::Changed Java Files"
3333
echo Base Branch: ${{ github.event.pull_request.base.ref }}
34-
CHANGED_FILES=$(git diff --name-only origin/${{ github.event.pull_request.base.ref }} | grep '\.java$' || true)
34+
CHANGED_FILES=$(git diff --name-only --diff-filter=A origin/${{ github.event.pull_request.base.ref }} | grep '\.java$' || true)
3535
echo "$CHANGED_FILES"
3636
echo "::endgroup::"
3737
# Write the multiline content to a file

.github/workflows/snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
with:
2222
java-version: '8'
2323
distribution: 'temurin'
24-
server-id: ossrh
24+
server-id: central
2525
server-username: MAVEN_USERNAME
2626
server-password: MAVEN_PASSWORD
2727
- name: Cache dependencies

.github/workflows/test-on-docker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
fail-fast: false
3737
matrix:
3838
redis_version:
39+
- "8.2"
3940
- "8.0"
4041
- "7.4"
4142
- "7.2"

.github/workflows/version-and-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
java-version: '8'
2525
distribution: 'temurin'
26-
server-id: ossrh
26+
server-id: central
2727
server-username: MAVEN_USERNAME
2828
server-password: MAVEN_PASSWORD
2929

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PATH := ./redis-git/src:${PATH}
22

33
# Supported test env versions
4-
SUPPORTED_TEST_ENV_VERSIONS := 8.0 7.4 7.2 6.2
5-
DEFAULT_TEST_ENV_VERSION := 8.0
4+
SUPPORTED_TEST_ENV_VERSIONS := 8.2 8.0 7.4 7.2 6.2
5+
DEFAULT_TEST_ENV_VERSION := 8.2
66
REDIS_ENV_WORK_DIR := $(or ${REDIS_ENV_WORK_DIR},/tmp/redis-env-work)
77

88
define REDIS1_CONF
@@ -473,7 +473,7 @@ start: cleanup compile-module
473473
echo "$$REDIS_UDS" | redis-server -
474474
echo "$$REDIS_UNAVAILABLE_CONF" | redis-server -
475475
redis-cli -a cluster --cluster create 127.0.0.1:7479 127.0.0.1:7480 127.0.0.1:7481 --cluster-yes
476-
docker run -p 6479:6379 --name jedis-stack -e PORT=6379 -d redislabs/client-libs-test:8.0.2
476+
docker run -p 6479:6379 --name jedis-stack -e PORT=6379 -d redislabs/client-libs-test:8.2-rc1
477477

478478
cleanup:
479479
- rm -vf /tmp/redis_cluster_node*.conf 2>/dev/null

pom.xml

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,28 @@
4040
<scm>
4141
<connection>scm:git:git@github.com:redis/jedis.git</connection>
4242
<url>scm:git:git@github.com:redis/jedis.git</url>
43-
<developerConnection>scm:git:git@github.com:redis/jedis.git</developerConnection>
44-
<tag>jedis-3.4.1</tag>
43+
<developerConnection>https://github.com/redis/jedis/tree/master</developerConnection>
4544
</scm>
4645

46+
<developers>
47+
<developer>
48+
<id>redis</id>
49+
<name>Redis Ltd.</name>
50+
<organization>Redis</organization>
51+
<organizationUrl>https://redis.io</organizationUrl>
52+
</developer>
53+
</developers>
54+
4755
<properties>
4856
<github.global.server>github</github.global.server>
4957
<jedis.module.name>redis.clients.jedis</jedis.module.name>
5058
<slf4j.version>1.7.36</slf4j.version>
5159
<resilience4j.version>1.7.1</resilience4j.version>
52-
<jackson.version>2.19.1</jackson.version>
60+
<jackson.version>2.19.2</jackson.version>
5361
<maven.surefire.version>3.5.3</maven.surefire.version>
54-
<junit.version>5.13.2</junit.version>
62+
<junit.version>5.13.3</junit.version>
63+
<!-- Default JVM options for tests -->
64+
<JVM_OPTS></JVM_OPTS>
5565
</properties>
5666

5767
<dependencyManagement>
@@ -213,14 +223,14 @@
213223
</dependencies>
214224

215225
<distributionManagement>
216-
<snapshotRepository>
217-
<id>ossrh</id>
218-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
219-
</snapshotRepository>
220226
<repository>
221-
<id>ossrh</id>
222-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
227+
<id>central</id>
228+
<url>https://central.sonatype.com/api/v1/publisher/deployments/upload/</url>
223229
</repository>
230+
<snapshotRepository>
231+
<id>central</id>
232+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
233+
</snapshotRepository>
224234
</distributionManagement>
225235

226236
<build>
@@ -262,7 +272,7 @@
262272
<artifactId>maven-surefire-plugin</artifactId>
263273
<version>${maven.surefire.version}</version>
264274
<configuration>
265-
<argLine>${JVM_OPTS}</argLine>
275+
<argLine>@{argLine} ${JVM_OPTS}</argLine>
266276
<systemPropertyVariables>
267277
<redis-hosts>${redis-hosts}</redis-hosts>
268278
</systemPropertyVariables>
@@ -310,14 +320,14 @@
310320
<version>3.1.1</version>
311321
</plugin>
312322
<plugin>
313-
<groupId>org.sonatype.plugins</groupId>
314-
<artifactId>nexus-staging-maven-plugin</artifactId>
315-
<version>1.7.0</version>
323+
<groupId>org.sonatype.central</groupId>
324+
<artifactId>central-publishing-maven-plugin</artifactId>
325+
<version>0.8.0</version>
316326
<extensions>true</extensions>
317327
<configuration>
318-
<serverId>ossrh</serverId>
319-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
320-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
328+
<publishingServerId>central</publishingServerId>
329+
<autoPublish>true</autoPublish>
330+
<waitUntil>published</waitUntil>
321331
</configuration>
322332
</plugin>
323333
<plugin>
@@ -327,8 +337,18 @@
327337
<configuration>
328338
<configFile>${project.basedir}/hbase-formatter.xml</configFile>
329339
<directories>
330-
<directory>${project.basedir}/src/main/java/redis/clients/jedis/annots</directory>
340+
<directory>${project.basedir}</directory>
331341
</directories>
342+
<includes>
343+
<!-- Specific files -->
344+
<include>src/main/java/redis/clients/jedis/annots/*.java</include>
345+
<include>src/main/java/redis/clients/jedis/resps/StreamEntryDeletionResult.java</include>
346+
<include>src/main/java/redis/clients/jedisargs/StreamDeletionPolicy.java</include>
347+
<include>src/test/java/redis/clients/jedis/commands/StreamsCommandsTestBase.java</include>
348+
<include>src/test/java/redis/clients/jedis/commands/jedis/ClusterStreamsCommandsTest.java</include>
349+
<include>src/test/java/redis/clients/jedis/commands/jedis/PooledStreamsCommandsTest.java</include>
350+
<include>src/test/java/redis/clients/jedis/resps/StreamEntryDeletionResultTest.java</include>
351+
</includes>
332352
</configuration>
333353
<executions>
334354
<execution>
@@ -374,7 +394,7 @@
374394
<!--Sign the components - this is required by maven central for releases -->
375395
<plugin>
376396
<artifactId>maven-gpg-plugin</artifactId>
377-
<version>3.2.7</version>
397+
<version>3.2.8</version>
378398
<configuration>
379399
<gpgArguments>
380400
<arg>--pinentry-mode</arg>

src/main/java/redis/clients/jedis/BuilderFactory.java

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,42 @@ public List<StreamEntryID> build(Object data) {
12611261
}
12621262
};
12631263

1264+
public static final Builder<StreamEntryDeletionResult> STREAM_ENTRY_DELETION_RESULT = new Builder<StreamEntryDeletionResult>() {
1265+
@Override
1266+
public StreamEntryDeletionResult build(Object data) {
1267+
if (data == null) {
1268+
return null;
1269+
}
1270+
return StreamEntryDeletionResult.fromLong((Long) data);
1271+
}
1272+
1273+
@Override
1274+
public String toString() {
1275+
return "StreamEntryDeletionResult";
1276+
}
1277+
};
1278+
1279+
public static final Builder<List<StreamEntryDeletionResult>> STREAM_ENTRY_DELETION_RESULT_LIST = new Builder<List<StreamEntryDeletionResult>>() {
1280+
@Override
1281+
@SuppressWarnings("unchecked")
1282+
public List<StreamEntryDeletionResult> build(Object data) {
1283+
if (data == null) {
1284+
return null;
1285+
}
1286+
List<Object> objectList = (List<Object>) data;
1287+
List<StreamEntryDeletionResult> responses = new ArrayList<>(objectList.size());
1288+
for (Object object : objectList) {
1289+
responses.add(STREAM_ENTRY_DELETION_RESULT.build(object));
1290+
}
1291+
return responses;
1292+
}
1293+
1294+
@Override
1295+
public String toString() {
1296+
return "List<StreamEntryDeletionResult>";
1297+
}
1298+
};
1299+
12641300
public static final Builder<StreamEntry> STREAM_ENTRY = new Builder<StreamEntry>() {
12651301
@Override
12661302
@SuppressWarnings("unchecked")

src/main/java/redis/clients/jedis/CommandObjects.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2626,10 +2626,26 @@ public final CommandObject<Long> xack(String key, String group, StreamEntryID...
26262626
return new CommandObject<>(commandArguments(XACK).key(key).add(group).addObjects((Object[]) ids), BuilderFactory.LONG);
26272627
}
26282628

2629+
public final CommandObject<List<StreamEntryDeletionResult>> xackdel(String key, String group, StreamEntryID... ids) {
2630+
return new CommandObject<>(commandArguments(XACKDEL).key(key).add(group).add("IDS").add(ids.length).addObjects((Object[]) ids), BuilderFactory.STREAM_ENTRY_DELETION_RESULT_LIST);
2631+
}
2632+
2633+
public final CommandObject<List<StreamEntryDeletionResult>> xackdel(String key, String group, StreamDeletionPolicy trimMode, StreamEntryID... ids) {
2634+
return new CommandObject<>(commandArguments(XACKDEL).key(key).add(group).add(trimMode).add("IDS").add(ids.length).addObjects((Object[]) ids), BuilderFactory.STREAM_ENTRY_DELETION_RESULT_LIST);
2635+
}
2636+
26292637
public final CommandObject<Long> xack(byte[] key, byte[] group, byte[]... ids) {
26302638
return new CommandObject<>(commandArguments(XACK).key(key).add(group).addObjects((Object[]) ids), BuilderFactory.LONG);
26312639
}
26322640

2641+
public final CommandObject<List<StreamEntryDeletionResult>> xackdel(byte[] key, byte[] group, byte[]... ids) {
2642+
return new CommandObject<>(commandArguments(XACKDEL).key(key).add(group).add("IDS").add(ids.length).addObjects((Object[]) ids), BuilderFactory.STREAM_ENTRY_DELETION_RESULT_LIST);
2643+
}
2644+
2645+
public final CommandObject<List<StreamEntryDeletionResult>> xackdel(byte[] key, byte[] group, StreamDeletionPolicy trimMode, byte[]... ids) {
2646+
return new CommandObject<>(commandArguments(XACKDEL).key(key).add(group).add(trimMode).add("IDS").add(ids.length).addObjects((Object[]) ids), BuilderFactory.STREAM_ENTRY_DELETION_RESULT_LIST);
2647+
}
2648+
26332649
public final CommandObject<String> xgroupCreate(String key, String groupName, StreamEntryID id, boolean makeStream) {
26342650
CommandArguments args = commandArguments(XGROUP).add(CREATE).key(key)
26352651
.add(groupName).add(id == null ? "0-0" : id);
@@ -2687,6 +2703,14 @@ public final CommandObject<Long> xdel(String key, StreamEntryID... ids) {
26872703
return new CommandObject<>(commandArguments(XDEL).key(key).addObjects((Object[]) ids), BuilderFactory.LONG);
26882704
}
26892705

2706+
public final CommandObject<List<StreamEntryDeletionResult>> xdelex(String key, StreamEntryID... ids) {
2707+
return new CommandObject<>(commandArguments(XDELEX).key(key).add("IDS").add(ids.length).addObjects((Object[]) ids), BuilderFactory.STREAM_ENTRY_DELETION_RESULT_LIST);
2708+
}
2709+
2710+
public final CommandObject<List<StreamEntryDeletionResult>> xdelex(String key, StreamDeletionPolicy trimMode, StreamEntryID... ids) {
2711+
return new CommandObject<>(commandArguments(XDELEX).key(key).add(trimMode).add("IDS").add(ids.length).addObjects((Object[]) ids), BuilderFactory.STREAM_ENTRY_DELETION_RESULT_LIST);
2712+
}
2713+
26902714
public final CommandObject<Long> xtrim(String key, long maxLen, boolean approximate) {
26912715
CommandArguments args = commandArguments(XTRIM).key(key).add(MAXLEN);
26922716
if (approximate) args.add(Protocol.BYTES_TILDE);
@@ -2702,6 +2726,14 @@ public final CommandObject<Long> xdel(byte[] key, byte[]... ids) {
27022726
return new CommandObject<>(commandArguments(XDEL).key(key).addObjects((Object[]) ids), BuilderFactory.LONG);
27032727
}
27042728

2729+
public final CommandObject<List<StreamEntryDeletionResult>> xdelex(byte[] key, byte[]... ids) {
2730+
return new CommandObject<>(commandArguments(XDELEX).key(key).add("IDS").add(ids.length).addObjects((Object[]) ids), BuilderFactory.STREAM_ENTRY_DELETION_RESULT_LIST);
2731+
}
2732+
2733+
public final CommandObject<List<StreamEntryDeletionResult>> xdelex(byte[] key, StreamDeletionPolicy trimMode, byte[]... ids) {
2734+
return new CommandObject<>(commandArguments(XDELEX).key(key).add(trimMode).add("IDS").add(ids.length).addObjects((Object[]) ids), BuilderFactory.STREAM_ENTRY_DELETION_RESULT_LIST);
2735+
}
2736+
27052737
public final CommandObject<Long> xtrim(byte[] key, long maxLen, boolean approximateLength) {
27062738
CommandArguments args = commandArguments(XTRIM).key(key).add(MAXLEN);
27072739
if (approximateLength) args.add(Protocol.BYTES_TILDE);

src/main/java/redis/clients/jedis/Jedis.java

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4866,6 +4866,18 @@ public long xack(byte[] key, byte[] group, byte[]... ids) {
48664866
return connection.executeCommand(commandObjects.xack(key, group, ids));
48674867
}
48684868

4869+
@Override
4870+
public List<StreamEntryDeletionResult> xackdel(byte[] key, byte[] group, byte[]... ids) {
4871+
checkIsInMultiOrPipeline();
4872+
return connection.executeCommand(commandObjects.xackdel(key, group, ids));
4873+
}
4874+
4875+
@Override
4876+
public List<StreamEntryDeletionResult> xackdel(byte[] key, byte[] group, StreamDeletionPolicy trimMode, byte[]... ids) {
4877+
checkIsInMultiOrPipeline();
4878+
return connection.executeCommand(commandObjects.xackdel(key, group, trimMode, ids));
4879+
}
4880+
48694881
@Override
48704882
public String xgroupCreate(byte[] key, byte[] consumer, byte[] id, boolean makeStream) {
48714883
checkIsInMultiOrPipeline();
@@ -4902,6 +4914,18 @@ public long xdel(byte[] key, byte[]... ids) {
49024914
return connection.executeCommand(commandObjects.xdel(key, ids));
49034915
}
49044916

4917+
@Override
4918+
public List<StreamEntryDeletionResult> xdelex(byte[] key, byte[]... ids) {
4919+
checkIsInMultiOrPipeline();
4920+
return connection.executeCommand(commandObjects.xdelex(key, ids));
4921+
}
4922+
4923+
@Override
4924+
public List<StreamEntryDeletionResult> xdelex(byte[] key, StreamDeletionPolicy trimMode, byte[]... ids) {
4925+
checkIsInMultiOrPipeline();
4926+
return connection.executeCommand(commandObjects.xdelex(key, trimMode, ids));
4927+
}
4928+
49054929
@Override
49064930
public long xtrim(byte[] key, long maxLen, boolean approximateLength) {
49074931
checkIsInMultiOrPipeline();
@@ -9677,6 +9701,18 @@ public long xack(final String key, final String group, final StreamEntryID... id
96779701
return connection.executeCommand(commandObjects.xack(key, group, ids));
96789702
}
96799703

9704+
@Override
9705+
public List<StreamEntryDeletionResult> xackdel(final String key, final String group, final StreamEntryID... ids) {
9706+
checkIsInMultiOrPipeline();
9707+
return connection.executeCommand(commandObjects.xackdel(key, group, ids));
9708+
}
9709+
9710+
@Override
9711+
public List<StreamEntryDeletionResult> xackdel(final String key, final String group, final StreamDeletionPolicy trimMode, final StreamEntryID... ids) {
9712+
checkIsInMultiOrPipeline();
9713+
return connection.executeCommand(commandObjects.xackdel(key, group, trimMode, ids));
9714+
}
9715+
96809716
@Override
96819717
public String xgroupCreate(final String key, final String groupName, final StreamEntryID id,
96829718
final boolean makeStream) {
@@ -9714,6 +9750,18 @@ public long xdel(final String key, final StreamEntryID... ids) {
97149750
return connection.executeCommand(commandObjects.xdel(key, ids));
97159751
}
97169752

9753+
@Override
9754+
public List<StreamEntryDeletionResult> xdelex(final String key, final StreamEntryID... ids) {
9755+
checkIsInMultiOrPipeline();
9756+
return connection.executeCommand(commandObjects.xdelex(key, ids));
9757+
}
9758+
9759+
@Override
9760+
public List<StreamEntryDeletionResult> xdelex(final String key, final StreamDeletionPolicy trimMode, final StreamEntryID... ids) {
9761+
checkIsInMultiOrPipeline();
9762+
return connection.executeCommand(commandObjects.xdelex(key, trimMode, ids));
9763+
}
9764+
97179765
@Override
97189766
public long xtrim(final String key, final long maxLen, final boolean approximateLength) {
97199767
checkIsInMultiOrPipeline();

0 commit comments

Comments
 (0)