Skip to content

Commit

Permalink
reorder/format due to changes in master
Browse files Browse the repository at this point in the history
  • Loading branch information
sazzad16 committed Nov 25, 2019
1 parent 9aa742e commit 915a810
Show file tree
Hide file tree
Showing 14 changed files with 153 additions and 139 deletions.
6 changes: 3 additions & 3 deletions src/main/java/redis/clients/jedis/BinaryJedis.java
Expand Up @@ -1860,14 +1860,14 @@ public Set<Tuple> zpopmax(final byte[] key, final int count) {
}

@Override
public Set<Tuple> zpopmin(final byte[] key) {
public Tuple zpopmin(final byte[] key) {
checkIsInMultiOrPipeline();
client.zpopmin(key);
return getTupledSet();
return BuilderFactory.TUPLE.build(client.getBinaryMultiBulkReply());
}

@Override
public Set<Tuple> zpopmin(final byte[] key, final long count) {
public Set<Tuple> zpopmin(final byte[] key, final int count) {
checkIsInMultiOrPipeline();
client.zpopmin(key, count);
return getTupledSet();
Expand Down
32 changes: 16 additions & 16 deletions src/main/java/redis/clients/jedis/BinaryJedisCluster.java
Expand Up @@ -897,6 +897,16 @@ public Long execute(Jedis connection) {
}.runBinary(key);
}

@Override
public Double zscore(final byte[] key, final byte[] member) {
return new JedisClusterCommand<Double>(connectionHandler, maxAttempts) {
@Override
public Double execute(Jedis connection) {
return connection.zscore(key, member);
}
}.runBinary(key);
}

@Override
public Tuple zpopmax(final byte[] key) {
return new JedisClusterCommand<Tuple>(connectionHandler, maxAttempts) {
Expand All @@ -916,33 +926,23 @@ public Set<Tuple> execute(Jedis connection) {
}
}.runBinary(key);
}

@Override
public Double zscore(final byte[] key, final byte[] member) {
return new JedisClusterCommand<Double>(connectionHandler, maxAttempts) {
@Override
public Double execute(Jedis connection) {
return connection.zscore(key, member);
}
}.runBinary(key);
}

@Override
public Set<Tuple> zpopmin(final byte[] key, final long count) {
return new JedisClusterCommand<Set<Tuple>>(connectionHandler, maxAttempts) {
public Tuple zpopmin(final byte[] key) {
return new JedisClusterCommand<Tuple>(connectionHandler, maxAttempts) {
@Override
public Set<Tuple> execute(Jedis connection) {
return connection.zpopmin(key, count);
public Tuple execute(Jedis connection) {
return connection.zpopmin(key);
}
}.runBinary(key);
}

@Override
public Set<Tuple> zpopmin(final byte[] key) {
public Set<Tuple> zpopmin(final byte[] key, final int count) {
return new JedisClusterCommand<Set<Tuple>>(connectionHandler, maxAttempts) {
@Override
public Set<Tuple> execute(Jedis connection) {
return connection.zpopmin(key);
return connection.zpopmin(key, count);
}
}.runBinary(key);
}
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/redis/clients/jedis/BinaryShardedJedis.java
Expand Up @@ -532,6 +532,12 @@ public Long zcard(final byte[] key) {
return j.zcard(key);
}

@Override
public Double zscore(final byte[] key, final byte[] member) {
Jedis j = getShard(key);
return j.zscore(key, member);
}

@Override
public Tuple zpopmax(final byte[] key) {
Jedis j = getShard(key);
Expand All @@ -543,21 +549,15 @@ public Set<Tuple> zpopmax(final byte[] key, final int count) {
Jedis j = getShard(key);
return j.zpopmax(key, count);
}

@Override
public Double zscore(final byte[] key, final byte[] member) {
Jedis j = getShard(key);
return j.zscore(key, member);
}

@Override
public Set<Tuple> zpopmin(final byte[] key) {
public Tuple zpopmin(final byte[] key) {
Jedis j = getShard(key);
return j.zpopmin(key);
}

@Override
public Set<Tuple> zpopmin(final byte[] key, final long count) {
public Set<Tuple> zpopmin(final byte[] key, final int count) {
Jedis j = getShard(key);
return j.zpopmin(key, count);
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/redis/clients/jedis/Jedis.java
Expand Up @@ -1691,14 +1691,14 @@ public Set<Tuple> zpopmax(final String key, final int count) {
}

@Override
public Set<Tuple> zpopmin(final String key) {
public Tuple zpopmin(final String key) {
checkIsInMultiOrPipeline();
client.zpopmin(key);
return getTupledSet();
return BuilderFactory.TUPLE.build(client.getBinaryMultiBulkReply());
}

@Override
public Set<Tuple> zpopmin(final String key, final long count) {
public Set<Tuple> zpopmin(final String key, final int count) {
checkIsInMultiOrPipeline();
client.zpopmin(key, count);
return getTupledSet();
Expand Down
32 changes: 26 additions & 6 deletions src/main/java/redis/clients/jedis/JedisCluster.java
Expand Up @@ -934,7 +934,17 @@ public Long execute(Jedis connection) {
}
}.run(key);
}


@Override
public Double zscore(final String key, final String member) {
return new JedisClusterCommand<Double>(connectionHandler, maxAttempts) {
@Override
public Double execute(Jedis connection) {
return connection.zscore(key, member);
}
}.run(key);
}

@Override
public Tuple zpopmax(final String key) {
return new JedisClusterCommand<Tuple>(connectionHandler, maxAttempts) {
Expand All @@ -954,13 +964,23 @@ public Set<Tuple> execute(Jedis connection) {
}
}.run(key);
}

@Override
public Double zscore(final String key, final String member) {
return new JedisClusterCommand<Double>(connectionHandler, maxAttempts) {
public Tuple zpopmin(final String key) {
return new JedisClusterCommand<Tuple>(connectionHandler, maxAttempts) {
@Override
public Double execute(Jedis connection) {
return connection.zscore(key, member);
public Tuple execute(Jedis connection) {
return connection.zpopmin(key);
}
}.run(key);
}

@Override
public Set<Tuple> zpopmin(final String key, final int count) {
return new JedisClusterCommand<Set<Tuple>>(connectionHandler, maxAttempts) {
@Override
public Set<Tuple> execute(Jedis connection) {
return connection.zpopmin(key, count);
}
}.run(key);
}
Expand Down
64 changes: 38 additions & 26 deletions src/main/java/redis/clients/jedis/PipelineBase.java
Expand Up @@ -905,31 +905,7 @@ public Response<Long> zcard(final String key) {
getClient(key).zcard(key);
return getResponse(BuilderFactory.LONG);
}

@Override
public Response<Tuple> zpopmax(final String key) {
getClient(key).zpopmax(key);
return getResponse(BuilderFactory.TUPLE);
}

@Override
public Response<Tuple> zpopmax(final byte[] key) {
getClient(key).zpopmax(key);
return getResponse(BuilderFactory.TUPLE);
}

@Override
public Response<Set<Tuple>> zpopmax(final String key, final int count) {
getClient(key).zpopmax(key, count);
return getResponse(BuilderFactory.TUPLE_ZSET);
}

@Override
public Response<Set<Tuple>> zpopmax(final byte[] key, final int count) {
getClient(key).zpopmax(key, count);
return getResponse(BuilderFactory.TUPLE_ZSET);
}

@Override
public Response<Long> zcard(final byte[] key) {
getClient(key).zcard(key);
Expand Down Expand Up @@ -1325,13 +1301,49 @@ public Response<Double> zscore(final byte[] key, final byte[] member) {
}

@Override
public Response<Set<Tuple>> zpopmin(final String key) {
public Response<Tuple> zpopmax(final String key) {
getClient(key).zpopmax(key);
return getResponse(BuilderFactory.TUPLE);
}

@Override
public Response<Tuple> zpopmax(final byte[] key) {
getClient(key).zpopmax(key);
return getResponse(BuilderFactory.TUPLE);
}

@Override
public Response<Set<Tuple>> zpopmax(final String key, final int count) {
getClient(key).zpopmax(key, count);
return getResponse(BuilderFactory.TUPLE_ZSET);
}

@Override
public Response<Set<Tuple>> zpopmax(final byte[] key, final int count) {
getClient(key).zpopmax(key, count);
return getResponse(BuilderFactory.TUPLE_ZSET);
}

@Override
public Response<Tuple> zpopmin(final String key) {
getClient(key).zpopmin(key);
return getResponse(BuilderFactory.TUPLE);
}

@Override
public Response<Tuple> zpopmin(final byte[] key) {
getClient(key).zpopmin(key);
return getResponse(BuilderFactory.TUPLE);
}

@Override
public Response<Set<Tuple>> zpopmin(final byte[] key, final int count) {
getClient(key).zpopmin(key, count);
return getResponse(BuilderFactory.TUPLE_ZSET);
}

@Override
public Response<Set<Tuple>> zpopmin(final String key, final long count) {
public Response<Set<Tuple>> zpopmin(final String key, final int count) {
getClient(key).zpopmin(key, count);
return getResponse(BuilderFactory.TUPLE_ZSET);
}
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/redis/clients/jedis/ShardedJedis.java
Expand Up @@ -567,6 +567,12 @@ public Long zcard(final String key) {
return j.zcard(key);
}

@Override
public Double zscore(final String key, final String member) {
Jedis j = getShard(key);
return j.zscore(key, member);
}

@Override
public Tuple zpopmax(final String key) {
Jedis j = getShard(key);
Expand All @@ -578,21 +584,15 @@ public Set<Tuple> zpopmax(final String key, final int count) {
Jedis j = getShard(key);
return j.zpopmax(key, count);
}

@Override
public Double zscore(final String key, final String member) {
Jedis j = getShard(key);
return j.zscore(key, member);
}

@Override
public Set<Tuple> zpopmin(final String key) {
public Tuple zpopmin(final String key) {
Jedis j = getShard(key);
return j.zpopmin(key);
}

@Override
public Set<Tuple> zpopmin(final String key, final long count) {
public Set<Tuple> zpopmin(final String key, final int count) {
Jedis j = getShard(key);
return j.zpopmin(key, count);
}
Expand Down
Expand Up @@ -176,16 +176,16 @@ public interface BinaryJedisClusterCommands {
Set<Tuple> zrevrangeWithScores(byte[] key, long start, long stop);

Long zcard(byte[] key);

Tuple zpopmax(byte[] key);

Set<Tuple> zpopmax(byte[] key, int count);

Double zscore(byte[] key, byte[] member);

Set<Tuple> zpopmin(byte[] key);
Tuple zpopmax(byte[] key);

Set<Tuple> zpopmax(byte[] key, int count);

Tuple zpopmin(byte[] key);

Set<Tuple> zpopmin(byte[] key, long count);
Set<Tuple> zpopmin(byte[] key, int count);

List<byte[]> sort(byte[] key);

Expand Down
Expand Up @@ -188,9 +188,9 @@ public interface BinaryJedisCommands {

Set<Tuple> zpopmax(byte[] key, int count);

Set<Tuple> zpopmin(byte[] key);
Tuple zpopmin(byte[] key);

Set<Tuple> zpopmin(byte[] key, long count);
Set<Tuple> zpopmin(byte[] key, int count);

List<byte[]> sort(byte[] key);

Expand Down
Expand Up @@ -166,10 +166,6 @@ public interface BinaryRedisPipeline {
Response<Long> zadd(byte[] key, Map<byte[], Double> scoreMembers, ZAddParams params);

Response<Long> zcard(byte[] key);

Response<Tuple> zpopmax(byte[] key);

Response<Set<Tuple>> zpopmax(byte[] key, int count);

Response<Long> zcount(byte[] key, double min, double max);

Expand Down Expand Up @@ -237,6 +233,14 @@ Response<Set<Tuple>> zrevrangeByScoreWithScores(byte[] key, byte[] max, byte[] m

Response<Double> zscore(byte[] key, byte[] member);

Response<Tuple> zpopmax(byte[] key);

Response<Set<Tuple>> zpopmax(byte[] key, int count);

Response<Tuple> zpopmin(byte[] key);

Response<Set<Tuple>> zpopmin(byte[] key, int count);

Response<Long> zlexcount(byte[] key, byte[] min, byte[] max);

Response<Set<byte[]>> zrangeByLex(byte[] key, byte[] min, byte[] max);
Expand Down
Expand Up @@ -175,12 +175,16 @@ public interface JedisClusterCommands {
Set<Tuple> zrevrangeWithScores(String key, long start, long stop);

Long zcard(String key);


Double zscore(String key, String member);

Tuple zpopmax(String key);

Set<Tuple> zpopmax(String key, int count);

Double zscore(String key, String member);
Tuple zpopmin(String key);

Set<Tuple> zpopmin(String key, int count);

List<String> sort(String key);

Expand Down

0 comments on commit 915a810

Please sign in to comment.