Jedis 改变了 Redis 的语义? [英] Jedis Changing the semantics of Redis?

查看:45
本文介绍了Jedis 改变了 Redis 的语义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,Redis 将 zrange(以及相关的排序集命令)指定为一个 ORDERED 结果集(也许是一个没有重复的列表?).

So, Redis specify the zrange (and related sorted set commands) as an ORDERED set of results (a list without duplicates perhaps?).

为什么 Jedis(官方和推荐的 REDIS 客户端)上的 zrange(和相关 API)返回一个 Set???根据定义,哪个没有排序的概念?

Why then the zrange (and related APIs) on Jedis (Official and Recommended REDIS client) return a Set??? Which has, by definition, no concept of ordering?

这直接违反了 redis 操作的语义.

That is a direct violation of the semantics of the redis operations.

这是 zrange jedis 2.0.0 实现:

This is the zrange jedis 2.0.0 implementation:

  public Set<byte[]> zrange(final byte[] key, final int start, final int end) {
        checkIsInMulti();
        client.zrange(key, start, end);
        final List<byte[]> members = client.getBinaryMultiBulkReply();
        return new LinkedHashSet<byte[]>(members);
    } 

Jedis 贡献者,您打算修复它吗?

Jedis contributors, are you planning to fix it?

推荐答案

根据 https://github.com/xetorthio/jedis/issues/244

这篇关于Jedis 改变了 Redis 的语义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆