Skip to content

Commit

Permalink
Deprecate RedisGraph support (#3504)
Browse files Browse the repository at this point in the history
* Deprecate Redis Graph support

* in RedisGraphPipelineCommands
  • Loading branch information
sazzad16 authored Aug 17, 2023
1 parent c9f4dee commit 155acfd
Show file tree
Hide file tree
Showing 20 changed files with 117 additions and 7 deletions.
6 changes: 6 additions & 0 deletions src/main/java/redis/clients/jedis/CommandObjects.java
Original file line number Diff line number Diff line change
Expand Up @@ -4187,26 +4187,32 @@ public final CommandObject<List<Double>> tdigestByRevRank(String key, long... ra
// RedisBloom commands

// RedisGraph commands
@Deprecated
public final CommandObject<List<String>> graphList() {
return new CommandObject<>(commandArguments(GraphCommand.LIST), BuilderFactory.STRING_LIST);
}

@Deprecated
public final CommandObject<List<String>> graphProfile(String graphName, String query) {
return new CommandObject<>(commandArguments(GraphCommand.PROFILE).key(graphName).add(query), BuilderFactory.STRING_LIST);
}

@Deprecated
public final CommandObject<List<String>> graphExplain(String graphName, String query) {
return new CommandObject<>(commandArguments(GraphCommand.EXPLAIN).key(graphName).add(query), BuilderFactory.STRING_LIST);
}

@Deprecated
public final CommandObject<List<List<Object>>> graphSlowlog(String graphName) {
return new CommandObject<>(commandArguments(GraphCommand.SLOWLOG).key(graphName), BuilderFactory.ENCODED_OBJECT_LIST_LIST);
}

@Deprecated
public final CommandObject<String> graphConfigSet(String configName, Object value) {
return new CommandObject<>(commandArguments(GraphCommand.CONFIG).add(GraphKeyword.SET).add(configName).add(value), BuilderFactory.STRING);
}

@Deprecated
public final CommandObject<Map<String, Object>> graphConfigGet(String configName) {
return new CommandObject<>(commandArguments(GraphCommand.CONFIG).add(GraphKeyword.GET).add(configName), BuilderFactory.ENCODED_OBJECT_MAP);
}
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/redis/clients/jedis/UnifiedJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -4699,76 +4699,91 @@ public List<Double> tdigestByRevRank(String key, long... ranks) {

// RedisGraph commands
@Override
@Deprecated
public ResultSet graphQuery(String name, String query) {
return executeCommand(graphCommandObjects.graphQuery(name, query));
}

@Override
@Deprecated
public ResultSet graphReadonlyQuery(String name, String query) {
return executeCommand(graphCommandObjects.graphReadonlyQuery(name, query));
}

@Override
@Deprecated
public ResultSet graphQuery(String name, String query, long timeout) {
return executeCommand(graphCommandObjects.graphQuery(name, query, timeout));
}

@Override
@Deprecated
public ResultSet graphReadonlyQuery(String name, String query, long timeout) {
return executeCommand(graphCommandObjects.graphReadonlyQuery(name, query, timeout));
}

@Override
@Deprecated
public ResultSet graphQuery(String name, String query, Map<String, Object> params) {
return executeCommand(graphCommandObjects.graphQuery(name, query, params));
}

@Override
@Deprecated
public ResultSet graphReadonlyQuery(String name, String query, Map<String, Object> params) {
return executeCommand(graphCommandObjects.graphReadonlyQuery(name, query, params));
}

@Override
@Deprecated
public ResultSet graphQuery(String name, String query, Map<String, Object> params, long timeout) {
return executeCommand(graphCommandObjects.graphQuery(name, query, params, timeout));
}

@Override
@Deprecated
public ResultSet graphReadonlyQuery(String name, String query, Map<String, Object> params, long timeout) {
return executeCommand(graphCommandObjects.graphReadonlyQuery(name, query, params, timeout));
}

@Override
@Deprecated
public String graphDelete(String name) {
return executeCommand(graphCommandObjects.graphDelete(name));
}

@Override
@Deprecated
public List<String> graphList() {
return executeCommand(commandObjects.graphList());
}

@Override
@Deprecated
public List<String> graphProfile(String graphName, String query) {
return executeCommand(commandObjects.graphProfile(graphName, query));
}

@Override
@Deprecated
public List<String> graphExplain(String graphName, String query) {
return executeCommand(commandObjects.graphExplain(graphName, query));
}

@Override
@Deprecated
public List<List<Object>> graphSlowlog(String graphName) {
return executeCommand(commandObjects.graphSlowlog(graphName));
}

@Override
@Deprecated
public String graphConfigSet(String configName, Object value) {
return executeCommand(commandObjects.graphConfigSet(configName, value));
}

@Override
@Deprecated
public Map<String, Object> graphConfigGet(String configName) {
return executeCommand(commandObjects.graphConfigGet(configName));
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/redis/clients/jedis/graph/GraphCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
/**
* Store a local cache in the client, for a specific graph. Holds the labels, property names and
* relationship types.
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
interface GraphCache {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
import redis.clients.jedis.graph.GraphProtocol.GraphCommand;
import redis.clients.jedis.providers.ConnectionProvider;

/**
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
public class GraphCommandObjects {

private final RedisGraphCommands graph;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/redis/clients/jedis/graph/GraphProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import redis.clients.jedis.commands.ProtocolCommand;
import redis.clients.jedis.util.SafeEncoder;

@Deprecated
public class GraphProtocol {

@Deprecated
public enum GraphCommand implements ProtocolCommand {

QUERY,
Expand All @@ -29,6 +31,7 @@ public byte[] getRaw() {
}
}

@Deprecated
public enum GraphKeyword implements Rawable {

CYPHER,
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/redis/clients/jedis/graph/GraphQueryParams.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

import java.util.HashMap;
import java.util.Map;
import java.util.function.Function;

import redis.clients.jedis.CommandArguments;
import redis.clients.jedis.commands.ProtocolCommand;
import redis.clients.jedis.exceptions.JedisException;
import redis.clients.jedis.graph.GraphProtocol.GraphCommand;
import redis.clients.jedis.graph.GraphProtocol.GraphKeyword;
import redis.clients.jedis.params.IParams;

/**
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
public class GraphQueryParams implements IParams {

private boolean readonly;
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/redis/clients/jedis/graph/Header.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
import java.util.List;

/**
* Query response header interface. Represents the response schema (column names and types)
* Query response header interface. Represents the response schema (column names and types).
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
public interface Header {

List<ResultSet.ColumnType> getSchemaTypes();
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/redis/clients/jedis/graph/Record.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
* Container for RedisGraph result values.
*
* List records are returned from RedisGraph statement execution, contained within a ResultSet.
*
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
public interface Record {

/**
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/redis/clients/jedis/graph/RedisGraphCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import java.util.List;
import java.util.Map;

/**
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
public interface RedisGraphCommands {

/**
Expand All @@ -11,7 +15,9 @@ public interface RedisGraphCommands {
* @param name a graph to perform the query on
* @param query Cypher query
* @return a result set
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
ResultSet graphQuery(String name, String query);

/**
Expand All @@ -20,7 +26,9 @@ public interface RedisGraphCommands {
* @param name a graph to perform the query on
* @param query Cypher query
* @return a result set
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
ResultSet graphReadonlyQuery(String name, String query);

/**
Expand All @@ -30,7 +38,9 @@ public interface RedisGraphCommands {
* @param query Cypher query
* @param timeout
* @return a result set
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
ResultSet graphQuery(String name, String query, long timeout);

/**
Expand All @@ -40,7 +50,9 @@ public interface RedisGraphCommands {
* @param query Cypher query
* @param timeout
* @return a result set
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
ResultSet graphReadonlyQuery(String name, String query, long timeout);

/**
Expand All @@ -50,7 +62,9 @@ public interface RedisGraphCommands {
* @param query Cypher query.
* @param params parameters map.
* @return a result set.
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
ResultSet graphQuery(String name, String query, Map<String, Object> params);

/**
Expand All @@ -60,7 +74,9 @@ public interface RedisGraphCommands {
* @param query Cypher query.
* @param params parameters map.
* @return a result set.
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
ResultSet graphReadonlyQuery(String name, String query, Map<String, Object> params);

/**
Expand All @@ -71,7 +87,9 @@ public interface RedisGraphCommands {
* @param params parameters map.
* @param timeout
* @return a result set.
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
ResultSet graphQuery(String name, String query, Map<String, Object> params, long timeout);

/**
Expand All @@ -82,40 +100,54 @@ public interface RedisGraphCommands {
* @param params parameters map.
* @param timeout
* @return a result set.
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
ResultSet graphReadonlyQuery(String name, String query, Map<String, Object> params, long timeout);

/**
* Deletes the entire graph
*
* @param name graph to delete
* @return delete running time statistics
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
String graphDelete(String name);

/**
* Lists all graph keys in the keyspace.
* @return graph keys
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
List<String> graphList();

/**
* Executes a query and produces an execution plan augmented with metrics for each operation's execution.
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
List<String> graphProfile(String graphName, String query);

/**
* Constructs a query execution plan but does not run it. Inspect this execution plan to better understand how your
* query will get executed.
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
List<String> graphExplain(String graphName, String query);

/**
* Returns a list containing up to 10 of the slowest queries issued against the given graph ID.
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
List<List<Object>> graphSlowlog(String graphName);

@Deprecated
String graphConfigSet(String configName, Object value);

@Deprecated
Map<String, Object> graphConfigGet(String configName);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,39 @@
import java.util.Map;
import redis.clients.jedis.Response;

/**
* @deprecated Redis Graph support is deprecated.
*/
@Deprecated
public interface RedisGraphPipelineCommands {

@Deprecated
Response<ResultSet> graphQuery(String name, String query);

@Deprecated
Response<ResultSet> graphReadonlyQuery(String name, String query);

@Deprecated
Response<ResultSet> graphQuery(String name, String query, long timeout);

@Deprecated
Response<ResultSet> graphReadonlyQuery(String name, String query, long timeout);

@Deprecated
Response<ResultSet> graphQuery(String name, String query, Map<String, Object> params);

@Deprecated
Response<ResultSet> graphReadonlyQuery(String name, String query, Map<String, Object> params);

@Deprecated
Response<ResultSet> graphQuery(String name, String query, Map<String, Object> params, long timeout);

@Deprecated
Response<ResultSet> graphReadonlyQuery(String name, String query, Map<String, Object> params, long timeout);

@Deprecated
Response<String> graphDelete(String name);

@Deprecated
Response<List<String>> graphProfile(String graphName, String query);
}
Loading

0 comments on commit 155acfd

Please sign in to comment.