示例#1
0
 public Node(string url, List <Node> other)
 {
     this.term    = 0;
     this.url     = url;
     VotesPerTerm = new Dictionary <int, string>();
     currentState = new Follower(this);
     TupleSpace   = new TupleSpace();
     otherNodes   = other;
     currentState.Start();
 }
示例#2
0
        public Node(string id, string url, List <Node> other, int minDelay, int maxDelay)
        {
            this.minDelay = minDelay;
            this.maxDelay = maxDelay;
            this.url      = url;
            this.id       = id;
            VotesPerTerm  = new Dictionary <int, string>();
            currentState  = new Follower(this, 0, new RaftLog(this, 0));
            Dictionary <int, Pingable> ping = new Dictionary <int, Pingable>();

            TupleSpace = new TupleSpace();
            int count = 0;

            foreach (Node node in other)
            {
                ping.Add(count, node);
                otherNodes.Add(count, node);
                count++;
                N++;
            }
            manager = new ViewManager(ping);
            manager.Start();
            currentState.Start();
        }
示例#3
0
 public RequestLogResponse(RaftLog l, TupleSpace t)
 {
     Log        = l;
     tupleSpace = t;
 }