예제 #1
0
 public RemoteSettings(Config config)
 {
     Config                        = config;
     LogReceive                    = config.GetBoolean("akka.remote.log-received-messages");
     LogSend                       = config.GetBoolean("akka.remote.log-sent-messages");
     UntrustedMode                 = config.GetBoolean("akka.remote.untrusted-mode");
     TrustedSelectionPaths         = new HashSet <string>(config.GetStringList("akka.remote.trusted-selection-paths"));
     RemoteLifecycleEventsLogLevel = config.GetString("akka.remote.log-remote-lifecycle-events") ?? "DEBUG";
     if (RemoteLifecycleEventsLogLevel.Equals("on"))
     {
         RemoteLifecycleEventsLogLevel = "DEBUG";
     }
     FlushWait       = config.GetMillisDuration("akka.remote.flush-wait-on-shutdown");
     ShutdownTimeout = config.GetMillisDuration("akka.remote.shutdown-timeout");
     TransportNames  = config.GetStringList("akka.remote.enabled-transports");
     Transports      = (from transportName in TransportNames
                        let transportConfig = TransportConfigFor(transportName)
                                              select new TransportSettings(transportConfig)).ToArray();
     Adapters                     = ConfigToMap(config.GetConfig("akka.remote.adapters"));
     BackoffPeriod                = config.GetMillisDuration("akka.remote.backoff-interval");
     RetryGateClosedFor           = config.GetMillisDuration("akka.remote.retry-gate-closed-for", TimeSpan.Zero);
     UsePassiveConnections        = config.GetBoolean("akka.remote.use-passive-connections");
     SysMsgBufferSize             = config.GetInt("akka.remote.system-message-buffer-size");
     SysResendTimeout             = config.GetMillisDuration("akka.remote.resend-interval");
     InitialSysMsgDeliveryTimeout = config.GetMillisDuration("akka.remote.initial-system-message-delivery-timeout");
     SysMsgAckTimeout             = config.GetMillisDuration("akka.remote.system-message-ack-piggyback-timeout");
     QuarantineDuration           = config.GetMillisDuration("akka.remote.prune-quarantine-marker-after");
     StartupTimeout               = config.GetMillisDuration("akka.remote.startup-timeout");
     CommandAckTimeout            = config.GetMillisDuration("akka.remote.command-ack-timeout");
 }
예제 #2
0
        public RemoteSettings(Config config)
        {
            //TODO: need to add value validation for each field
            Config     = config;
            LogReceive = config.GetBoolean("akka.remote.log-received-messages");
            LogSend    = config.GetBoolean("akka.remote.log-sent-messages");

            var bufferSizeLogKey = "akka.remote.log-buffer-size-exceeding";

            if (config.GetString(bufferSizeLogKey).ToLowerInvariant().Equals("off") ||
                config.GetString(bufferSizeLogKey).ToLowerInvariant().Equals("false"))
            {
                LogBufferSizeExceeding = Int32.MaxValue;
            }
            else
            {
                LogBufferSizeExceeding = config.GetInt(bufferSizeLogKey);
            }

            UntrustedMode                 = config.GetBoolean("akka.remote.untrusted-mode");
            TrustedSelectionPaths         = new HashSet <string>(config.GetStringList("akka.remote.trusted-selection-paths"));
            RemoteLifecycleEventsLogLevel = config.GetString("akka.remote.log-remote-lifecycle-events") ?? "DEBUG";
            Dispatcher = config.GetString("akka.remote.use-dispatcher");
            if (RemoteLifecycleEventsLogLevel.Equals("on", StringComparison.OrdinalIgnoreCase))
            {
                RemoteLifecycleEventsLogLevel = "DEBUG";
            }
            FlushWait       = config.GetTimeSpan("akka.remote.flush-wait-on-shutdown");
            ShutdownTimeout = config.GetTimeSpan("akka.remote.shutdown-timeout");
            TransportNames  = config.GetStringList("akka.remote.enabled-transports");
            Transports      = (from transportName in TransportNames
                               let transportConfig = TransportConfigFor(transportName)
                                                     select new TransportSettings(transportConfig)).ToArray();
            Adapters                      = ConfigToMap(config.GetConfig("akka.remote.adapters"));
            BackoffPeriod                 = config.GetTimeSpan("akka.remote.backoff-interval");
            RetryGateClosedFor            = config.GetTimeSpan("akka.remote.retry-gate-closed-for", TimeSpan.Zero);
            UsePassiveConnections         = config.GetBoolean("akka.remote.use-passive-connections");
            SysMsgBufferSize              = config.GetInt("akka.remote.system-message-buffer-size");
            SysResendTimeout              = config.GetTimeSpan("akka.remote.resend-interval");
            SysResendLimit                = config.GetInt("akka.remote.resend-limit");
            InitialSysMsgDeliveryTimeout  = config.GetTimeSpan("akka.remote.initial-system-message-delivery-timeout");
            QuarantineSilentSystemTimeout = config.GetTimeSpan("akka.remote.quarantine-after-silence");
            SysMsgAckTimeout              = config.GetTimeSpan("akka.remote.system-message-ack-piggyback-timeout");
            QuarantineDuration            = config.GetTimeSpan("akka.remote.prune-quarantine-marker-after");

            StartupTimeout    = config.GetTimeSpan("akka.remote.startup-timeout");
            CommandAckTimeout = config.GetTimeSpan("akka.remote.command-ack-timeout");

            WatchFailureDetectorConfig = config.GetConfig("akka.remote.watch-failure-detector");
            WatchFailureDetectorImplementationClass = WatchFailureDetectorConfig.GetString("implementation-class");
            WatchHeartBeatInterval              = WatchFailureDetectorConfig.GetTimeSpan("heartbeat-interval");
            WatchUnreachableReaperInterval      = WatchFailureDetectorConfig.GetTimeSpan("unreachable-nodes-reaper-interval");
            WatchHeartbeatExpectedResponseAfter = WatchFailureDetectorConfig.GetTimeSpan("expected-response-after");
        }