Home Help Center

Dynamic adapt to change of node count

ShilongShilong Member Shilong ZhangOrganization: Beihang universityProject: my graduation projects handling data via IceGrid
Hello everyone.

I want to implement such a scenario: there is a dispatcher service in ICEGRID responsible for dispatch tasks to several nodes according to a map relationship. When a new node is added or an old node is down, the dispatcher should update its map relationship between tasks and nodes, aka, the dispatcher should dynamically adapt to the change of node count.

In this scenario, each node is running on each PC and the dispatcher service is running on a different PC. All the nodes are similar but handle different task according to a task ID. For example, there are three nodes n1, n2 and 6 tasks t1, t2, t3, t4. At the beginning, n1 is responsible for t1, t3 and n2 is responsible for t2, t4. The map relationship of node and task is made by dispatcher. When n2 is down, dispatcher should update the relationship and let n1 responsible for t1~t4.
Besides, each node should have only one server instance, because there is a queue in each node and I want to always get the queue size, if there are several server instances using replica of ICEGRID, I can not make sure which queue I am using.

My question is that if there is any available solution of ICE. If there is no, I want to use observers design pattern to implement that. So I will have a registNode() function in dispatcher service and when a node is added it will call this function in node constructor. But I am not sure what data type to register, is it should be a proxy of that node?

Thank you very much.

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hello Shilong,

    Your dispatcher could implement a Node Observer to be notified each time a node is started or shut down; see IceGrid Administrative Sessions - Ice 3.5 - ZeroC.

    Best regards,
    Bernard
  • ShilongShilong Member Shilong ZhangOrganization: Beihang universityProject: my graduation projects handling data via IceGrid
    Example of IceGrid Administrative Sessions

    Thank you, but would you please give me an example of implementing IceGrid Administrative Sessions in C++. I can find only python code, while my dispatcher is in C++.
    Thanks again!
    bernard wrote: »
    Hello Shilong,

    Your dispatcher could implement a Node Observer to be notified each time a node is started or shut down; see IceGrid Administrative Sessions - Ice 3.5 - ZeroC.

    Best regards,
    Bernard
Sign In or Register to comment.