Example #1
0
 public virtual HeartbeatContextImpl Snapshot(CommonContextState commonStateSnapshot, LogProvider logging, Timeouts timeouts, Executor executor)
 {
     return(new HeartbeatContextImpl(Me, commonStateSnapshot, logging, timeouts, new HashSet <>(_failed), new Dictionary <>(_nodeSuspicions), new Listeners <>(_heartBeatListeners), executor));
 }
Example #2
0
 internal HeartbeatContextImpl(InstanceId me, CommonContextState commonState, LogProvider logging, Timeouts timeouts, Executor executor) : base(me, commonState, logging, timeouts)
 {
     this._executor           = executor;
     this._heartBeatListeners = new Listeners <HeartbeatListener>();
 }
Example #3
0
 internal ProposerContextImpl(Org.Neo4j.cluster.InstanceId me, CommonContextState commonState, LogProvider logging, Timeouts timeouts, PaxosInstanceStore paxosInstances, HeartbeatContext heartbeatContext) : base(me, commonState, logging, timeouts)
 {
     this._paxosInstances   = paxosInstances;
     this._heartbeatContext = heartbeatContext;
     _pendingValues         = new LinkedList <Message>();
     _bookedInstances       = new Dictionary <InstanceId, Message>();
 }
Example #4
0
 private ProposerContextImpl(Org.Neo4j.cluster.InstanceId me, CommonContextState commonState, LogProvider logging, Timeouts timeouts, Deque <Message> pendingValues, IDictionary <InstanceId, Message> bookedInstances, PaxosInstanceStore paxosInstances, HeartbeatContext heartbeatContext) : base(me, commonState, logging, timeouts)
 {
     this._pendingValues    = pendingValues;
     this._bookedInstances  = bookedInstances;
     this._paxosInstances   = paxosInstances;
     this._heartbeatContext = heartbeatContext;
 }
Example #5
0
 static Jdi()
 {
     Timeouts   = new Timeouts();
     KillDriver = new WinProcUtils();
 }
Example #6
0
 public virtual ProposerContextImpl Snapshot(CommonContextState commonStateSnapshot, LogProvider logging, Timeouts timeouts, PaxosInstanceStore paxosInstancesSnapshot, HeartbeatContext heartbeatContext)
 {
     return(new ProposerContextImpl(Me, commonStateSnapshot, logging, timeouts, new LinkedList <>(_pendingValues), new Dictionary <>(_bookedInstances), paxosInstancesSnapshot, heartbeatContext));
 }
        public TestSuiteParameters GetTestSuiteParameters()
        {
            TestSuiteParameters parameters = new TestSuiteParameters();

            if (Device != null)
            {
                parameters.Address = Device.DeviceServiceAddress;

                //parameters.CameraUUID
            }

            if (string.IsNullOrEmpty(parameters.Address))
            {
                Console.WriteLine("Mandatory parameters (Device address) not defined!");
                return(null);
            }

            Timeouts     defTimeouts = new Timeouts();
            TestSettings defSettings = new TestSettings();

            if (TestParameters != null)
            {
                parameters.MessageTimeout = (0 != TestParameters.MessageTimeout)
                                                ? TestParameters.MessageTimeout
                                                : defTimeouts.Message;
                parameters.RebootTimeout = (0 != TestParameters.RebootTimeout)
                                               ? TestParameters.RebootTimeout
                                               : defTimeouts.Reboot;
                parameters.RecoveryDelay    = TestParameters.TimeBetweenRequests;
                parameters.TimeBetweenTests = TestParameters.TimeBetweenTests;
                parameters.OperationDelay   = (0 != TestParameters.OperationDelay)
                                                ? TestParameters.OperationDelay
                                                : defSettings.OperationDelay;

                parameters.UserName = TestParameters.UserName;
                parameters.Password = TestParameters.Password;

                parameters.EnvironmentSettings = new EnvironmentSettings();
                parameters.EnvironmentSettings.DefaultGateway     = TestParameters.DefaultGatewayIpv4;
                parameters.EnvironmentSettings.DefaultGatewayIpv6 = TestParameters.DefaultGatewayIpv6;
                parameters.EnvironmentSettings.DnsIpv4            = TestParameters.DnsIpv4;
                parameters.EnvironmentSettings.DnsIpv6            = TestParameters.DnsIpv6;
                parameters.EnvironmentSettings.NtpIpv4            = TestParameters.NtpIpv4;
                parameters.EnvironmentSettings.NtpIpv6            = TestParameters.NtpIpv6;

                if (!string.IsNullOrEmpty(TestParameters.Address))
                {
                    // get all "own" addresses;

                    List <NetworkInterfaceDescription> nics = DiscoveryHelper.GetNetworkInterfaces();

                    // select required address (compare strings)
                    foreach (NetworkInterfaceDescription nic in nics)
                    {
                        if (nic.IP.ToString() == TestParameters.Address)
                        {
                            parameters.NetworkInterfaceController = nic;
                            break;
                        }
                    }

                    if (parameters.NetworkInterfaceController != null)
                    {
                        // define device IP
                        bool ipv6 = (parameters.NetworkInterfaceController.IP != null) &&
                                    (parameters.NetworkInterfaceController.IP.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6);
                        parameters.CameraIP = DiscoveryUtils.GetIP(Device.DeviceIP, ipv6);
                    }
                }

                parameters.UseEmbeddedPassword = TestParameters.UseEmbeddedPassword;
                parameters.Password1           = TestParameters.Password1;
                parameters.Password2           = TestParameters.Password2;
                parameters.SecureMethod        = !string.IsNullOrEmpty(TestParameters.SecureMethod)
                                              ? TestParameters.SecureMethod
                                              : defSettings.SecureMethod;
                parameters.PTZNodeToken        = TestParameters.PTZNodeToken;
                parameters.VideoSourceToken    = TestParameters.VideoSourceToken;
                parameters.EventTopic          = TestParameters.EventTopic;
                parameters.SubscriptionTimeout = (0 != TestParameters.SubscriptionTimeout)
                                                     ? TestParameters.SubscriptionTimeout
                                                     : defSettings.SubscriptionTimeout;
                parameters.TopicNamespaces = TestParameters.TopicNamespaces;
                parameters.RelayOutputDelayTimeMonostable = (0 != TestParameters.RelayOutputDelayTime)
                                                                ? TestParameters.RelayOutputDelayTime
                                                                : defSettings.RelayOutputDelayTimeMonostable;
            }

            //

            return(parameters);
        }
Example #8
0
        public MultiPaxosContext(InstanceId me, IEnumerable <ElectionRole> roles, ClusterConfiguration configuration, Executor executor, LogProvider logging, ObjectInputStreamFactory objectInputStreamFactory, ObjectOutputStreamFactory objectOutputStreamFactory, AcceptorInstanceStore instanceStore, Timeouts timeouts, ElectionCredentialsProvider electionCredentialsProvider, Config config)
        {
            _commonState    = new CommonContextState(configuration, config.Get(ClusterSettings.max_acceptors));
            _paxosInstances = new PaxosInstanceStore();

            _heartbeatContext       = new HeartbeatContextImpl(me, _commonState, logging, timeouts, executor);
            _learnerContext         = new LearnerContextImpl(me, _commonState, logging, timeouts, _paxosInstances, instanceStore, objectInputStreamFactory, objectOutputStreamFactory, _heartbeatContext);
            _clusterContext         = new ClusterContextImpl(me, _commonState, logging, timeouts, executor, objectOutputStreamFactory, objectInputStreamFactory, _learnerContext, _heartbeatContext, config);
            _electionContext        = new ElectionContextImpl(me, _commonState, logging, timeouts, roles, _clusterContext, _heartbeatContext, electionCredentialsProvider);
            _proposerContext        = new ProposerContextImpl(me, _commonState, logging, timeouts, _paxosInstances, _heartbeatContext);
            _acceptorContext        = new AcceptorContextImpl(me, _commonState, logging, timeouts, instanceStore);
            _atomicBroadcastContext = new AtomicBroadcastContextImpl(me, _commonState, logging, timeouts, executor, _heartbeatContext);

            _heartbeatContext.setCircularDependencies(_clusterContext, _learnerContext);
        }
Example #9
0
 public virtual ClusterContextImpl Snapshot(CommonContextState commonStateSnapshot, LogProvider logging, Timeouts timeouts, Executor executor, ObjectOutputStreamFactory objectOutputStreamFactory, ObjectInputStreamFactory objectInputStreamFactory, LearnerContextImpl snapshotLearnerContext, HeartbeatContextImpl snapshotHeartbeatContext)
 {
     return(new ClusterContextImpl(Me, commonStateSnapshot, logging, timeouts, _joiningInstances == null ? null : new List <>(asList(_joiningInstances)), _joinDeniedConfigurationResponseState == null ? null : _joinDeniedConfigurationResponseState.snapshot(), executor, objectOutputStreamFactory, objectInputStreamFactory, snapshotLearnerContext, snapshotHeartbeatContext, _config));
 }
Example #10
0
 internal ClusterContextImpl(InstanceId me, CommonContextState commonState, LogProvider logging, Timeouts timeouts, Executor executor, ObjectOutputStreamFactory objectOutputStreamFactory, ObjectInputStreamFactory objectInputStreamFactory, LearnerContext learnerContext, HeartbeatContext heartbeatContext, Config config) : base(me, commonState, logging, timeouts)
 {
     this._executor = executor;
     this._objectOutputStreamFactory = objectOutputStreamFactory;
     this._objectInputStreamFactory  = objectInputStreamFactory;
     this._learnerContext            = learnerContext;
     this._heartbeatContext          = heartbeatContext;
     this._config = config;
     heartbeatContext.AddHeartbeatListener(new HeartbeatListener_AdapterAnonymousInnerClass(this));
 }
Example #11
0
 public override void Left()
 {
     Timeouts.cancelAllTimeouts();
     CommonState.configuration().left();
     _clusterListeners.notify(_executor, ClusterListener.leftCluster);
 }
Example #12
0
 private ClusterContextImpl(InstanceId me, CommonContextState commonState, LogProvider logging, Timeouts timeouts, IEnumerable <URI> joiningInstances, ClusterMessage.ConfigurationResponseState joinDeniedConfigurationResponseState, Executor executor, ObjectOutputStreamFactory objectOutputStreamFactory, ObjectInputStreamFactory objectInputStreamFactory, LearnerContext learnerContext, HeartbeatContext heartbeatContext, Config config) : base(me, commonState, logging, timeouts)
 {
     this._joiningInstances = joiningInstances;
     this._joinDeniedConfigurationResponseState = joinDeniedConfigurationResponseState;
     this._executor = executor;
     this._objectOutputStreamFactory = objectOutputStreamFactory;
     this._objectInputStreamFactory  = objectInputStreamFactory;
     this._learnerContext            = learnerContext;
     this._heartbeatContext          = heartbeatContext;
     this._config = config;
 }
Example #13
0
 public static extern bool SetCommTimeouts(int handle, Timeouts timeouts);
Example #14
0
 private HeartbeatContextImpl(InstanceId me, CommonContextState commonState, LogProvider logging, Timeouts timeouts, ISet <InstanceId> failed, IDictionary <InstanceId, ISet <InstanceId> > nodeSuspicions, Listeners <HeartbeatListener> heartBeatListeners, Executor executor) : base(me, commonState, logging, timeouts)
 {
     this._failed             = failed;
     this._nodeSuspicions     = nodeSuspicions;
     this._heartBeatListeners = heartBeatListeners;
     this._executor           = executor;
 }
Example #15
0
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
//ORIGINAL LINE: public StateMachines(org.neo4j.logging.LogProvider logProvider, Monitor monitor, org.neo4j.cluster.com.message.MessageSource source, final org.neo4j.cluster.com.message.MessageSender sender, org.neo4j.cluster.timeout.Timeouts timeouts, DelayedDirectExecutor executor, java.util.concurrent.Executor stateMachineExecutor, InstanceId instanceId)
        public StateMachines(LogProvider logProvider, Monitor monitor, MessageSource source, MessageSender sender, Timeouts timeouts, DelayedDirectExecutor executor, Executor stateMachineExecutor, InstanceId instanceId)
        {
            this._log                   = logProvider.getLog(this.GetType());
            this._monitor               = monitor;
            this._sender                = sender;
            this._executor              = executor;
            this._stateMachineExecutor  = stateMachineExecutor;
            this._timeouts              = timeouts;
            this._instanceIdHeaderValue = instanceId.ToString();

            _outgoing = new OutgoingMessageHolder(this);
            timeouts.AddMessageProcessor(this);
            source.AddMessageProcessor(this);
        }
Example #16
0
 public void SetTimeout(int timeout)
 {
     Timeouts.Add(timeout);
 }
Example #17
0
 internal AbstractContextImpl(InstanceId me, CommonContextState commonState, LogProvider logProvider, Timeouts timeouts)
 {
     this.Me          = me;
     this.CommonState = commonState;
     this.LogProvider = logProvider;
     this.Timeouts    = timeouts;
 }