“它增加记忆”是什么意思?在兵马俑的上下文中意味着什么?

发布于 2024-12-16 23:31:58 字数 428 浏览 4 评论 0原文

我正在读《春季食谱》这本书。我无法理解有关兵马俑的某些说法。

以下是书中的一段话

Terracotta 与当今大多数集群缓存不同,因为它没有可见的 API,而且因为 将更改后的状态传递给集群中的节点的效率要高得多。大多数系统都使用一些 Java 序列化或广播机制,其中每个其他节点都被赋予整个对象,或者 对象图,这已经改变了,无论他们是否需要知道新的状态。 Terracotta 的做法有所不同:它增量对象图本身的内存并同步其他对象图 集群中的节点,因为它们需要对象状态的一致视图。简而言之,它可以做一些事情 相当于只传输对象中的一个更新变量,而不是整个对象。

我可以理解它不使用序列化之类的东西来跨集群传输对象,但是“它增量内存”是什么意思?

I am reading the book Spring Recipes. I am not able to comprehend certain things said about terracota.

The following is a paragraph from the book

Terracotta is different than most clustered caches today because it has no visible API, and because
it’s far more efficient in conveying the changed state to nodes across the cluster. Most systems use some
sort of Java serialization or broadcast mechanism, wherein each other node is given the entire object, or
object graph, that’s changed, regardless of whether they even they need to be aware of the new state.
Terracotta does it differently: it deltas the memory of the object graphs itself and synchronizes other
nodes in the cluster as they need a consistent view of the object state
. Succinctly, it can do something
tantamount to transmitting just one updated variable in an object, and not the entire object.

I can understand that it does not use anything like serialization to transmit objects across cluster, but what does "it deltas memory" mean ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

神仙妹妹 2024-12-23 23:31:58

正如 axtavt 所评论的, Delta 本质上是对象的两个实例之间的差异。

...它增加了对象图的内存...

可以用更简单的术语重述,例如...

它确定对象实例之间的差异

该段落本质上说的是...

其他缓存框架/技术通过在包含每个实例的每条信息的节点之间发送消息来同步集群中多个节点上的对象状态,甚至没有改变的数据。 Terracotta 通过仅发送已更改的信息来同步对象,从而更有效地处理此问题。

可以将其视为 SVN 提交。当您将文件提交到 SVN 存储库时,您的计算机不会将整个文件发送到服务器,它仅发送差异(或增量)以将文件的存储库版本与本地副本同步。

希望这有帮助!

As axtavt has commented, a Delta is essentially the difference between two instances of an object.

... it deltas the memory of the object graphs ...

Can be restated in simpler terms like...

It determines the difference between the object instances

What the paragraph is essentially saying is...

Other caching frameworks/technologies synchronize the state of objects across multiple nodes in a cluster by sending messages between nodes that contain every piece of information about each instance, even data that hasn't changed. Terracotta handles this more efficiently by only sending the information which has changed to synchronize the objects.

Think of this like an SVN commit. When you commit a file to an SVN repo, your computer doesn't send the entire file to the server, it only sends a diff (or delta) to synchronize the repository version of the file with your local copy.

Hope this helps!

一页 2024-12-23 23:31:58

值得一提的是,这本书已被弃用,并且不是当今大多数人使用 Terracotta 的方式(人们使用快速模式,这是基于“用户类型”的序列化)。

无论如何,尝试回答你的问题:Terracotta 工具你的类,因此围绕字段突变和锁定的所有必要挂钩都在那里,以便所做的更改(在适当的锁定下)将首先传播到 L2(又名 Terracotta 服务器) ;其次,尝试读取这些字段的节点。

我希望这个(非常快速和简短)的答案能够稍微回答您的问题。

It worth mentioning that the book is deprecated and isn't the way that most people use Terracotta nowadays (people use express mode, which is serialization-based for "user-types").

Anyways, trying to answer your question: Terracotta instruments your classes so all the necessary hooks around field mutation and locking are there, so that changes done (under proper locking) will be the ones propagated to, first, the L2 (aka Terracotta server); second, to nodes trying to read these fields.

I hope this (very quick and short) answer does slightly answer your question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文