Skip to content

Commit

Permalink
Extract messages of unsupported exception as constants (#3887)
Browse files Browse the repository at this point in the history
Co-authored-by: zhangshuai <zhangshuai@asiainfo.com>
Co-authored-by: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 16, 2024
1 parent b90fd0b commit ba98da7
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/main/java/redis/clients/jedis/mcf/MultiClusterTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
public class MultiClusterTransaction extends TransactionBase {

private static final Builder<?> NO_OP_BUILDER = BuilderFactory.RAW_OBJECT;

private static final String GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE = "Graph commands are not supported.";

private final CircuitBreakerFailoverConnectionProvider failoverProvider;
private final AtomicInteger extraCommandCount = new AtomicInteger();
Expand Down Expand Up @@ -213,52 +215,52 @@ public final String discard() {
// RedisGraph commands
@Override
public Response<ResultSet> graphQuery(String name, String query) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphReadonlyQuery(String name, String query) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphQuery(String name, String query, long timeout) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphReadonlyQuery(String name, String query, long timeout) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphQuery(String name, String query, Map<String, Object> params) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphReadonlyQuery(String name, String query, Map<String, Object> params) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphQuery(String name, String query, Map<String, Object> params, long timeout) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<ResultSet> graphReadonlyQuery(String name, String query, Map<String, Object> params, long timeout) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<String> graphDelete(String name) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}

@Override
public Response<List<String>> graphProfile(String graphName, String query) {
throw new UnsupportedOperationException("Graph commands are not supported.");
throw new UnsupportedOperationException(GRAPH_COMMANDS_NOT_SUPPORTED_MESSAGE);
}
// RedisGraph commands
}

0 comments on commit ba98da7

Please sign in to comment.