【发布时间】:2022-02-23 11:16:19
【问题描述】:
在 etcd 3.0.x 中,引入了一个新的 API,我只是在阅读它。在RangeRequest 对象中,我不清楚一件事。在description of the property range_end 中,它说:
如果 range_end 比给定键大一位, 然后范围请求获取带有前缀的所有键(给定键)。
这里是完整的文本,提供一些上下文:
// key is the first key for the range. If range_end is not given, the request only looks up key.
bytes key = 1;
// range_end is the upper bound on the requested range [key, range_end).
// If range_end is '\0', the range is all keys >= key.
// If the range_end is one bit larger than the given key,
// then the range requests get the all keys with the prefix (the given key).
// If both key and range_end are '\0', then range requests returns all keys.
bytes range_end = 2;
我的问题是:这是什么意思
如果 range_end 比给定键大一位
?这是否意味着range_end 比key 长1 位?这是否意味着当解释为整数时它必须是key+1?如果是后者,使用哪种编码方式?
【问题讨论】:
标签: etcd