Exemplo n.º 1
0
 public override void notifyOneWayMsg(IPAddress fromIP, byte[] buffer, int offset, int size)
 {
     Console.WriteLine("ChordProxyNode::notifyOneWayMsg ENTER");
     String[] split = splitMsgBuffer(buffer, offset, size);
     if (String.Compare(split[0], "PREDECESSOR_NOTIFY") == 0)
     {
         thisNode.predecessorNotify((IChordNode)(proxyController.getProxyNode(UtilityMethod.convertStrToIP(split[1]))));
     }
 }
Exemplo n.º 2
0
        public ChordCylinder(IPAddress bootStrapIP, Guid bootStrapChordInstanceGuid, ProxyNodeController proxyNodeController)
        {
            this.proxyNodeController = proxyNodeController;


            registry = new RangeIChordRing[noOfChordRings];
            halo     = new ProxyHalo();


            ZhimeraProxyNode bootstrapProxyNode = (ZhimeraProxyNode)(proxyNodeController.getProxyNode(bootStrapIP));

            double perRange = totalRange / (double)(noOfChordRings);

            for (int i = 0; i < noOfChordRings; i++)
            {
                registry[i]     = new RangeIChordRing();
                registry[i].min = i * perRange;
                registry[i].max = (i + 1) * perRange;
                if (i == noOfChordRings / 2)
                {
                    registry[i].chordRing = new RealChordRing(bootStrapIP, bootStrapChordInstanceGuid);
                }
                else
                {
                    registry[i].chordRing = new ProxyChordRing(halo, noOfChordRings);
                }
            }
        }