Skip to content

Commit b0bc476

Browse files
authored
Merge branch 'master' into search-dialect-default-2
2 parents 201fbd4 + 6f35732 commit b0bc476

File tree

78 files changed

+258
-6255
lines changed

Some content is hidden

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

78 files changed

+258
-6255
lines changed

.github/workflows/codeql-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
steps:
3333
- name: Checkout repository
34-
uses: actions/checkout@v3
34+
uses: actions/checkout@v4
3535

3636
# Initializes the CodeQL tools for scanning.
3737
- name: Initialize CodeQL

.github/workflows/docs.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828
- name: Setup Pages
2929
uses: actions/configure-pages@v3
3030
- name: Upload artifact
31-
uses: actions/upload-pages-artifact@v1
31+
uses: actions/upload-pages-artifact@v3
3232
with:
3333
path: 'docsbuild'
3434
- name: Deploy to GitHub Pages
3535
id: deployment
36-
uses: actions/deploy-pages@v2
36+
uses: actions/deploy-pages@v4

.github/workflows/doctests.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: Documentation Tests
22

33
on:
44
push:
5-
tags-ignore:
6-
- '*'
75
branches:
6+
- master
87
- 'emb-examples'
98
pull_request:
109
workflow_dispatch:
@@ -21,16 +20,16 @@ jobs:
2120
- 6379:6379
2221

2322
steps:
24-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2524
- name: Cache dependencies
26-
uses: actions/cache@v2
25+
uses: actions/cache@v4
2726
with:
2827
path: |
2928
~/.m2/repository
3029
/var/cache/apt
3130
key: jedis-${{hashFiles('**/pom.xml')}}
3231
- name: Set up Java
33-
uses: actions/setup-java@v2
32+
uses: actions/setup-java@v4
3433
with:
3534
java-version: '11'
3635
distribution: 'temurin'

.github/workflows/integration.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
name: Build and Test
2626
runs-on: ubuntu-latest
2727
steps:
28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v4
2929
- name: Set up publishing to maven central
30-
uses: actions/setup-java@v2
30+
uses: actions/setup-java@v4
3131
with:
3232
java-version: '8'
3333
distribution: 'temurin'
@@ -37,7 +37,7 @@ jobs:
3737
sudo apt install -y stunnel make
3838
make system-setup
3939
- name: Cache dependencies
40-
uses: actions/cache@v2
40+
uses: actions/cache@v4
4141
with:
4242
path: |
4343
~/.m2/repository

.github/workflows/snapshot.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ jobs:
1515
name: Deploy Snapshot
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919
- name: Set up publishing to maven central
20-
uses: actions/setup-java@v2
20+
uses: actions/setup-java@v4
2121
with:
2222
java-version: '8'
2323
distribution: 'temurin'
2424
server-id: ossrh
2525
server-username: MAVEN_USERNAME
2626
server-password: MAVEN_PASSWORD
2727
- name: Cache dependencies
28-
uses: actions/cache@v2
28+
uses: actions/cache@v4
2929
with:
3030
path: |
3131
~/.m2/repository

.github/workflows/spellcheck.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Checkout
9-
uses: actions/checkout@v3
9+
uses: actions/checkout@v4
1010
- name: Check Spelling
1111
uses: rojopolis/[email protected]
1212
with:

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v4
1313

1414
- name: get version from tag
1515
id: get_version
@@ -19,7 +19,7 @@ jobs:
1919
echo "VERSION=$realversion" >> $GITHUB_OUTPUT
2020
2121
- name: Set up publishing to maven central
22-
uses: actions/setup-java@v2
22+
uses: actions/setup-java@v4
2323
with:
2424
java-version: '8'
2525
distribution: 'temurin'

docs/jedis-maven.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<dependency>
77
<groupId>redis.clients</groupId>
88
<artifactId>jedis</artifactId>
9-
<version>5.0.0</version>
9+
<version>5.2.0</version>
1010
</dependency>
1111
```
1212

@@ -28,7 +28,7 @@ and
2828
<dependency>
2929
<groupId>redis.clients</groupId>
3030
<artifactId>jedis</artifactId>
31-
<version>5.1.0-SNAPSHOT</version>
31+
<version>6.0.0-SNAPSHOT</version>
3232
</dependency>
3333
</dependencies>
3434
```

pom.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<packaging>jar</packaging>
1010
<groupId>redis.clients</groupId>
1111
<artifactId>jedis</artifactId>
12-
<version>5.3.0-SNAPSHOT</version>
12+
<version>6.0.0-SNAPSHOT</version>
1313
<name>Jedis</name>
1414
<description>Jedis is a blazingly small and sane Redis java client.</description>
1515
<url>https://github.com/redis/jedis</url>
@@ -62,17 +62,17 @@
6262
<dependency>
6363
<groupId>org.apache.commons</groupId>
6464
<artifactId>commons-pool2</artifactId>
65-
<version>2.12.0</version>
65+
<version>2.12.1</version>
6666
</dependency>
6767
<dependency>
6868
<groupId>org.json</groupId>
6969
<artifactId>json</artifactId>
70-
<version>20240303</version>
70+
<version>20250107</version>
7171
</dependency>
7272
<dependency>
7373
<groupId>com.google.code.gson</groupId>
7474
<artifactId>gson</artifactId>
75-
<version>2.11.0</version>
75+
<version>2.12.1</version>
7676
</dependency>
7777

7878
<dependency>
@@ -145,7 +145,7 @@
145145
<dependency>
146146
<groupId>org.apache.httpcomponents.client5</groupId>
147147
<artifactId>httpclient5-fluent</artifactId>
148-
<version>5.4.1</version>
148+
<version>5.4.2</version>
149149
<scope>test</scope>
150150
</dependency>
151151

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

-7
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ private static ClusterCommandObjects createClusterCommandObjects(RedisProtocol p
4646
return cco;
4747
}
4848

49-
/**
50-
* This method must be called after constructor, if graph commands are going to be used.
51-
*/
52-
public void prepareGraphCommands() {
53-
super.prepareGraphCommands(provider);
54-
}
55-
5649
@Override
5750
public void close() {
5851
try {

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

+34-83
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
import redis.clients.jedis.bloom.*;
2020
import redis.clients.jedis.bloom.RedisBloomProtocol.*;
2121
import redis.clients.jedis.commands.ProtocolCommand;
22-
import redis.clients.jedis.gears.*;
23-
import redis.clients.jedis.gears.RedisGearsProtocol.*;
24-
import redis.clients.jedis.gears.resps.GearsLibraryInfo;
25-
import redis.clients.jedis.graph.GraphProtocol.*;
2622
import redis.clients.jedis.json.*;
2723
import redis.clients.jedis.json.JsonProtocol.JsonCommand;
2824
import redis.clients.jedis.json.DefaultGsonObjectMapper;
@@ -3437,7 +3433,7 @@ public final CommandObject<String> ftCursorDel(String indexName, long cursorId)
34373433
.key(indexName).add(cursorId), BuilderFactory.STRING);
34383434
}
34393435

3440-
public final CommandObject<Map.Entry<AggregationResult, Map<String, Object>>> ftProfileAggregate(
3436+
public final CommandObject<Map.Entry<AggregationResult, ProfilingInfo>> ftProfileAggregate(
34413437
String indexName, FTProfileParams profileParams, AggregationBuilder aggr) {
34423438
return new CommandObject<>(checkAndRoundRobinSearchCommand(SearchCommand.PROFILE, indexName)
34433439
.add(SearchKeyword.AGGREGATE).addParams(profileParams).add(SearchKeyword.QUERY)
@@ -3446,7 +3442,7 @@ public final CommandObject<Map.Entry<AggregationResult, Map<String, Object>>> ft
34463442
: AggregationResult.SEARCH_AGGREGATION_RESULT_WITH_CURSOR));
34473443
}
34483444

3449-
public final CommandObject<Map.Entry<SearchResult, Map<String, Object>>> ftProfileSearch(
3445+
public final CommandObject<Map.Entry<SearchResult, ProfilingInfo>> ftProfileSearch(
34503446
String indexName, FTProfileParams profileParams, Query query) {
34513447
return new CommandObject<>(checkAndRoundRobinSearchCommand(SearchCommand.PROFILE, indexName)
34523448
.add(SearchKeyword.SEARCH).addParams(profileParams).add(SearchKeyword.QUERY)
@@ -3455,7 +3451,7 @@ public final CommandObject<Map.Entry<SearchResult, Map<String, Object>>> ftProfi
34553451
() -> new SearchResultBuilder(!query.getNoContent(), query.getWithScores(), true))));
34563452
}
34573453

3458-
public final CommandObject<Map.Entry<SearchResult, Map<String, Object>>> ftProfileSearch(
3454+
public final CommandObject<Map.Entry<SearchResult, ProfilingInfo>> ftProfileSearch(
34593455
String indexName, FTProfileParams profileParams, String query, FTSearchParams searchParams) {
34603456
return new CommandObject<>(checkAndRoundRobinSearchCommand(SearchCommand.PROFILE, indexName)
34613457
.add(SearchKeyword.SEARCH).addParams(profileParams).add(SearchKeyword.QUERY).add(query)
@@ -4385,70 +4381,6 @@ public final CommandObject<List<Double>> tdigestByRevRank(String key, long... ra
43854381
}
43864382
// RedisBloom commands
43874383

4388-
// RedisGraph commands
4389-
@Deprecated
4390-
public final CommandObject<List<String>> graphList() {
4391-
return new CommandObject<>(commandArguments(GraphCommand.LIST), BuilderFactory.STRING_LIST);
4392-
}
4393-
4394-
@Deprecated
4395-
public final CommandObject<List<String>> graphProfile(String graphName, String query) {
4396-
return new CommandObject<>(commandArguments(GraphCommand.PROFILE).key(graphName).add(query), BuilderFactory.STRING_LIST);
4397-
}
4398-
4399-
@Deprecated
4400-
public final CommandObject<List<String>> graphExplain(String graphName, String query) {
4401-
return new CommandObject<>(commandArguments(GraphCommand.EXPLAIN).key(graphName).add(query), BuilderFactory.STRING_LIST);
4402-
}
4403-
4404-
@Deprecated
4405-
public final CommandObject<List<List<Object>>> graphSlowlog(String graphName) {
4406-
return new CommandObject<>(commandArguments(GraphCommand.SLOWLOG).key(graphName), BuilderFactory.ENCODED_OBJECT_LIST_LIST);
4407-
}
4408-
4409-
@Deprecated
4410-
public final CommandObject<String> graphConfigSet(String configName, Object value) {
4411-
return new CommandObject<>(commandArguments(GraphCommand.CONFIG).add(GraphKeyword.SET).add(configName).add(value), BuilderFactory.STRING);
4412-
}
4413-
4414-
@Deprecated
4415-
public final CommandObject<Map<String, Object>> graphConfigGet(String configName) {
4416-
return new CommandObject<>(commandArguments(GraphCommand.CONFIG).add(GraphKeyword.GET).add(configName), BuilderFactory.ENCODED_OBJECT_MAP);
4417-
}
4418-
// RedisGraph commands
4419-
4420-
// RedisGears commands
4421-
@Deprecated
4422-
public final CommandObject<String> tFunctionLoad(String libraryCode, TFunctionLoadParams params) {
4423-
return new CommandObject<>(commandArguments(GearsCommand.TFUNCTION).add(GearsKeyword.LOAD)
4424-
.addParams(params).add(libraryCode), BuilderFactory.STRING);
4425-
}
4426-
4427-
@Deprecated
4428-
public final CommandObject<String> tFunctionDelete(String libraryName) {
4429-
return new CommandObject<>(commandArguments(GearsCommand.TFUNCTION).add(GearsKeyword.DELETE)
4430-
.add(libraryName), BuilderFactory.STRING);
4431-
}
4432-
4433-
@Deprecated
4434-
public final CommandObject<List<GearsLibraryInfo>> tFunctionList(TFunctionListParams params) {
4435-
return new CommandObject<>(commandArguments(GearsCommand.TFUNCTION).add(GearsKeyword.LIST)
4436-
.addParams(params), GearsLibraryInfo.GEARS_LIBRARY_INFO_LIST);
4437-
}
4438-
4439-
@Deprecated
4440-
public final CommandObject<Object> tFunctionCall(String library, String function, List<String> keys, List<String> args) {
4441-
return new CommandObject<>(commandArguments(GearsCommand.TFCALL).add(library + "." + function)
4442-
.add(keys.size()).keys(keys).addObjects(args), BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
4443-
}
4444-
4445-
@Deprecated
4446-
public final CommandObject<Object> tFunctionCallAsync(String library, String function, List<String> keys, List<String> args) {
4447-
return new CommandObject<>(commandArguments(GearsCommand.TFCALLASYNC).add(library + "." + function)
4448-
.add(keys.size()).keys(keys).addObjects(args), BuilderFactory.AGGRESSIVE_ENCODED_OBJECT);
4449-
}
4450-
// RedisGears commands
4451-
44524384
// Transaction commands
44534385
public final CommandObject<String> watch(String... keys) {
44544386
return new CommandObject<>(commandArguments(WATCH).keys((Object[]) keys), BuilderFactory.STRING);
@@ -4496,32 +4428,51 @@ public void setDefaultSearchDialect(int dialect) {
44964428
this.searchDialect.set(dialect);
44974429
}
44984430

4499-
private class SearchProfileResponseBuilder<T> extends Builder<Map.Entry<T, Map<String, Object>>> {
4431+
private class SearchProfileResponseBuilder<T> extends Builder<Map.Entry<T, ProfilingInfo>> {
45004432

4501-
private static final String PROFILE_STR = "profile";
4433+
private static final String PROFILE_STR_REDIS7 = "profile";
4434+
private static final String PROFILE_STR_REDIS8 = "Profile";
4435+
private static final String RESULTS_STR_REDIS7 = "results";
4436+
private static final String RESULTS_STR_REDIS8 = "Results";
45024437

4503-
private final Builder<T> replyBuilder;
4438+
private final Builder<T> resultsBuilder;
45044439

4505-
public SearchProfileResponseBuilder(Builder<T> replyBuilder) {
4506-
this.replyBuilder = replyBuilder;
4440+
public SearchProfileResponseBuilder(Builder<T> resultsBuilder) {
4441+
this.resultsBuilder = resultsBuilder;
45074442
}
45084443

45094444
@Override
4510-
public Map.Entry<T, Map<String, Object>> build(Object data) {
4445+
public Map.Entry<T, ProfilingInfo> build(Object data) {
45114446
List list = (List) data;
45124447
if (list == null || list.isEmpty()) return null;
45134448

4514-
if (list.get(0) instanceof KeyValue) {
4449+
if (list.get(0) instanceof KeyValue) { // RESP3
4450+
Object resultsData = null, profileData = null;
4451+
45154452
for (KeyValue keyValue : (List<KeyValue>) data) {
4516-
if (PROFILE_STR.equals(BuilderFactory.STRING.build(keyValue.getKey()))) {
4517-
return KeyValue.of(replyBuilder.build(data),
4518-
BuilderFactory.AGGRESSIVE_ENCODED_OBJECT_MAP.build(keyValue.getValue()));
4453+
String keyStr = BuilderFactory.STRING.build(keyValue.getKey());
4454+
switch (keyStr) {
4455+
case PROFILE_STR_REDIS7:
4456+
case PROFILE_STR_REDIS8:
4457+
profileData = keyValue.getValue();
4458+
break;
4459+
case RESULTS_STR_REDIS7:
4460+
resultsData = data;
4461+
break;
4462+
case RESULTS_STR_REDIS8:
4463+
resultsData = keyValue.getValue();
4464+
break;
45194465
}
45204466
}
4467+
4468+
assert resultsData != null : "Could not detect Results data.";
4469+
assert profileData != null : "Could not detect Profile data.";
4470+
return KeyValue.of(resultsBuilder.build(resultsData),
4471+
ProfilingInfo.PROFILING_INFO_BUILDER.build(profileData));
45214472
}
45224473

4523-
return KeyValue.of(replyBuilder.build(list.get(0)),
4524-
SearchBuilderFactory.SEARCH_PROFILE_PROFILE.build(list.get(1)));
4474+
return KeyValue.of(resultsBuilder.build(list.get(0)),
4475+
ProfilingInfo.PROFILING_INFO_BUILDER.build(list.get(1)));
45254476
}
45264477
}
45274478

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

-12
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import org.slf4j.LoggerFactory;
1515

1616
import redis.clients.jedis.exceptions.JedisConnectionException;
17-
import redis.clients.jedis.graph.GraphCommandObjects;
18-
import redis.clients.jedis.providers.ConnectionProvider;
1917
import redis.clients.jedis.util.IOUtils;
2018

2119
public abstract class MultiNodePipelineBase extends PipelineBase {
@@ -39,16 +37,6 @@ public MultiNodePipelineBase(CommandObjects commandObjects) {
3937
connections = new LinkedHashMap<>();
4038
}
4139

42-
/**
43-
* Sub-classes must call this method, if graph commands are going to be used.
44-
* @param connectionProvider connection provider
45-
*/
46-
protected final void prepareGraphCommands(ConnectionProvider connectionProvider) {
47-
GraphCommandObjects graphCommandObjects = new GraphCommandObjects(connectionProvider);
48-
graphCommandObjects.setBaseCommandArgumentsCreator((comm) -> this.commandObjects.commandArguments(comm));
49-
super.setGraphCommands(graphCommandObjects);
50-
}
51-
5240
protected abstract HostAndPort getNodeKey(CommandArguments args);
5341

5442
protected abstract Connection getConnection(HostAndPort nodeKey);

0 commit comments

Comments
 (0)