public void setMachineAsSellerOf(String machineName, String sellerName, ZNodesDataStructures.SellerNode.NodeRole machineRole) { ZNodesDataStructures.MachineNode data = getMachineRecord(machineName); ZNodesDataStructures.SellerNode sellerData = new ZNodesDataStructures.SellerNode() { nodeId = MachinesPath + "/" + machineName, role = machineRole, uri = data.uri, version = -1 }; zk.Create(SellersPath + "/" + sellerName + "/" + machineName, sellerData, Ids.OPEN_ACL_UNSAFE, CreateMode.Ephemeral); }
/// <summary> /// This function will update a machine in the Sellers subtree according to the parameters it receives /// <para>TODO: if machine is set as backup, it should listen to primary and replace it upon failure</para> /// </summary> /// <param name="machine">The name of the machine to add in the added seller's subtree</param> /// <param name="machineUri">Uri of the machine to add</param> /// <param name="machineRole">The role to add this machine. Backup or Primary</param> /// <param name="toLeave">Sellers which this machine need to leave</param> /// <param name="toJoin">Sellers which this machine need to join</param> private void diffMergeMachineSellers(String machine, Uri machineUri, ZNodesDataStructures.SellerNode.NodeRole machineRole, List <String> toLeave, List <String> toJoin) { throw new NotImplementedException("F**K YOU"); }