Skip to content

Commit 954987f

Browse files
committed
Merge remote-tracking branch 'redis/master' into xread-block-2
2 parents cc44350 + 7bd0dce commit 954987f

25 files changed

+646
-882
lines changed

.circleci.settings.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<settings>
2+
<servers>
3+
<server>
4+
<id>ossrh</id>
5+
<username>${env.OSSRH_USERNMAE}</username>
6+
<password>${env.OSSRH_PASSWORD}</password>
7+
</server>
8+
<server>
9+
<id>gpg.passphrase</id>
10+
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
11+
</server>
12+
</servers>
13+
</settings>

.circleci/config.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
version: 2.1
2-
2+
commands:
3+
early_return_for_forked_pull_requests:
4+
description: >-
5+
If this build is from a fork, stop executing the current job and return success.
6+
This is useful to avoid steps that will fail due to missing credentials.
7+
steps:
8+
- run:
9+
name: Early return if this build is from a forked PR
10+
command: |
11+
if [ -n "$CIRCLE_PR_NUMBER" ]; then
12+
echo "Nothing to do for forked PRs, so marking this step successful"
13+
circleci step halt
14+
fi
315
416
executors:
517
linux-8-jdk:
@@ -43,9 +55,14 @@ jobs:
4355
sudo apt install -y stunnel
4456
4557
- run: make circleci-install
46-
47-
- run: TEST="\!ModuleTest" make test
4858

59+
- run: TEST="" make test
60+
61+
- early_return_for_forked_pull_requests
62+
63+
- run: bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN}
64+
65+
- run: mvn -s .circleci.settings.xml -DskipTests deploy
4966

5067
workflows:
5168
all-jdks:

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ daemonize yes
66
protected-mode no
77
port 6379
88
requirepass foobared
9+
user acljedis on allcommands allkeys >fizzbuzz
910
pidfile /tmp/redis1.pid
1011
logfile /tmp/redis1.log
1112
save ""

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![Javadocs](https://www.javadoc.io/badge/redis.clients/jedis.svg)](https://www.javadoc.io/doc/redis.clients/jedis)
55
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)
66
[![Language grade: Java](https://img.shields.io/lgtm/grade/java/g/redis/jedis.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/redis/jedis/context:java)
7+
[![codecov](https://codecov.io/gh/redis/jedis/branch/master/graph/badge.svg?token=pAstxAAjYo)](https://codecov.io/gh/redis/jedis)
78
[![Gitter](https://badges.gitter.im/redis/jedis.svg)](https://gitter.im/redis/jedis?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
89

910
# Jedis
@@ -57,7 +58,7 @@ Or use it as a maven dependency:
5758
<dependency>
5859
<groupId>redis.clients</groupId>
5960
<artifactId>jedis</artifactId>
60-
<version>3.3.0</version>
61+
<version>3.4.1</version>
6162
<type>jar</type>
6263
<scope>compile</scope>
6364
</dependency>
@@ -90,7 +91,7 @@ and
9091
<dependency>
9192
<groupId>redis.clients</groupId>
9293
<artifactId>jedis</artifactId>
93-
<version>3.4.0-SNAPSHOT</version>
94+
<version>3.5.0-SNAPSHOT</version>
9495
</dependency>
9596
</dependencies>
9697
```
@@ -144,6 +145,9 @@ Thanks for helping!
144145

145146
## Sponsorship
146147

148+
![RedisLabs Logo](logo-redislabs.png)
149+
150+
147151
YourKit supports open source projects with its full-featured Java Profiler.
148152
YourKit, LLC is the creator of [YourKit Java Profiler](http://www.yourkit.com/java/profiler/index.jsp)
149153
and [YourKit .NET Profiler](http://www.yourkit.com/.net/profiler/index.jsp),

logo-redislabs.png

18.5 KB
Loading

pom.xml

Lines changed: 51 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
<packaging>jar</packaging>
99
<groupId>redis.clients</groupId>
1010
<artifactId>jedis</artifactId>
11-
<version>3.4.0-SNAPSHOT</version>
11+
<version>3.5.0-SNAPSHOT</version>
1212
<name>Jedis</name>
1313
<description>Jedis is a blazingly small and sane Redis java client.</description>
14-
<url>https://github.com/xetorthio/jedis</url>
14+
<url>https://github.com/redis/jedis</url>
1515

1616
<mailingLists>
1717
<mailingList>
@@ -26,20 +26,20 @@
2626
<licenses>
2727
<license>
2828
<name>MIT</name>
29-
<url>http://github.com/xetorthio/jedis/raw/master/LICENSE.txt</url>
29+
<url>http://github.com/redis/jedis/raw/master/LICENSE.txt</url>
3030
<distribution>repo</distribution>
3131
</license>
3232
</licenses>
3333

3434
<issueManagement>
3535
<system>github</system>
36-
<url>http://github.com/xetorthio/jedis/issues</url>
36+
<url>http://github.com/redis/jedis/issues</url>
3737
</issueManagement>
3838

3939
<scm>
40-
<connection>scm:git:git@github.com:xetorthio/jedis.git</connection>
41-
<url>scm:git:git@github.com:xetorthio/jedis.git</url>
42-
<developerConnection>scm:git:git@github.com:xetorthio/jedis.git</developerConnection>
40+
<connection>scm:git:git@github.com:redis/jedis.git</connection>
41+
<url>scm:git:git@github.com:redis/jedis.git</url>
42+
<developerConnection>scm:git:git@github.com:redis/jedis.git</developerConnection>
4343
<tag>jedis-2.2.0</tag>
4444
</scm>
4545

@@ -104,6 +104,25 @@
104104

105105
<build>
106106
<plugins>
107+
<plugin>
108+
<groupId>org.jacoco</groupId>
109+
<artifactId>jacoco-maven-plugin</artifactId>
110+
<version>0.8.5</version>
111+
<executions>
112+
<execution>
113+
<goals>
114+
<goal>prepare-agent</goal>
115+
</goals>
116+
</execution>
117+
<execution>
118+
<id>report</id>
119+
<phase>test</phase>
120+
<goals>
121+
<goal>report</goal>
122+
</goals>
123+
</execution>
124+
</executions>
125+
</plugin>
107126
<plugin>
108127
<groupId>org.apache.maven.plugins</groupId>
109128
<artifactId>maven-compiler-plugin</artifactId>
@@ -189,20 +208,6 @@
189208
</archive>
190209
</configuration>
191210
</plugin>
192-
<plugin>
193-
<groupId>org.apache.maven.plugins</groupId>
194-
<artifactId>maven-gpg-plugin</artifactId>
195-
<version>1.5</version>
196-
<executions>
197-
<execution>
198-
<id>sign-artifacts</id>
199-
<phase>verify</phase>
200-
<goals>
201-
<goal>sign</goal>
202-
</goals>
203-
</execution>
204-
</executions>
205-
</plugin>
206211
<plugin>
207212
<groupId>org.apache.felix</groupId>
208213
<artifactId>maven-bundle-plugin</artifactId>
@@ -219,4 +224,28 @@
219224
</plugin>
220225
</plugins>
221226
</build>
222-
</project>
227+
<profiles>
228+
<profile>
229+
<id>release</id>
230+
<build>
231+
<plugins>
232+
<!--Sign the components - this is required by maven central for releases -->
233+
<plugin>
234+
<groupId>org.apache.maven.plugins</groupId>
235+
<artifactId>maven-gpg-plugin</artifactId>
236+
<version>1.5</version>
237+
<executions>
238+
<execution>
239+
<id>sign-artifacts</id>
240+
<phase>verify</phase>
241+
<goals>
242+
<goal>sign</goal>
243+
</goals>
244+
</execution>
245+
</executions>
246+
</plugin>
247+
</plugins>
248+
</build>
249+
</profile>
250+
</profiles>
251+
</project>

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@
3636

3737
public class BinaryJedis implements BasicCommands, BinaryJedisCommands, MultiKeyBinaryCommands,
3838
AdvancedBinaryJedisCommands, BinaryScriptingCommands, Closeable {
39+
3940
protected Client client = null;
4041
protected Transaction transaction = null;
4142
protected Pipeline pipeline = null;
42-
private final byte[][] dummyArray = new byte[0][];
43+
protected static final byte[][] DUMMY_ARRAY = new byte[0][];
4344

4445
public BinaryJedis() {
4546
client = new Client();
@@ -4406,12 +4407,6 @@ public List<byte[]> xclaim(byte[] key, byte[] groupname, byte[] consumername,
44064407
return client.getBinaryMultiBulkReply();
44074408
}
44084409

4409-
public Object sendCommand(ProtocolCommand cmd, byte[]... args) {
4410-
checkIsInMultiOrPipeline();
4411-
client.sendCommand(cmd, args);
4412-
return client.getOne();
4413-
}
4414-
44154410
@Override
44164411
public StreamInfo xinfoStream(byte[] key) {
44174412
checkIsInMultiOrPipeline();
@@ -4436,7 +4431,24 @@ public List<StreamConsumersInfo> xinfoConsumers (byte[] key, byte[] group) {
44364431
return BuilderFactory.STREAM_CONSUMERS_INFO_LIST.build(client.getBinaryMultiBulkReply());
44374432
}
44384433

4434+
public Object sendCommand(ProtocolCommand cmd, byte[]... args) {
4435+
checkIsInMultiOrPipeline();
4436+
client.sendCommand(cmd, args);
4437+
return client.getOne();
4438+
}
4439+
4440+
public Object sendBlockingCommand(ProtocolCommand cmd, byte[]... args) {
4441+
checkIsInMultiOrPipeline();
4442+
client.sendCommand(cmd, args);
4443+
client.setTimeoutInfinite();
4444+
try {
4445+
return client.getOne();
4446+
} finally {
4447+
client.rollbackTimeout();
4448+
}
4449+
}
4450+
44394451
public Object sendCommand(ProtocolCommand cmd) {
4440-
return sendCommand(cmd, dummyArray);
4452+
return sendCommand(cmd, DUMMY_ARRAY);
44414453
}
44424454
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,6 +2400,15 @@ public Object execute(Jedis connection){
24002400
}.runBinary(sampleKey);
24012401
}
24022402

2403+
public Object sendBlockingCommand(final byte[] sampleKey, final ProtocolCommand cmd, final byte[]... args) {
2404+
return new JedisClusterCommand<Object>(connectionHandler, maxAttempts) {
2405+
@Override
2406+
public Object execute(Jedis connection){
2407+
return connection.sendBlockingCommand(cmd, args);
2408+
}
2409+
}.runBinary(sampleKey);
2410+
}
2411+
24032412
private static byte[][] getKeys(final Entry<byte[], ?>... entries) {
24042413
byte[][] keys = new byte[entries.length][];
24052414
for (int i = 0; i < entries.length; i++) {

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,13 @@ public Object sendCommand(ProtocolCommand cmd, byte[]... args) {
11341134
return j.sendCommand(cmd, args);
11351135
}
11361136

1137+
public Object sendBlockingCommand(ProtocolCommand cmd, byte[]... args) {
1138+
// default since no sample key provided in JedisCommands interface
1139+
byte[] sampleKey = args.length > 0 ? args[0] : cmd.getRaw();
1140+
Jedis j = getShard(sampleKey);
1141+
return j.sendBlockingCommand(cmd, args);
1142+
}
1143+
11371144
public Object sendCommand(ProtocolCommand cmd) {
11381145
return sendCommand(cmd, dummyArray);
11391146
}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4124,4 +4124,15 @@ public Object sendCommand(ProtocolCommand cmd, String... args) {
41244124
client.sendCommand(cmd, args);
41254125
return client.getOne();
41264126
}
4127+
4128+
public Object sendBlockingCommand(ProtocolCommand cmd, String... args) {
4129+
checkIsInMultiOrPipeline();
4130+
client.sendCommand(cmd, args);
4131+
client.setTimeoutInfinite();
4132+
try {
4133+
return client.getOne();
4134+
} finally {
4135+
client.rollbackTimeout();
4136+
}
4137+
}
41274138
}

0 commit comments

Comments
 (0)