Esempio n. 1
0
        protected override MemberInfo GetInitialMe()
        {
            var lastEpoch    = _epochManager.GetLastEpoch();
            var initialState = _memberInfo.IsReadOnlyReplica ? VNodeState.ReadOnlyLeaderless : VNodeState.Unknown;

            return(MemberInfo.ForVNode(_memberInfo.InstanceId,
                                       _timeProvider.UtcNow,
                                       initialState,
                                       true,
                                       _memberInfo.InternalTcpEndPoint,
                                       _memberInfo.InternalSecureTcpEndPoint,
                                       _memberInfo.ExternalTcpEndPoint,
                                       _memberInfo.ExternalSecureTcpEndPoint,
                                       _memberInfo.HttpEndPoint,
                                       _memberInfo.AdvertiseHostToClientAs,
                                       _memberInfo.AdvertiseHttpPortToClientAs,
                                       _memberInfo.AdvertiseTcpPortToClientAs,
                                       _getLastCommitPosition(),
                                       _writerCheckpoint.Read(),
                                       _chaserCheckpoint.Read(),
                                       lastEpoch == null ? -1 : lastEpoch.EpochPosition,
                                       lastEpoch == null ? -1 : lastEpoch.EpochNumber,
                                       lastEpoch == null ? Guid.Empty : lastEpoch.EpochId,
                                       _nodePriority,
                                       _memberInfo.IsReadOnlyReplica));
        }
Esempio n. 2
0
        protected override MemberInfo GetInitialMe()
        {
            var lastEpoch    = _epochManager.GetLastEpoch();
            var initialState = NodeInfo.IsReadOnlyReplica ?
                               VNodeState.ReadOnlyMasterless : VNodeState.Unknown;

            return(MemberInfo.ForVNode(NodeInfo.InstanceId,
                                       DateTime.UtcNow,
                                       initialState,
                                       true,
                                       NodeInfo.InternalTcp,
                                       NodeInfo.InternalSecureTcp,
                                       NodeInfo.ExternalTcp,
                                       NodeInfo.ExternalSecureTcp,
                                       NodeInfo.InternalHttp,
                                       NodeInfo.ExternalHttp,
                                       _getLastCommitPosition(),
                                       _writerCheckpoint.Read(),
                                       _chaserCheckpoint.Read(),
                                       lastEpoch == null ? -1 : lastEpoch.EpochPosition,
                                       lastEpoch == null ? -1 : lastEpoch.EpochNumber,
                                       lastEpoch == null ? Guid.Empty : lastEpoch.EpochId,
                                       _nodePriority,
                                       NodeInfo.IsReadOnlyReplica));
        }