예제 #1
0
 public void Add(int id, XComputeProcess proc)
 {
     lock (tableLock)
     {
         this.processTable.Add(id, proc);
     }
 }
예제 #2
0
 public void Add(int id, XComputeProcess proc)
 {
     lock (tableLock)
     {
         this.processTable.Add(id, proc);
     }
 }
예제 #3
0
        private void Initialize()
        {
            if (IsVertexRerun)
            {
                // Vertex rerun command is being executed, don't create any dispatchers
                return;
            }
            else if (IsGraphManager)
            {
                VertexChangeEventHandler evtHandler = new VertexChangeEventHandler(OnVertexChanged);
                schedulerHelper.OnVertexChange += evtHandler;
                schedulerHelper.StartTaskMonitorThread();

                if (!schedulerHelper.WaitForTasksReady())
                {
                    // The graph manager will abort because we will not return any vertex nodes
                    DryadLogger.LogCritical(0, null, "Unable to begin job: too many vertex tasks failed");
                    schedulerHelper.OnVertexChange -= evtHandler;
                    dispatcherPool.Clear();
                    return;
                }

                // TODO: we need to be able to turn this off
                //ThreadPool.QueueUserWorkItem(new WaitCallback(VertexMonitorThreadFunc));
            }
            // IsVertex
            else
            {
                // On vertex nodes, create a dispatcher for the local vertex service and add an entry to the process table for the local process
                Dispatcher d = AddDispatcher(Int32.Parse(Environment.GetEnvironmentVariable(Constants.taskIdEnvVar)), "localhost", VertexTaskState.Running);
                XComputeProcess proc = new XComputeProcess(processId);
                lock (proc.SyncRoot)
                {
                    proc.Dispatcher = d;
                }

                this.processTable.Add(processId, proc);
            }
            callbackServiceHost.Start(this.baseUri, this.schedulerHelper);
        }
예제 #4
0
 public void CreateVertexProcess(int processId)
 {
     XComputeProcess proc = new XComputeProcess(processId);
     this.processTable.Add(processId, proc);
     proc.ChangeState(ProcessState.Unscheduled);
 }
예제 #5
0
 public bool TryGetValue(int id, out XComputeProcess proc)
 {
     return this.processTable.TryGetValue(id, out proc);
 }
예제 #6
0
 public bool TryGetValue(int id, out XComputeProcess proc)
 {
     return(this.processTable.TryGetValue(id, out proc));
 }