public Long zInterStore(byte[] destKey, byte[]... sets) { try { if (isPipelined()) { pipeline(pipeline.zinterstore(destKey, sets.length, sets)); return null; } return client.zinterstore(destKey, sets.length, sets).data(); } catch (Exception ex) { throw convertSrpAccessException(ex); } }
@Test public void zinterstore() { rc.del(a("zset1", "zset2")); eq(1, rc.zadd(a("zset1", "1", "one"))); eq(1, rc.zadd(a("zset1", "2", "two"))); eq(1, rc.zadd(a("zset2", "1", "one"))); eq(1, rc.zadd(a("zset2", "2", "two"))); eq(1, rc.zadd(a("zset2", "3", "three"))); eq(2, rc.zinterstore(a("out", "2", "zset1", "zset2", WEIGHTS, "2", "3"))); eq(a("one", "5", "two", "10"), rc.zrange("out", "0", "-1", WITHSCORES)); }