矢量时钟的实现
对于在不同设备上运行的代码,我需要确定这些设备之间发送的消息的顺序。因此,我想使用矢量时钟,因为我读到矢量时钟允许事件排序。
是否有我可以使用的已建立的框架/公共 API?或者参考实现= 或者我必须从头开始编码吗?
感谢您的任何参考和提示
For my code which is running on different devices, i need to determine the ordering of messages which are sent between those devices. Therefore I would like to use vector clocks since I read vector clocks allow for the ordering of events.
Is there any established framework/public API which I can use for that? Or a reference implementation= Or do I have to code it from scratch?
Thanks for any references and hints
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
VectorClock
实现可从 Google 代码。您还可以查看 Cassandra 中添加矢量时钟支持的补丁。
您还应该阅读 wiki [1] [2] 了解该技术和其他替代方案的限制。
A
VectorClock
implementation is available from Google Code.You could also look at the patches to add vector clock support in Cassandra.
You should also read the wiki [1] [2] for limitations of the technique and other alternatives.
我发现这个矢量时钟是用 Java 编写的,作为 project voldemort 的一部分。
这是源代码。您还需要下拉类和接口引用。
以下是 Javadoc 的链接。
这是关于矢量时钟的维基百科文章。
I found this vector clock written in Java as a part of project voldemort.
Here's a link to the source code. You'll need to also pull down the class and interface references.
Here's a link to the Javadoc.
Here's a Wikipedia article on vector clocks.