-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #485 from Ladicek/improve-redis-cluster
Improve Redis cluster
- Loading branch information
Showing
8 changed files
with
104 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
*/ | ||
package io.vertx.redis.client; | ||
|
||
import io.vertx.codegen.annotations.VertxGen; | ||
import io.vertx.codegen.annotations.DataObject; | ||
import io.vertx.redis.client.impl.CommandImpl; | ||
import io.vertx.redis.client.impl.KeyLocator; | ||
import io.vertx.redis.client.impl.keys.BeginSearchIndex; | ||
|
@@ -29,7 +29,7 @@ | |
* @author <a href="mailto:[email protected]">Paulo Lopes</a> | ||
* @version redis_version:7.0.12 | ||
*/ | ||
@VertxGen | ||
@DataObject | ||
public interface Command { | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package io.vertx.redis.client; | ||
|
||
import io.vertx.codegen.annotations.DataObject; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
/** | ||
* A result of {@link RedisCluster#groupByNodes(List)}. | ||
* | ||
* @see #getKeyed() | ||
* @see #getUnkeyed() | ||
*/ | ||
@DataObject | ||
public class RequestGrouping { | ||
private final Collection<List<Request>> keyed; | ||
private final List<Request> unkeyed; | ||
|
||
public RequestGrouping(Collection<List<Request>> keyed, List<Request> unkeyed) { | ||
this.keyed = Objects.requireNonNull(keyed); | ||
this.unkeyed = Objects.requireNonNull(unkeyed); | ||
} | ||
|
||
/** | ||
* Returns a collection of request groups such that all requests in each group are | ||
* guaranteed to be sent to the same master node. | ||
* <p> | ||
* Does not include any request that doesn't specify a key; use {@link #getUnkeyed()} | ||
* to get those. | ||
*/ | ||
public Collection<List<Request>> getKeyed() { | ||
return keyed; | ||
} | ||
|
||
/** | ||
* Returns a collection of requests that do not specify a key and would therefore | ||
* be executed on random node. | ||
*/ | ||
public List<Request> getUnkeyed() { | ||
return unkeyed; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters