Пример #1
0
        public Task(Task otherTask)
            : base(otherTask)
        {
            if (otherTask.OutputParams != null)
                OutputParams = new Dictionary<string, string>(otherTask.OutputParams);

            if (otherTask.PackageEngineState != null)
                this.PackageEngineState = (PackageEngineState) otherTask.PackageEngineState.Clone();

            Time = new TaskTimeMeasurement(otherTask.Time);
            Incarnation = new IncarnationParams(otherTask.Incarnation);

            if (otherTask.Estimations != null)
                Estimations = new Dictionary<string, double>(otherTask.Estimations);

            CurrentSchedule = null;
            if (otherTask.CurrentSchedule != null)
            {
                CurrentSchedule = new TaskSchedule(otherTask.CurrentSchedule);

                // immutable:
                this.AssignedResource = otherTask.AssignedResource;
                this.AssignedNodes = otherTask.AssignedNodes;
            }

            State = otherTask.State;

            _inputsProcessed = otherTask._inputsProcessed;
            _inputsProcessingError = otherTask._inputsProcessingError;

            _failReason = otherTask._failReason;
            if (otherTask._lastEvent != null && otherTask._lastEvent.HasValue)
                _lastEvent = otherTask._lastEvent.Value;
        }
Пример #2
0
        public Task(TaskDescription description)
            : base(description)
        {
            if (Priority == TaskPriority.Urgent)
            {
                if (!ExecParams.ContainsKey("MinTime"))
                    ExecParams["MinTime"] = "0";

                if (!ExecParams.ContainsKey("MaxTime"))
                    ExecParams["MaxTime"] = ExecParams["MinTime"];
            }

            OutputParams = new Dictionary<string, string>();

            Time = new TaskTimeMeasurement();
            Time.Started(TaskTimeMetric.Postponed);
            if (this.IsFake())
                Time.Edge(started: TaskTimeMetric.Queued, finished: TaskTimeMetric.Postponed);

            Estimations = null;
            CurrentSchedule = null;
            Incarnation = new IncarnationParams();

            State = TaskState.Defined;

            string stepName = ExecParams.ContainsKey("StepName")? ExecParams["StepName"]: null;
            string storageRoot = IOProxy.Storage.BuildPath(UserId, WfId, stepId: TaskId.ToString(), stepName: stepName);
            this.PackageEngineState = new PackageEngineState(description, storageRoot); // todo : measure PackageEngineState expenses
        }
Пример #3
0
        public TaskTimeMeasurement(TaskTimeMeasurement other)
            : this()
        {
            if (other._overheads != null)
                this._overheads = new Dictionary<TaskTimeOverheads, TimeSpan>(other._overheads);

            if (other._overheadsActionCount != null)
                this._overheadsActionCount = new Dictionary<TaskTimeOverheads, int>(other._overheadsActionCount);

            if (other.OverheadsSpecial != null)
                this.OverheadsSpecial = new Dictionary<string, TimeSpan>(other.OverheadsSpecial);

            if (other.WhenStarted != null)
                this.WhenStarted = new Dictionary<TaskTimeMetric, DateTime>(other.WhenStarted);

            if (other.WhenFinished != null)
                this.WhenFinished = new Dictionary<TaskTimeMetric, DateTime>(other.WhenFinished);

            /*
            if (other.EstimatedStart != null)
                this.EstimatedStart = other.EstimatedStart;

            if (other.EstimatedFinish != null)
                this.EstimatedFinish = other.EstimatedFinish;
            */
        }
Пример #4
0
        public Task(Task otherTask)
            : base(otherTask)
        {
            if (otherTask.OutputParams != null)
            {
                OutputParams = new Dictionary <string, string>(otherTask.OutputParams);
            }

            if (otherTask.PackageEngineState != null)
            {
                this.PackageEngineState = (PackageEngineState)otherTask.PackageEngineState.Clone();
            }

            Time        = new TaskTimeMeasurement(otherTask.Time);
            Incarnation = new IncarnationParams(otherTask.Incarnation);

            if (otherTask.Estimations != null)
            {
                Estimations = new Dictionary <string, double>(otherTask.Estimations);
            }

            CurrentSchedule = null;
            if (otherTask.CurrentSchedule != null)
            {
                CurrentSchedule = new TaskSchedule(otherTask.CurrentSchedule);

                // immutable:
                this.AssignedResource = otherTask.AssignedResource;
                this.AssignedNodes    = otherTask.AssignedNodes;
            }

            State = otherTask.State;

            _inputsProcessed       = otherTask._inputsProcessed;
            _inputsProcessingError = otherTask._inputsProcessingError;

            _failReason = otherTask._failReason;
            if (otherTask._lastEvent != null && otherTask._lastEvent.HasValue)
            {
                _lastEvent = otherTask._lastEvent.Value;
            }
        }
Пример #5
0
        public TaskTimeMeasurement(TaskTimeMeasurement other)
            : this()
        {
            if (other._overheads != null)
            {
                this._overheads = new Dictionary <TaskTimeOverheads, TimeSpan>(other._overheads);
            }

            if (other._overheadsActionCount != null)
            {
                this._overheadsActionCount = new Dictionary <TaskTimeOverheads, int>(other._overheadsActionCount);
            }

            if (other.OverheadsSpecial != null)
            {
                this.OverheadsSpecial = new Dictionary <string, TimeSpan>(other.OverheadsSpecial);
            }

            if (other.WhenStarted != null)
            {
                this.WhenStarted = new Dictionary <TaskTimeMetric, DateTime>(other.WhenStarted);
            }

            if (other.WhenFinished != null)
            {
                this.WhenFinished = new Dictionary <TaskTimeMetric, DateTime>(other.WhenFinished);
            }

            /*
             * if (other.EstimatedStart != null)
             *  this.EstimatedStart = other.EstimatedStart;
             *
             * if (other.EstimatedFinish != null)
             *  this.EstimatedFinish = other.EstimatedFinish;
             */
        }
Пример #6
0
        public Task(TaskDescription description)
            : base(description)
        {
            if (Priority == TaskPriority.Urgent)
            {
                if (!ExecParams.ContainsKey("MinTime"))
                {
                    ExecParams["MinTime"] = "0";
                }

                if (!ExecParams.ContainsKey("MaxTime"))
                {
                    ExecParams["MaxTime"] = ExecParams["MinTime"];
                }
            }

            OutputParams = new Dictionary <string, string>();

            Time = new TaskTimeMeasurement();
            Time.Started(TaskTimeMetric.Postponed);
            if (this.IsFake())
            {
                Time.Edge(started: TaskTimeMetric.Queued, finished: TaskTimeMetric.Postponed);
            }

            Estimations     = null;
            CurrentSchedule = null;
            Incarnation     = new IncarnationParams();

            State = TaskState.Defined;

            string stepName    = ExecParams.ContainsKey("StepName")? ExecParams["StepName"]: null;
            string storageRoot = IOProxy.Storage.BuildPath(UserId, WfId, stepId: TaskId.ToString(), stepName: stepName);

            this.PackageEngineState = new PackageEngineState(description, storageRoot); // todo : measure PackageEngineState expenses
        }