java 矢量时钟的实现

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3061927/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 00:09:52  来源:igfitidea点击:

Implementation of Vector Clocks

javaframeworksreference-implementationvector-clock

提问by

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?

我可以使用任何已建立的框架/公共 API 吗?或者参考实现=或者我必须从头开始编码吗?

Thanks for any references and hints

感谢您的任何参考和提示

采纳答案by the_void

A VectorClockimplementation is available from Google Code.

Google CodeVectorClock提供了一个实现。

You could also look at the patches to add vector clock support in Cassandra.

您还可以查看补丁以在Cassandra 中添加矢量时钟支持。

You should also read the wiki [1][2]for limitations of the technique and other alternatives.

您还应该阅读 wiki [1] [2]以了解该技术和其他替代方法的限制。

回答by Gilbert Le Blanc

I found this vector clock written in Java as a part of project voldemort.

我发现这个矢量时钟是用 Java 编写的,是项目 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.

这是Javadoc的链接。

Here's a Wikipedia article on vector clocks.

这是关于矢量时钟的维基百科文章。