Ejemplo n.º 1
0
Archivo: Task.cs Proyecto: japj/vulcan
 protected Task(AstTaskNode astNode)
     : base(astNode)
 {
     DelayValidation = astNode.DelayValidation;
     switch (astNode.IsolationLevel)
     {
         case IsolationLevel.Chaos:
             TaskIsolationLevel = System.Data.IsolationLevel.Chaos;
             break;
         case IsolationLevel.ReadCommitted:
             TaskIsolationLevel = System.Data.IsolationLevel.ReadCommitted;
             break;
         case IsolationLevel.ReadUncommitted:
             TaskIsolationLevel = System.Data.IsolationLevel.ReadUncommitted;
             break;
         case IsolationLevel.RepeatableRead:
             TaskIsolationLevel = System.Data.IsolationLevel.RepeatableRead;
             break;
         case IsolationLevel.Serializable:
             TaskIsolationLevel = System.Data.IsolationLevel.Serializable;
             break;
         case IsolationLevel.Snapshot:
             TaskIsolationLevel = System.Data.IsolationLevel.Snapshot;
             break;
         case IsolationLevel.Unspecified:
             TaskIsolationLevel = System.Data.IsolationLevel.Unspecified;
             break;
         default:
             TaskIsolationLevel = System.Data.IsolationLevel.Serializable;
             break;
     }
 }
Ejemplo n.º 2
0
        public static void LowerEventHandlers(AstTask.AstTaskNode astTaskNode, Executable parentExecutable, LoweringContext context)
        {
            foreach (AstTask.AstTaskEventHandlerNode astTaskEventHandler in astTaskNode.Events)
            {
                PhysicalTask.EventHandler e = new IR.Tasks.EventHandler(astTaskEventHandler, parentExecutable);
                context.ParentObject.Children.Add(e);

                foreach (AstTask.AstTaskNode task in astTaskEventHandler.Tasks)
                {
                    context = new TaskLoweringContext(e);
                    PhysicalLoweringProcessor.Lower(task, context);
                }
            }
        }
Ejemplo n.º 3
0
        private static HashSet<AstTaskNode> FindPredecessors(AstTask.AstContainerTaskNode container, AstTaskNode task, AstTaskNode previousTask, Dictionary<AstTaskNode, ICollection<AstTaskNode>> successors)
        {
            var predecessors = new HashSet<AstTaskNode>();

            if (task.PrecedenceConstraints != null)
            {
                foreach (var input in task.PrecedenceConstraints.Inputs)
                {
                    if (input.OutputPath != null)
                    {
                        var predecessorNode = input.OutputPath.ParentItem as AstTaskNode;
                        predecessors.Add(predecessorNode);
                    }
                }
            }

            //if (containerTask != null && containerTask.ConstraintMode == ContainerConstraintMode.Linear && predecessors.Count == 0 && previousTask != null)
            if (container.ConstraintMode == ContainerConstraintMode.Linear && predecessors.Count == 0 && previousTask != null)
            {
                predecessors.Add(previousTask);
            }

            return predecessors;
        }