Google的Spanner中的TrueTime API是什么? [英] What is the TrueTime API in Google's Spanner?
问题描述
我试图多次阅读该文档,但听不懂。
I tried to read the document multiple times but failed to understand it. Can someone explain it in layman's terms?
推荐答案
TrueTime是Google提供的一种API,可直接暴露时钟不确定性。
TrueTime is an API available at Google that directly exposes clock uncertainty.
与标准日期时间相比库,而不是特定的时间戳,TrueTime的 now()函数返回一个时间间隔[最早,最新]。
Comparing to standard datetime libraries, instead of a particular timestamp, TrueTime's now() function returns an interval of time [earliest, latest].
它还提供了两个功能:
- after(t)如果t肯定已通过,则返回true。例如。 t< now()。最早的。
- before(t)如果t绝对还没有到达,则返回true,或者 t> now() .latest 。
- after(t) returns true if t has definitely passed. E.g. t < now().earliest.
- before(t) returns true if t has definitely not arrived, or t > now().latest.
令人印象深刻的是, now()的实现返回间隔
What's impressive, is that the implementation of now() returns intervals with generally small uncertainty.
Spanner使用TrueTime API满足外部一致性:如果事务 T1 在另一个事务 T2 开始之前提交了,则 T1 的提交时间戳小于 T2 的提交时间戳。
Spanner uses TrueTime API to assign a commit timestamps to transactions in the way that it satisfies external consistency: if a transaction T1 commits before another transaction T2 starts, then T1’s commit timestamp is smaller than T2’s.
Spanner论文中的更多内容 http://static.googleusercontent.com/media/research。 google.com/en//archive/spanner-osdi2012.pdf
More in the Spanner paper http://static.googleusercontent.com/media/research.google.com/en//archive/spanner-osdi2012.pdf
这篇关于Google的Spanner中的TrueTime API是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!