GetStringList() 공개 메소드

Retrieves a list of string values from the specified path in the configuration.
public GetStringList ( string path ) : IList
path string The path that contains the values to retrieve.
리턴 IList
예제 #1
1
        /// <summary>
        /// Performs configuration
        /// </summary>
        /// <param name="configuration">Previous configuration</param>
        /// <param name="config">Akka configuration</param>
        /// <returns>Updated configuration</returns>
        public LoggerConfiguration Configure(LoggerConfiguration configuration, Config config)
        {
            var minimumLevel = config.GetString("ClusterKit.Log.ElasticSearch.minimumLevel", "none")?.Trim();

            LogEventLevel level;
            if (!Enum.TryParse(minimumLevel, true, out level))
            {
                return configuration;
            }

            var nodes = config.GetStringList("ClusterKit.Log.ElasticSearch.nodes");

            var indexFormat = config.GetString("ClusterKit.Log.ElasticSearch.indexFormat", "logstash-{0:yyyy.MM.dd}");

            Log.Information(
                "{Type}: \n\tMinimum level: {MinimumLevel}\n\tIndex format: {IndexFormat}\n\tNodes:\n\t\t{NodeList}\n",
                this.GetType().FullName,
                minimumLevel,
                indexFormat,
                string.Join("\n\t\t", nodes));


            SelfLog.Enable(Console.WriteLine);
            var options = new ElasticsearchSinkOptions(nodes.Select(s => new Uri(s)))
                              {
                                  MinimumLogEventLevel = level,
                                  AutoRegisterTemplate = true,
                                  IndexFormat = indexFormat
                              };

            return configuration.WriteTo.Elasticsearch(options);


        }
예제 #2
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");
 }
예제 #3
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");
        }
예제 #4
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");
     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();
 }
예제 #5
0
 public JournalSettings(Config config)
 {
     if (config == null) throw new ArgumentNullException("config", "Table Storage journal settings cannot be initialized, because required HOCON section couldn't be found");
     TableName = config.GetString("table-name");
     ConnectionStrings = config.GetStringList("connection-strings");
     _settings = new AzureStorageSettings(ConnectionStrings);
 }
        public SessionSettings(Config config)
        {
            if (config == null) throw new ArgumentNullException("config");

            Builder = Cluster.Builder();
            
            // Get IP and port configuration
            int port = config.GetInt("port", 9042);
            IPEndPoint[] contactPoints = ParseContactPoints(config.GetStringList("contact-points"), port);
            Builder.AddContactPoints(contactPoints);

            // Support user/pass authentication
            if (config.HasPath("credentials"))
                Builder.WithCredentials(config.GetString("credentials.username"), config.GetString("credentials.password"));

            // Support SSL
            if (config.GetBoolean("ssl"))
                Builder.WithSSL();

            // Support compression
            string compressionTypeConfig = config.GetString("compression");
            if (compressionTypeConfig != null)
            {
                var compressionType = (CompressionType) Enum.Parse(typeof (CompressionType), compressionTypeConfig, true);
                Builder.WithCompression(compressionType);
            }
        }
예제 #7
0
        private IAutoSubscription GetSubscription(Akka.Configuration.Config config)
        {
            var topicpattern = config.GetString("kafka.topic-pattern");
            var topics       = config.GetStringList("kafka.topics").ToArray();

            return(topicpattern != null?Subscriptions.TopicPattern(topicpattern) : Subscriptions.Topics(topics));
        }
예제 #8
0
 public static ClusterRouterGroupSettings FromConfig(Config config)
 {
     return new ClusterRouterGroupSettings(
         GetMaxTotalNrOfInstances(config),
         ImmutableHashSet.Create(config.GetStringList("routees.paths").ToArray()),
         config.GetBoolean("cluster.allow-local-routees"),
         UseRoleOption(config.GetString("cluster.use-role")));
 }
예제 #9
0
        /// <summary>
        /// Java API: Create settings from a configuration with the same layout as the default configuration 'akka.cluster.client'.
        /// </summary>
        public static ClusterClientSettings Create(Config config)
        {
            var initialContacts = config.GetStringList("initial-contacts").Select(ActorPath.Parse).ToImmutableSortedSet();

            TimeSpan? reconnectTimeout = config.GetString("reconnect-timeout").Equals("off")
                ? null
                : (TimeSpan?)config.GetTimeSpan("reconnect-timeout");

            return new ClusterClientSettings(initialContacts,
                config.GetTimeSpan("establishing-get-contacts-interval"),
                config.GetTimeSpan("refresh-contacts-interval"),
                config.GetTimeSpan("heartbeat-interval"),
                config.GetTimeSpan("acceptable-heartbeat-pause"),
                config.GetInt("buffer-size"),
                reconnectTimeout);
        }
예제 #10
0
 public TransportSettings(Config config)
 {
     TransportClass = config.GetString("transport-class");
     Adapters = config.GetStringList("applied-adapters").Reverse().ToList();
     Config = config;
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="ScatterGatherFirstCompletedGroup" /> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 public ScatterGatherFirstCompletedGroup(Config config)
     : base(config.GetStringList("routees.paths"))
 {
     Within = config.GetTimeSpan("within");
 }
 /// <summary>
 ///     Initializes a new instance of the <see cref="ScatterGatherFirstCompletedGroup" /> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 public ScatterGatherFirstCompletedGroup(Config config)
     : base(config.GetStringList("routees.paths"))
 {
     _within = config.GetMillisDuration("within");
 }
예제 #13
0
 public BlobSnapshotStoreSettings(Config config)
 {
     if (config == null) throw new ArgumentNullException("config", "Azure Blob Storage snapshot store settings cannot be initialized, because required HOCON section couldn't be found");
     ContainerName = config.GetString("container-name");
     ConnectionStrings = config.GetStringList("connection-strings");
     _settings = new AzureStorageSettings(ConnectionStrings);
 }
예제 #14
0
파일: Random.cs 프로젝트: jweimann/akka.net
 /// <summary>
 /// Initializes a new instance of the <see cref="RandomGroup"/> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 public RandomGroup(Config config)
     : base(config.GetStringList("routees.paths"))
 {
 }
 /// <summary>
 /// Creates an instance of the TailChoppingGroup.
 /// </summary>
 /// <param name="config">The configuration to use with this instance.</param>
 public TailChoppingGroup(Config config)
     : base(config.GetStringList("routees.paths").ToArray())
 {
     _within = config.GetTimeSpan("within");
     _interval = config.GetTimeSpan("tail-chopping-router.interval");
 }
예제 #16
0
 private static string GetBootStrapServers(Akka.Configuration.Config config)
 {
     return(config.GetStringList("kafka.bootstrap-servers")
            .Aggregate(new StringBuilder(), (builder, item) => builder.Append(builder.Length == 0 ? "" : ", ").Append(item))
            .ToString());
 }
예제 #17
0
 public ConsistentHashingGroup(Config config)
     : base(config.GetStringList("routees.paths"))
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ScatterGatherFirstCompletedGroup"/> class.
 /// </summary>
 /// <param name="config">
 /// The configuration to use to lookup paths used by the group router.
 /// 
 /// <note>
 /// If 'routees.path' is defined in the provided configuration then those paths will be used by the router.
 /// If 'within' is defined in the provided configuration then that will be used as the interval.
 /// </note>
 /// </param>
 public ScatterGatherFirstCompletedGroup(Config config)
     : this(
           config.GetStringList("routees.paths"),
           config.GetTimeSpan("within"),
           Dispatchers.DefaultDispatcherId)
 {
 }
예제 #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TailChoppingGroup"/> class.
 /// </summary>
 /// <param name="config">
 /// The configuration to use to lookup paths used by the group router.
 /// <note>
 /// If 'routees.path' is defined in the provided configuration then those paths will be used by the router.
 /// If 'within' is defined in the provided configuration then that will be used as the timeout.
 /// If 'tail-chopping-router.interval' is defined in the provided configuration then that will be used as the interval.
 /// </note>
 /// </param>
 public TailChoppingGroup(Config config)
     : this(
           config.GetStringList("routees.paths"),
           config.GetTimeSpan("within"),
           config.GetTimeSpan("tail-chopping-router.interval"),
           Dispatchers.DefaultDispatcherId)
 {
 }
예제 #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BroadcastGroup"/> class.
 /// <note>
 /// If 'routees.path' is defined in the provided configuration then those paths will be used by the router.
 /// </note>
 /// </summary>
 /// <param name="config">The configuration to use to lookup paths used by the group router.</param>
 public BroadcastGroup(Config config)
     : this(
           config.GetStringList("routees.paths"),
           Dispatchers.DefaultDispatcherId)
 {
 }
예제 #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RoundRobinGroup"/> class.
 /// </summary>
 /// <param name="config">
 /// The configuration to use to lookup paths used by the group router.
 /// <note>
 /// If 'routees.path' is defined in the provided configuration then those paths will be used by the router.
 /// </note>
 /// </param>
 public RoundRobinGroup(Config config)
     : this(
           config.GetStringList("routees.paths"),
           Dispatchers.DefaultDispatcherId)
 {
 }
 /// <summary>
 /// Creates an instance of the TailChoppingGroup.
 /// </summary>
 /// <param name="config">The configuration to use with this instance.</param>
 public TailChoppingGroup(Config config)
 {
     Paths = config.GetStringList("routees.paths").ToArray();
     within = config.GetMillisDuration("within");
     interval = config.GetMillisDuration("tail-chopping-router.interval");
 }
예제 #23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RoundRobinGroup"/> class.
 /// </summary>
 /// <param name="config">
 /// The configuration to use to lookup paths used by the group router.
 /// 
 /// <note>
 /// If 'routees.path' is defined in the provided configuration then those paths will be used by the router.
 /// </note>
 /// </param>
 public RoundRobinGroup(Config config)
     : base(config.GetStringList("routees.paths"))
 {
 }
예제 #24
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="BroadcastGroup" /> class.
 /// </summary>
 /// <param name="config">The configuration.</param>
 public BroadcastGroup(Config config)
     : base(config.GetStringList("routees.paths"))
 {
 }
        protected void CreateCouchBaseDBClientConfiguration(Config config)
        {
            if(config.GetBoolean("UseClusterHelper"))
            {
                BucketName = config.GetString("BucketName");
                CBClientConfiguration = ClusterHelper.GetBucket(BucketName).Cluster.Configuration;
                UseClusterHelper = true;
            }
            else
            {
                CBClientConfiguration = new ClientConfiguration();

                // Reset the serializers and deserializers so that JSON is stored as PascalCase instead of camelCase
                CBClientConfiguration.Serializer = () => new DefaultSerializer(new JsonSerializerSettings(), new JsonSerializerSettings());
                CBClientConfiguration.Servers.RemoveAt(0);

                //Get the URI's from the HOCON config
                try
                {
                    if (config.GetStringList("ServersURI").Count > 0)
                    {
                        List<Uri> uris = new List<Uri>();
                        foreach (string s in config.GetStringList("ServersURI"))
                        {
                            CBClientConfiguration.Servers.Add(new Uri(s));
                        }
                    }


                }
                catch (Exception ex)
                {
                    throw new Exception("Invalid URI specified in HOCON configuration", ex);
                }

                // Use SSL?
                CBClientConfiguration.UseSsl = config.GetBoolean("UseSSL");

                // This will not be needed since we are not creating a bucket on the fly.
                //AdminPassword = config.GetString("AdminPassword");
                //AdminUserName = config.GetString("AdminUserName");


                // Get the bucket(s) configuration
                Dictionary<string, BucketConfiguration> BucketConfigs = new Dictionary<string, BucketConfiguration>();
                BucketConfiguration newBC = new BucketConfiguration();


                newBC.UseSsl = config.GetBoolean("BucketUseSSL");
                newBC.Password = config.GetString("Password");
                newBC.DefaultOperationLifespan = (uint)config.GetInt("DefaultOperationLifespan");
                BucketName = config.GetString("BucketName");
                newBC.BucketName = BucketName;
                newBC.PoolConfiguration.MinSize = config.GetInt("PoolConfiguration.MinSize");
                newBC.PoolConfiguration.MaxSize = config.GetInt("PoolConfiguration.MaxSize");

                // Create the bucket config specified in the HOCON
                BucketConfigs.Add(newBC.BucketName, newBC);
                CBClientConfiguration.BucketConfigs = BucketConfigs;

            }
        }
예제 #26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConsistentHashingGroup"/> class.
 /// </summary>
 /// <param name="config">
 /// The configuration to use to lookup paths used by the group router.
 /// 
 /// <note>
 /// If 'routees.path' is defined in the provided configuration then those paths will be used by the router.
 /// 'virtual-nodes-factor' defaults to 0 (zero) if it is not defined in the provided configuration.
 /// </note>
 /// </param>
 public ConsistentHashingGroup(Config config)
     : this(config.GetStringList("routees.paths"))
 {
     VirtualNodesFactor = config.GetInt("virtual-nodes-factor", 0);
 }
예제 #27
0
 public static ClusterRouterGroupSettings FromConfig(Config config)
 {
     return new ClusterRouterGroupSettings(config.GetInt("nr-of-instances"), config.GetBoolean("cluster.allow-local-routees"), config.GetString("cluster.use-role"), ImmutableHashSet.Create(config.GetStringList("routees.paths").ToArray()));
 }