-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
190 additions
and
6 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
33 changes: 33 additions & 0 deletions
33
src/main/java/redis/clients/jedis/timeseries/TsMGetRoundRobin.java
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,33 @@ | ||
package redis.clients.jedis.timeseries; | ||
|
||
import java.util.List; | ||
|
||
import redis.clients.jedis.CommandArguments; | ||
import redis.clients.jedis.providers.ConnectionProvider; | ||
import redis.clients.jedis.util.JedisRoundRobinBase; | ||
|
||
public class TsMGetRoundRobin extends JedisRoundRobinBase<List<TSKeyValue<TSElement>>> { | ||
|
||
private final CommandArguments args; | ||
|
||
public TsMGetRoundRobin(ConnectionProvider connectionProvider, TSMGetParams multiGetParams, String... filters) { | ||
super(connectionProvider, TimeSeriesBuilderFactory.TIMESERIES_MGET_RESPONSE); | ||
this.args = new CommandArguments(TimeSeriesProtocol.TimeSeriesCommand.MGET).addParams(multiGetParams) | ||
.add(TimeSeriesProtocol.TimeSeriesKeyword.FILTER).addObjects((Object[]) filters); | ||
} | ||
|
||
@Override | ||
protected boolean isIterationCompleted(List<TSKeyValue<TSElement>> reply) { | ||
return reply != null; | ||
} | ||
|
||
@Override | ||
protected CommandArguments initCommandArguments() { | ||
return args; | ||
} | ||
|
||
@Override | ||
protected CommandArguments nextCommandArguments(List<TSKeyValue<TSElement>> lastReply) { | ||
throw new IllegalStateException(); | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
src/main/java/redis/clients/jedis/timeseries/TsMRangeRoundRobin.java
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,38 @@ | ||
package redis.clients.jedis.timeseries; | ||
|
||
import java.util.List; | ||
|
||
import redis.clients.jedis.CommandArguments; | ||
import redis.clients.jedis.providers.ConnectionProvider; | ||
import redis.clients.jedis.timeseries.TimeSeriesProtocol.TimeSeriesCommand; | ||
import redis.clients.jedis.util.JedisRoundRobinBase; | ||
|
||
public class TsMRangeRoundRobin extends JedisRoundRobinBase<List<TSKeyedElements>> { | ||
|
||
private final CommandArguments args; | ||
|
||
/** | ||
* @param connectionProvider connection provider | ||
* @param reverse {@code false} means TS.MRANGE command; {@code true} means TS.MREVRANGE command | ||
* @param multiRangeParams optional arguments and parameters | ||
*/ | ||
public TsMRangeRoundRobin(ConnectionProvider connectionProvider, boolean reverse, TSMRangeParams multiRangeParams) { | ||
super(connectionProvider, TimeSeriesBuilderFactory.TIMESERIES_MRANGE_RESPONSE); | ||
this.args = new CommandArguments(!reverse ? TimeSeriesCommand.MRANGE : TimeSeriesCommand.MREVRANGE).addParams(multiRangeParams); | ||
} | ||
|
||
@Override | ||
protected boolean isIterationCompleted(List<TSKeyedElements> reply) { | ||
return reply != null; | ||
} | ||
|
||
@Override | ||
protected CommandArguments initCommandArguments() { | ||
return args; | ||
} | ||
|
||
@Override | ||
protected CommandArguments nextCommandArguments(List<TSKeyedElements> lastReply) { | ||
throw new IllegalStateException(); | ||
} | ||
} |
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