Beispiel #1
0
        /// <summary>
        /// 作业配置更新处理
        /// </summary>
        /// <param name="jobConfig">Job config.</param>
        /// <param name="cancellationToken">Cancellation token.</param>
        private void OnJobConfigUpdate(JobConfig jobConfig, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            if (Cluster.Manager != null && Cluster.Manager.Id != Id)
            {
                // 检查版本,如果发生变化,则下载作业包
                EnsureJobPackage(jobConfig.Name, jobConfig.Version, cancellationToken);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 作业配置删除处理
        /// </summary>
        /// <param name="jobConfig">Job config.</param>
        /// <param name="cancellationToken">Cancellation token.</param>
        private void OnJobConfigRemove(JobConfig jobConfig, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            if (Cluster.Manager != null && Cluster.Manager.Id != Id)
            {
                // 移除作业包
                RemoveJobConfig(jobConfig, cancellationToken);
            }
        }
Beispiel #3
0
 /// <summary>
 /// 从其他实例复制相关字段的值
 /// </summary>
 /// <param name="config"></param>
 public void CopyFieldFrom(JobConfig config)
 {
     Name                       = config.Name;
     LastRecordId               = config.LastRecordId;
     LastRecordCreateTime       = config.LastRecordCreateTime;
     Name                       = config.Name;
     FileName                   = config.FileName;
     ExeType                    = config.ExeType;
     JobClassName               = config.JobClassName;
     RunTimePlan                = config.RunTimePlan;
     RunTimes                   = config.RunTimes;
     Version                    = config.Version;
     MemberUnavailableThreshold = config.MemberUnavailableThreshold;
     TaskExecuteTimeout         = config.TaskExecuteTimeout;
     JobSplitTimeout            = config.JobSplitTimeout;
     TaskResultCollectTimeout   = config.TaskResultCollectTimeout;
 }
Beispiel #4
0
 /// <summary>
 /// 移除作业
 /// </summary>
 /// <param name="jobConfig">Job config.</param>
 private void RemoveJobConfig(JobConfig jobConfig, CancellationToken cancellationToken)
 {
     Cluster.RemoveJobConfig(jobConfig, cancellationToken);
 }