开发者

lowest possible timeuuid in php (phpcassa)

pycassa has pycassa.util.convert_time_to_uuid(time_arg, lowest_val=True, randomize=False)

phpcassa has static string uuid1 ([string $node = null], [int $time = null])

Can phpcassa's uuid1 be used to get lowest/highest uuids like in pycassa? If not, what's the best approach to ensure you get everything between two 开发者_开发百科given timestamps?


I believe that if you have a column with a type of UUID version 1, Cassandra will ignore the 'unique' component of the UUID and just use the time part for the range.


Strictly speaking, Cassandra sorts primarily by the timestamp component of a v1 UUID, and in the case of a tie, it sorts by the remaining bytes:

int res = compareTimestampBytes(o1, o2);
if (res != 0)
    return res;
return o1.compareTo(o2);

phpcassa should offer something similar to pycassa here. As a workaround in the meantime, you can set the last 8 bytes of the return value to 0x00.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜