简体   繁体   English

在Terracotta的背景下,“它的记忆”是什么意思?

[英]What does “it deltas memory” mean in the context of Terracotta?

I am reading the book Spring Recipes. 我正在阅读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. Terracotta与今天的大多数集群缓存不同,因为它没有可见的API,并且因为它更有效地将更改的状态传递给集群中的节点。 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. 大多数系统使用某种Java序列化或广播机制,其中每个其他节点都被赋予改变的整个对象或对象图,无论他们是否需要知道新状态。 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 . Terracotta以不同的方式做到了: 它增加了对象图本身的内存并同步了集群中的其他节点,因为它们需要一致的对象状态视图 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 ? 我可以理解它没有使用像序列化这样的东西来跨集群传输对象,但“ 它增加内存 ”意味着什么?

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"). 值得一提的是,这本书已被弃用,并不是大多数人现在使用Terracotta的方式(人们使用快速模式,这是基于序列化的“用户类型”)。

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); 无论如何,试图回答你的问题:Terracotta检测你的类,所以围绕场变异和锁定的所有必要的钩子都在那里,所以做的改变(在正确的锁定下)将传播到,首先,L2(又名Terracotta服务器) ; second, to nodes trying to read these fields. 第二,尝试读取这些字段的节点。

I hope this (very quick and short) answer does slightly answer your question. 我希望这个(非常快速和简短)的答案能够稍微回答你的问题。

As axtavt has commented, a Delta is essentially the difference between two instances of an object. 正如axtavt所评论的, Delta本质上是对象的两个实例之间的差异。

... 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. 通过仅发送已更改的信息来同步对象,Terracotta可以更有效地处理此问题。

Think of this like an SVN commit. 可以把它想象成SVN提交。 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. 当您将文件提交到SVN存储库时,您的计算机不会将整个文件发送到服务器,它只会发送diff(或delta)以将文件的存储库版本与本地副本同步。

Hope this helps! 希望这可以帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM