Exemplo n.º 1
0
 def __init__(self,ip,port,instrumentation):
     Node.__init__(self,ip,port)
     #super().__init__(ip,port)
     self.inst = instrumentation
     self.addNewFunc(self.kill,"kill")
     self.addNewFunc(self.ping,"ping")
Exemplo n.º 2
0
from chordReduce import ChordReduceNode as Node
import time, random
from threading import Thread

port = 9100

if __name__ == '__main__':


    n1 = Node("127.0.0.1",port+1)
    n2 = Node("127.0.0.1",port+2)

    time.sleep(1)

    n1.create()
    print "yay1"
    n2.join(n1.name)
    print "yay2"

    time.sleep(1)

    nodes = [n1,n2]
    for i in range(3,6):
        n = Node("127.0.0.1",port+i)
        print "yay"+str(i)
        print "started", n
        n.join(random.choice(nodes).name)
        nodes.append(n)
        time.sleep(1.0)

    keys = map(lambda x: hex(x.hashid)[:6], nodes)