简体   繁体   English

Service Fabric Actor State:在持久模式下从哪里读取 state?

[英]Service Fabric Actor State : where is the state read from in Persistent mode?

In Persistent mode Service fabric actor state is persisted on disk and replicated to other nodes, that is clear from the documentation.在持久模式下,服务结构参与者 state 持久保存在磁盘上并复制到其他节点,这在文档中很清楚。 My question is on consecutive queries to the actor state, throughout the life time of the actor, is each call read from the disk or is it pulled from in memory after the first call to the disk?我的问题是对演员 state 的连续查询,在演员的整个生命周期中,每次调用是从磁盘读取还是在第一次调用磁盘后从 memory 中提取?

Vaclav from the SF team provides the answer here . SF 团队的 Vaclav 在这里提供了答案。

The component that stores your data in your service is called a State Provider.在服务中存储数据的组件称为 State 提供程序。 State providers can be in-memory only or in-memory + local disk. State 提供程序可以仅在内存中或在内存中 + 本地磁盘。 The default state provider you get with an actor service is in-memory + local disk but it only keeps hot data in memory so your storage requirements are not memory bound.您通过参与者服务获得的默认 state 提供程序是内存中 + 本地磁盘,但它仅将热数据保存在 memory 中,因此您的存储要求不受 memory 限制。 Contrast with the Reliable Collections state provider which currently stores all data both in-memory and on local disk, although in a future release it will also have an option to only keep hot data in memory and offload the rest to local disk. Contrast with the Reliable Collections state provider which currently stores all data both in-memory and on local disk, although in a future release it will also have an option to only keep hot data in memory and offload the rest to local disk.

So data for active Actors is in memory, and state is on disk for inactive Actors.因此,活动 Actor 的数据位于 memory 中,state 位于磁盘上用于非活动 Actor。 So, depending on the time between the calls, it could be either.因此,根据通话之间的时间,它可能是两者之一。 (As the Actor life-cycle is managed for you by SF.) Two calls directly following each other will get data from memory. (因为 Actor 的生命周期由 SF 为您管理。)两个直接相互调用的调用将从 memory 获取数据。

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

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