public void CheckPredecessor()
        {
            if (Node.Predecessor == null)
            {
                _timeOutScheduler.StopTimer(OriginPredecessor);
                return;
            }

            _timeOutScheduler.StartTimer(OriginPredecessor);
            Log.Debug("Im called CheckPredecessor");
            _dhtActions.CheckPredecessor(Node.Predecessor, Node.Id, Node);
        }
Пример #2
0
        public void Stabilize()
        {
            // TODO: bootstrap node should have the predecessor with largest id.
            // Otherwise bootstrap node will call on upon itself and block other messages.
            if (Node.Successor == null)
            {
                _dhtActions.FindSuccessor(Node.BootStrapNode, Node.Id, Node);
                return;
            }

            if (Node.Successor.Id.Equals(Node.Id))
            {
                return;
            }

            _dhtActions.Stabilize(Node.Successor, Node.Id, Node);
            _timeOutScheduler.StartTimer(OriginSuccessor);
            // Log.Debug($"Stabilize {Node}");
        }