Skip to content

Commit

Permalink
Revert "Support IGNORE and other optional arguments for timeseries co…
Browse files Browse the repository at this point in the history
…mmands (#3860)"

This reverts commit e7503d7.

The commit e7503d7 is merged (cherry-picked) into 5.2.0 branch by commit ac18fd0.
  • Loading branch information
sazzad16 committed Jun 14, 2024
1 parent e7503d7 commit 619f8e3
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 600 deletions.
20 changes: 2 additions & 18 deletions src/main/java/redis/clients/jedis/CommandObjects.java
Original file line number Diff line number Diff line change
Expand Up @@ -3946,15 +3946,9 @@ public final CommandObject<Long> tsAdd(String key, long timestamp, double value)
return new CommandObject<>(commandArguments(TimeSeriesCommand.ADD).key(key).add(timestamp).add(value), BuilderFactory.LONG);
}

@Deprecated
public final CommandObject<Long> tsAdd(String key, long timestamp, double value, TSCreateParams createParams) {
return new CommandObject<>(commandArguments(TimeSeriesCommand.ADD).key(key).add(timestamp).add(value)
.addParams(createParams), BuilderFactory.LONG);
}

public final CommandObject<Long> tsAdd(String key, long timestamp, double value, TSAddParams addParams) {
return new CommandObject<>(commandArguments(TimeSeriesCommand.ADD).key(key).add(timestamp).add(value)
.addParams(addParams), BuilderFactory.LONG);
return new CommandObject<>(commandArguments(TimeSeriesCommand.ADD).key(key)
.add(timestamp).add(value).addParams(createParams), BuilderFactory.LONG);
}

public final CommandObject<List<Long>> tsMAdd(Map.Entry<String, TSElement>... entries) {
Expand All @@ -3974,11 +3968,6 @@ public final CommandObject<Long> tsIncrBy(String key, double value, long timesta
.add(TimeSeriesKeyword.TIMESTAMP).add(timestamp), BuilderFactory.LONG);
}

public final CommandObject<Long> tsIncrBy(String key, double addend, TSIncrOrDecrByParams incrByParams) {
return new CommandObject<>(commandArguments(TimeSeriesCommand.INCRBY).key(key).add(addend)
.addParams(incrByParams), BuilderFactory.LONG);
}

public final CommandObject<Long> tsDecrBy(String key, double value) {
return new CommandObject<>(commandArguments(TimeSeriesCommand.DECRBY).key(key).add(value), BuilderFactory.LONG);
}
Expand All @@ -3988,11 +3977,6 @@ public final CommandObject<Long> tsDecrBy(String key, double value, long timesta
.add(TimeSeriesKeyword.TIMESTAMP).add(timestamp), BuilderFactory.LONG);
}

public final CommandObject<Long> tsDecrBy(String key, double subtrahend, TSIncrOrDecrByParams decrByParams) {
return new CommandObject<>(commandArguments(TimeSeriesCommand.DECRBY).key(key).add(subtrahend)
.addParams(decrByParams), BuilderFactory.LONG);
}

public final CommandObject<List<TSElement>> tsRange(String key, long fromTimestamp, long toTimestamp) {
return new CommandObject<>(commandArguments(TimeSeriesCommand.RANGE).key(key)
.add(fromTimestamp).add(toTimestamp), TimeSeriesBuilderFactory.TIMESERIES_ELEMENT_LIST);
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/redis/clients/jedis/PipeliningBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -3948,11 +3948,6 @@ public Response<Long> tsAdd(String key, long timestamp, double value, TSCreatePa
return appendCommand(commandObjects.tsAdd(key, timestamp, value, createParams));
}

@Override
public Response<Long> tsAdd(String key, long timestamp, double value, TSAddParams addParams) {
return appendCommand(commandObjects.tsAdd(key, timestamp, value, addParams));
}

@Override
public Response<List<Long>> tsMAdd(Map.Entry<String, TSElement>... entries) {
return appendCommand(commandObjects.tsMAdd(entries));
Expand All @@ -3968,11 +3963,6 @@ public Response<Long> tsIncrBy(String key, double value, long timestamp) {
return appendCommand(commandObjects.tsIncrBy(key, value, timestamp));
}

@Override
public Response<Long> tsIncrBy(String key, double addend, TSIncrOrDecrByParams incrByParams) {
return appendCommand(commandObjects.tsIncrBy(key, addend, incrByParams));
}

@Override
public Response<Long> tsDecrBy(String key, double value) {
return appendCommand(commandObjects.tsDecrBy(key, value));
Expand All @@ -3983,11 +3973,6 @@ public Response<Long> tsDecrBy(String key, double value, long timestamp) {
return appendCommand(commandObjects.tsDecrBy(key, value, timestamp));
}

@Override
public Response<Long> tsDecrBy(String key, double subtrahend, TSIncrOrDecrByParams decrByParams) {
return appendCommand(commandObjects.tsDecrBy(key, subtrahend, decrByParams));
}

@Override
public Response<List<TSElement>> tsRange(String key, long fromTimestamp, long toTimestamp) {
return appendCommand(commandObjects.tsRange(key, fromTimestamp, toTimestamp));
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/redis/clients/jedis/UnifiedJedis.java
Original file line number Diff line number Diff line change
Expand Up @@ -4473,11 +4473,6 @@ public long tsAdd(String key, long timestamp, double value, TSCreateParams creat
return executeCommand(commandObjects.tsAdd(key, timestamp, value, createParams));
}

@Override
public long tsAdd(String key, long timestamp, double value, TSAddParams addParams) {
return executeCommand(commandObjects.tsAdd(key, timestamp, value, addParams));
}

@Override
public List<Long> tsMAdd(Map.Entry<String, TSElement>... entries) {
return executeCommand(commandObjects.tsMAdd(entries));
Expand All @@ -4493,11 +4488,6 @@ public long tsIncrBy(String key, double value, long timestamp) {
return executeCommand(commandObjects.tsIncrBy(key, value, timestamp));
}

@Override
public long tsIncrBy(String key, double addend, TSIncrOrDecrByParams incrByParams) {
return executeCommand(commandObjects.tsIncrBy(key, addend, incrByParams));
}

@Override
public long tsDecrBy(String key, double value) {
return executeCommand(commandObjects.tsDecrBy(key, value));
Expand All @@ -4508,11 +4498,6 @@ public long tsDecrBy(String key, double value, long timestamp) {
return executeCommand(commandObjects.tsDecrBy(key, value, timestamp));
}

@Override
public long tsDecrBy(String key, double subtrahend, TSIncrOrDecrByParams decrByParams) {
return executeCommand(commandObjects.tsDecrBy(key, subtrahend, decrByParams));
}

@Override
public List<TSElement> tsRange(String key, long fromTimestamp, long toTimestamp) {
return executeCommand(commandObjects.tsRange(key, fromTimestamp, toTimestamp));
Expand Down
24 changes: 0 additions & 24 deletions src/main/java/redis/clients/jedis/timeseries/EncodingFormat.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -59,33 +59,16 @@ public interface RedisTimeSeriesCommands {
long tsAdd(String key, long timestamp, double value);

/**
* {@code TS.ADD key timestamp value [RETENTION retentionTime] [ENCODING [COMPRESSED|UNCOMPRESSED]] [CHUNK_SIZE size] [ON_DUPLICATE policy] [LABELS label value..]}
*
* @param key
* @param timestamp
* @param value
* @param createParams
* @return timestamp
* @deprecated Use {@link RedisTimeSeriesCommands#tsAdd(java.lang.String, long, double, redis.clients.jedis.timeseries.TSAddParams)}.
*/
@Deprecated
long tsAdd(String key, long timestamp, double value, TSCreateParams createParams);

/**
* {@code TS.ADD key timestamp value
* [RETENTION retentionTime]
* [ENCODING <COMPRESSED|UNCOMPRESSED>]
* [CHUNK_SIZE size]
* [DUPLICATE_POLICY policy]
* [ON_DUPLICATE policy_ovr]
* [LABELS label value..]}
*
* @param key
* @param timestamp
* @param value
* @param addParams
* @return timestamp
*/
long tsAdd(String key, long timestamp, double value, TSAddParams addParams);

/**
* {@code TS.MADD key timestamp value [key timestamp value ...]}
*
Expand All @@ -98,44 +81,10 @@ public interface RedisTimeSeriesCommands {

long tsIncrBy(String key, double value, long timestamp);

/**
* {@code TS.INCRBY key addend
* [TIMESTAMP timestamp]
* [RETENTION retentionPeriod]
* [ENCODING <COMPRESSED|UNCOMPRESSED>]
* [CHUNK_SIZE size]
* [DUPLICATE_POLICY policy]
* [IGNORE ignoreMaxTimediff ignoreMaxValDiff]
* [LABELS [label value ...]]}
*
* @param key
* @param addend
* @param incrByParams
* @return timestamp
*/
long tsIncrBy(String key, double addend, TSIncrOrDecrByParams incrByParams);

long tsDecrBy(String key, double value);

long tsDecrBy(String key, double value, long timestamp);

/**
* {@code TS.DECRBY key subtrahend
* [TIMESTAMP timestamp]
* [RETENTION retentionPeriod]
* [ENCODING <COMPRESSED|UNCOMPRESSED>]
* [CHUNK_SIZE size]
* [DUPLICATE_POLICY policy]
* [IGNORE ignoreMaxTimediff ignoreMaxValDiff]
* [LABELS [label value ...]]}
*
* @param key
* @param subtrahend
* @param decrByParams
* @return timestamp
*/
long tsDecrBy(String key, double subtrahend, TSIncrOrDecrByParams decrByParams);

/**
* {@code TS.RANGE key fromTimestamp toTimestamp}
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,18 @@ public interface RedisTimeSeriesPipelineCommands {

Response<Long> tsAdd(String key, long timestamp, double value);

@Deprecated
Response<Long> tsAdd(String key, long timestamp, double value, TSCreateParams createParams);

Response<Long> tsAdd(String key, long timestamp, double value, TSAddParams addParams);

Response<List<Long>> tsMAdd(Map.Entry<String, TSElement>... entries);

Response<Long> tsIncrBy(String key, double value);

Response<Long> tsIncrBy(String key, double value, long timestamp);

Response<Long> tsIncrBy(String key, double addend, TSIncrOrDecrByParams incrByParams);

Response<Long> tsDecrBy(String key, double value);

Response<Long> tsDecrBy(String key, double value, long timestamp);

Response<Long> tsDecrBy(String key, double subtrahend, TSIncrOrDecrByParams decrByParams);

Response<List<TSElement>> tsRange(String key, long fromTimestamp, long toTimestamp);

Response<List<TSElement>> tsRange(String key, TSRangeParams rangeParams);
Expand Down
128 changes: 0 additions & 128 deletions src/main/java/redis/clients/jedis/timeseries/TSAddParams.java

This file was deleted.

Loading

0 comments on commit 619f8e3

Please sign in to comment.