2025-04-17 20:28:50 +08:00
|
|
|
|
using JiShe.CollectBus.IoTDB.Options;
|
|
|
|
|
|
using Microsoft.Extensions.Options;
|
2025-04-21 22:57:49 +08:00
|
|
|
|
using Volo.Abp.DependencyInjection;
|
2025-04-07 16:44:25 +08:00
|
|
|
|
|
2025-04-17 20:28:50 +08:00
|
|
|
|
namespace JiShe.CollectBus.IoTDB.Context
|
2025-04-07 16:44:25 +08:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// IoTDB SessionPool 运行时上下文
|
|
|
|
|
|
/// </summary>
|
2025-05-15 23:59:10 +08:00
|
|
|
|
public class IoTDBRuntimeContext: IScopedDependency//ITransientDependency
|
2025-04-07 16:44:25 +08:00
|
|
|
|
{
|
|
|
|
|
|
private readonly bool _defaultValue;
|
|
|
|
|
|
|
2025-04-21 22:57:49 +08:00
|
|
|
|
public IoTDBRuntimeContext(IOptions<IoTDbOptions> options)
|
2025-04-07 16:44:25 +08:00
|
|
|
|
{
|
|
|
|
|
|
_defaultValue = options.Value.UseTableSessionPoolByDefault;
|
|
|
|
|
|
UseTableSessionPool = _defaultValue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-04-21 09:45:30 +08:00
|
|
|
|
/// 存储模型切换标识,是否使用table模型存储, 默认为false,标识tree模型存储
|
2025-04-07 16:44:25 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool UseTableSessionPool { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 重置为默认值
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public void ResetToDefault()
|
|
|
|
|
|
{
|
|
|
|
|
|
UseTableSessionPool = _defaultValue;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|