本文整理汇总了C#中IProviderConfiguration.GetIntProperty方法的典型用法代码示例。如果您正苦于以下问题:C# IProviderConfiguration.GetIntProperty方法的具体用法?C# IProviderConfiguration.GetIntProperty怎么用?C# IProviderConfiguration.GetIntProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProviderConfiguration
的用法示例。
在下文中一共展示了IProviderConfiguration.GetIntProperty方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PopulateFromProviderConfig
public virtual void PopulateFromProviderConfig(IProviderConfiguration providerConfiguration)
{
EventHubSettingsType = providerConfiguration.GetTypeProperty(EventHubConfigTypeName, null);
if (string.IsNullOrWhiteSpace(StreamProviderName))
{
throw new ArgumentOutOfRangeException("providerConfiguration", "StreamProviderName not set.");
}
CacheSizeMb = providerConfiguration.GetIntProperty(CacheSizeMbName, DefaultCacheSizeMb);
}
示例2: PopulateFromProviderConfig
/// <summary>
/// Utility function to populate config from provider config
/// </summary>
/// <param name="providerConfiguration"></param>
public virtual void PopulateFromProviderConfig(IProviderConfiguration providerConfiguration)
{
GeneratorConfigType = providerConfiguration.GetTypeProperty(GeneratorConfigTypeName, null);
if (string.IsNullOrWhiteSpace(StreamProviderName))
{
throw new ArgumentOutOfRangeException("providerConfiguration", "StreamProviderName not set.");
}
TotalQueueCount = providerConfiguration.GetIntProperty(TotalQueueCountName, TotalQueueCountDefault);
}
示例3: Init
/// <summary> Init the factory.</summary>
public virtual void Init(IProviderConfiguration config, string providerName, Logger logger, IServiceProvider serviceProvider)
{
if (config == null) throw new ArgumentNullException("config");
if (!config.Properties.TryGetValue(DataConnectionStringPropertyName, out dataConnectionString))
throw new ArgumentException(string.Format("{0} property not set", DataConnectionStringPropertyName));
if (!config.Properties.TryGetValue(DeploymentIdPropertyName, out deploymentId))
throw new ArgumentException(string.Format("{0} property not set", DeploymentIdPropertyName));
cacheSize = SimpleQueueAdapterCache.ParseSize(config, CacheSizeDefaultValue);
numQueues = config.GetIntProperty(NumQueuesPropertyName, NumQueuesDefaultValue);
this.providerName = providerName;
streamQueueMapper = new HashRingBasedStreamQueueMapper(numQueues, providerName);
adapterCache = new SimpleQueueAdapterCache(cacheSize, logger);
if (StreamFailureHandlerFactory == null)
{
StreamFailureHandlerFactory =
qid => Task.FromResult<IStreamFailureHandler>(new NoOpStreamDeliveryFailureHandler(false));
}
}
示例4: PopulateFromProviderConfig
/// <summary>
/// Utility function to populate config from provider config
/// </summary>
/// <param name="providerConfiguration"></param>
public virtual void PopulateFromProviderConfig(IProviderConfiguration providerConfiguration)
{
ConnectionString = providerConfiguration.GetProperty(ConnectionStringName, null);
if (string.IsNullOrWhiteSpace(ConnectionString))
{
throw new ArgumentOutOfRangeException("providerConfiguration", ConnectionStringName + " not set.");
}
ConsumerGroup = providerConfiguration.GetProperty(ConsumerGroupName, null);
if (string.IsNullOrWhiteSpace(ConsumerGroup))
{
throw new ArgumentOutOfRangeException("providerConfiguration", ConsumerGroupName + " not set.");
}
Path = providerConfiguration.GetProperty(PathName, null);
if (string.IsNullOrWhiteSpace(Path))
{
throw new ArgumentOutOfRangeException("providerConfiguration", PathName + " not set.");
}
PrefetchCount = providerConfiguration.GetIntProperty(PrefetchCountName, InvalidPrefetchCount);
if (PrefetchCount == InvalidPrefetchCount)
{
PrefetchCount = null;
}
}
示例5: PopulateFromProviderConfig
/// <summary>
/// Utility function to populate config from provider config
/// </summary>
/// <param name="providerConfiguration"></param>
public void PopulateFromProviderConfig(IProviderConfiguration providerConfiguration)
{
TotalQueueCount = providerConfiguration.GetIntProperty(TotalQueueCountName, TotalQueueCountDefault);
}
示例6: PopulateFromProviderConfig
/// <summary>
/// Utility function to populate config from provider config
/// </summary>
/// <param name="providerConfiguration"></param>
public void PopulateFromProviderConfig(IProviderConfiguration providerConfiguration)
{
EventsInStream = providerConfiguration.GetIntProperty(EventsInStreamName, EventsInStreamDefault);
StreamNamespace = providerConfiguration.GetProperty(StreamNamespaceName, null);
}
示例7: ParseSize
public static int ParseSize(IProviderConfiguration config, int defaultSize)
{
return config.GetIntProperty(CACHE_SIZE_PARAM, defaultSize);
}
示例8: PopulateFromProviderConfig
/// <summary>
/// Read settings from provider configuration.
/// </summary>
/// <param name="providerConfiguration"></param>
public void PopulateFromProviderConfig(IProviderConfiguration providerConfiguration)
{
EventHubSettingsType = providerConfiguration.GetTypeProperty(EventHubConfigTypeName, null);
CheckpointerSettingsType = providerConfiguration.GetTypeProperty(CheckpointerSettingsTypeName, null);
if (string.IsNullOrWhiteSpace(StreamProviderName))
{
throw new ArgumentOutOfRangeException(nameof(providerConfiguration), "StreamProviderName not set.");
}
CacheSizeMb = providerConfiguration.GetIntProperty(CacheSizeMbName, DefaultCacheSizeMb);
DataMinTimeInCache = providerConfiguration.GetTimeSpanProperty(DataMinTimeInCacheName, DefaultDataMinTimeInCache);
DataMaxAgeInCache = providerConfiguration.GetTimeSpanProperty(DataMaxAgeInCacheName, DefaultDataMaxAgeInCache);
}
示例9: ParseSize
public static int ParseSize(IProviderConfiguration config, int defaultSize)
{
return config.GetIntProperty(CacheSizePropertyName, defaultSize);
}