Skip to content

Commit

Permalink
Merge pull request #148 from v1r3n/zadd_params
Browse files Browse the repository at this point in the history
Implementation of zadd with parameters to support xx, nx and ch params
  • Loading branch information
ipapapa authored Oct 21, 2016
2 parents 1e0d3cf + 57c8b13 commit 15a91e9
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,23 @@ public Long execute(Jedis client, ConnectionContext state) {
});
}

@Override
public Long zadd(String key, double score, String member, ZAddParams params) {
return d_zadd(key, score, member, params).getResult();
}

public OperationResult<Long> d_zadd(final String key, final double score, final String member, final ZAddParams params) {

return connPool.executeWithFailover(new BaseKeyOperation<Long>(key, OpName.ZADD) {

@Override
public Long execute(Jedis client, ConnectionContext state) {
return client.zadd(key, score, member, params);
}

});
}

@Override
public Long zcard(final String key) {
return d_zcard(key).getResult();
Expand Down Expand Up @@ -3653,11 +3670,6 @@ public Long zadd(String arg0, Map<String, Double> arg1, ZAddParams arg2) {
throw new UnsupportedOperationException("not yet implemented");
}

@Override
public Long zadd(String arg0, double arg1, String arg2, ZAddParams arg3) {
throw new UnsupportedOperationException("not yet implemented");
}

@Override
public Double zincrby(String arg0, double arg1, String arg2,
ZIncrByParams arg3) {
Expand Down

0 comments on commit 15a91e9

Please sign in to comment.