java - 分布式系统中的发起节点

标签 java operating-system distributed-computing distributed-system

我的任务是找出分布式系统中状态记录算法的所有可能的启动器节点。

准确给出的问题是

"Write a program to find out the all possible initiator nodes for a state recording algorithm in a distributed system.".

我想提一下,我们在分布式操作系统类(class)中学习了 Chandy - Lamport 的全局状态记录算法。我为另一项作业编写了 Chandy - Lamport 的全局状态记录算法的代码。

这个发起节点代表什么意思?我认为那些记录了其相应状态的节点。我对吗?我必须用java编写代码。请建议我遵循的方法或算法。

最佳答案

根据维基百科页面上的Chandy-Lamport algorithm :

The assumptions of the algorithm are as follows:

  • There are no failures and all messages arrive intact and only once
  • The communication channels are unidirectional and FIFO ordered
  • There is a communication path between any two processes in the system
  • Any process may initiate the snapshot algorithm
  • The snapshot algorithm does not interfere with the normal execution of the processes
  • Each process in the system records its local state and the state of its incoming channels

The algorithm works using marker messages. Each process that wants to initiate a snapshot records its local state and sends a marker on each of its outgoing channels. All the other processes, upon receiving a marker, record their local state, the state of the channel from which the marker just came as empty, and send marker messages on all of their outgoing channels. If a process receives a marker after having recorded its local state, it records the state of the incoming channel from which the marker came as carrying all the messages received since it first recorded its local state.

您使用的术语与维基百科的描述略有不同,但我假设您的“节点”对应于上面的“进程”。因此,“发起者节点”只是发起(请求)快照的节点。

如果这就是您的术语的含义,那么使用 Chandy-Lamport 算法,任何节点都可以是发起者节点。因此,问题的答案是“全部”。

但是,鉴于答案/解决方案的琐碎性质,我怀疑这不是您的作业的真正含义。要么你遗漏了一些上下文,要么作业表述错误。我建议你问问你的导师。

(或者......也许这是一个“技巧问题”。)

关于java - 分布式系统中的发起节点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59600282/

相关文章:

java - Player[] 从数组更改为集合

Python os.walk() 不适用于路径中的波浪号 ~

mysql - mysql 上的分布式事务

javascript - Node.js 可以在 Chrome 中使用其 native 客户端运行客户端(即将发布)

java - Spring Boot 与 MyBatis - @MapperScan 错误

java - 处理最小空指针

java - 在 Eclipse 中使用指定的类加载器加载单例

c - 如果在 fork() 之后使用 execv() ,子进程是否可以访问管道?

android - 如何安装谷歌下载但安装失败的.apk

java - COMPASs Monitor 不显示任何应用程序