| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- namespace Admin.NET.Plugin.AiDOP.Entity.SmartOps;
- /// <summary>
- /// ETL 执行机实例注册表。每个连本库的后端进程注册一行并定期心跳,
- /// <c>is_runner=1</c> 的那一行是当前被指派跑定时 ETL 的实例。
- ///
- /// <para><b>无租户列是刻意的</b>:实例是部署事实,不属于任何租户。
- /// 本类不实现租户过滤接口,SqlSugar 不会给它加租户条件。</para>
- ///
- /// <para><b>指派唯一性由写入侧保证</b>:置某行 <c>is_runner=1</c> 时必须在同一事务内
- /// 把其余行置 0。不要依赖前端或唯一索引——「最多一行为 1」在 MySQL 里没有
- /// 直接可用的约束表达(部分索引不支持)。</para>
- /// </summary>
- [SugarTable("ado_etl_instance", "ETL执行机实例注册")]
- public class AdoEtlInstance
- {
- [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)]
- public long Id { get; set; }
- /// <summary>形如 <c>机器名:进程ID:启动时间</c>,见 <c>AidopInstanceIdentity</c>。唯一索引。</summary>
- [SugarColumn(ColumnName = "instance_id", Length = 200)]
- public string InstanceId { get; set; } = string.Empty;
- [SugarColumn(ColumnName = "machine_name", Length = 128)]
- public string MachineName { get; set; } = string.Empty;
- [SugarColumn(ColumnName = "process_id")]
- public int ProcessId { get; set; }
- [SugarColumn(ColumnName = "app_version", Length = 64, IsNullable = true)]
- public string AppVersion { get; set; }
- /// <summary>是否被指派为执行机。**只由人工指派写入**,注册器不会自行置 1。</summary>
- [SugarColumn(ColumnName = "is_runner")]
- public bool IsRunner { get; set; }
- [SugarColumn(ColumnName = "started_at")]
- public DateTime StartedAt { get; set; }
- /// <summary>最近一次心跳。页面据此判存活,超过心跳窗口即视为已下线。</summary>
- [SugarColumn(ColumnName = "last_heartbeat_at")]
- public DateTime LastHeartbeatAt { get; set; }
- [SugarColumn(ColumnName = "create_time")]
- public DateTime CreateTime { get; set; }
- [SugarColumn(ColumnName = "update_time")]
- public DateTime UpdateTime { get; set; }
- }
|