Skip to content

Commit

Permalink
send command on cluster with no key should send to randmon node
Browse files Browse the repository at this point in the history
  • Loading branch information
gkorland committed Sep 17, 2024
1 parent a340ff2 commit 520a61e
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 35 deletions.
82 changes: 47 additions & 35 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.falkordb</groupId>
<artifactId>jredisgraph</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>2.8.1-SNAPSHOT</version>

<name>JRedisGraph</name>
<description>Official client for Redis-Graph</description>
<url>https://redisgraph.io</url>
<description>Fork of official client for Redis-Graph</description>
<url>https://www.falkordb.com</url>

<organization>
<name>RedisLabs</name>
<url>www.redislabs.com</url>
<name>FalkorDB</name>
<url>www.falkordb.com</url>
</organization>
<ciManagement>
<system>CircleCI</system>
<url>https://circleci.com/gh/RedisGraph/JRedisGraph</url>
<url>https://circleci.com/gh/FalkorDB/JRedisGraph</url>
</ciManagement>
<issueManagement>
<url>https://github.com/RedisGraph/JRedisGraph/issues</url>
<url>https://github.com/FalkorDB/JRedisGraph/issues</url>
<system>Github</system>
</issueManagement>
<scm>
<url>https://github.com/RedisGraph/JRedisGraph</url>
<connection>scm:git:git://github.com/RedisGraph/JRedisGraph.git</connection>
<developerConnection>scm:git:[email protected]:RedisGraph/JRedisGraph.git</developerConnection>
<url>https://github.com/FalkorDB/JRedisGraph</url>
<connection>scm:git:git://github.com/FalkorDB/JRedisGraph.git</connection>
<developerConnection>scm:git:[email protected]:FalkorDB/JRedisGraph.git</developerConnection>
</scm>
<developers>
<developer>
Expand All @@ -36,7 +35,7 @@
</developer>
<developer>
<name>Guy Korland</name>
<organization>Redis Labs, Inc.</organization>
<organization>FalkrDB, Inc.</organization>
</developer>
</developers>
<licenses>
Expand All @@ -54,9 +53,9 @@
<version>3.9.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.10.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand All @@ -70,36 +69,33 @@
<version>1.6.6</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.7.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.7.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>3.1.10</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencies>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.test.source>8</maven.test.source>
<maven.test.target>8</maven.test.target>
</properties>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<id>github</id>
<name>GitHub OWNER Apache Maven Packages</name>
<url>https://maven.pkg.github.com/FalkorDB/JRedisGraph</url>
</repository>
</distributionManagement>

<build>
<plugins>
<plugin>
Expand All @@ -124,7 +120,7 @@
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand All @@ -135,6 +131,22 @@
</plugins>
</build>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/FalkorDB/JRedisGraph</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
<profile>
<id>release</id>
<build>
Expand All @@ -143,7 +155,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<version>3.3.0</version>
<executions>
<execution>
<id>attach-sources</id>
Expand All @@ -156,7 +168,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>3.5.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -171,7 +183,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<version>3.1.0</version>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,21 @@ public ClusterConnection(JedisCluster cluster) {

@Override
public Object sendCommand(ProtocolCommand cmd, String... args) {

if (args.length == 0) {
return cluster.sendCommand("k", cmd, args);
}

return cluster.sendCommand(args[0], cmd, args);
}

@Override
public Object sendBlockingCommand(ProtocolCommand cmd, String... args) {

if (args.length == 0) {
return cluster.sendBlockingCommand("k", cmd, args);
}

return cluster.sendBlockingCommand(args[0], cmd, args);
}

Expand Down

0 comments on commit 520a61e

Please sign in to comment.