Пример #1
0
        /// <summary>
        /// construct a new Computer object
        /// </summary>
        /// <param name="n">the unique name of the daemon</param>
        /// <param name="host">the computer the daemon is running on</param>
        /// <param name="rn">the rack the daemon is running on</param>
        /// <param name="rack">the scheduling queue associated with the computer's rack</param>
        /// <param name="cluster">the global scheduling queue associated with the cluster</param>
        /// <param name="pServer">the address of the daemon's http server for process scheduling</param>
        /// <param name="fServer">the address of the daemon's http server for file proxying</param>
        /// <param name="directory">the daemon's local directory</param>
        /// <param name="log">connection to the logging subsystem</param>
        public Computer(string n, string host, string rn, ProcessQueue rack, ProcessQueue cluster,
                        string pServer, string fServer, string directory, ClusterInterface.ILogger log)
        {
            logger         = log;
            name           = n;
            localDirectory = directory;
            processServer  = pServer;
            fileServer     = fServer;
            computerName   = host;
            rackName       = rn;
            localQueue     = new ProcessQueue();
            rackQueue      = rack;
            clusterQueue   = cluster;

            logger.Log("Created computer " + name + " on host " + computerName + ":" + rackName + ":" + localDirectory + ":" + fileServer);

            // make the Task that CommandLoop blocks on; when finishWaiter is started it returns null
            // causing CommandLoop to exit.
            finishWaiter       = new TaskCompletionSource <Process>();
            childFinishWaiters = new HashSet <TaskCompletionSource <Process> >();
            finishWaiter.Task.ContinueWith((t) => Task.Run(() => SetChildFinishWaiters()));

            // this is started when the Command Loop exits
            exited = new TaskCompletionSource <bool>();

            nextTask = 1;
        }
Пример #2
0
        public LocalScheduler(ClusterInterface.ILogger l)
        {
            logger = l;

            computers = new Dictionary<string, Computer>();
            localities = new Dictionary<string, List<Computer>>();
            racks = new Dictionary<string, Rack>();
            clusterQueue = new ProcessQueue();

            flusher = new Task(() => { });

            clusterInterface = new PeloponneseInterface();

            dummyCancelComputer = new Computer("dummy for canceling", "nowhere", "no rack", null, null,
                                               "no server", "no server", "no directory", logger);

            l.Log("LocalScheduler created");
        }
Пример #3
0
        public LocalScheduler(ClusterInterface.ILogger l)
        {
            logger = l;

            computers    = new Dictionary <string, Computer>();
            localities   = new Dictionary <string, List <Computer> >();
            racks        = new Dictionary <string, Rack>();
            clusterQueue = new ProcessQueue();

            flusher = new Task(() => { });

            clusterInterface = new PeloponneseInterface();

            dummyCancelComputer = new Computer("dummy for canceling", "nowhere", "no rack", null, null,
                                               "no server", "no server", "no directory", logger);

            l.Log("LocalScheduler created");
        }
Пример #4
0
 public Rack()
 {
     computers = new HashSet <string>();
     queue     = new ProcessQueue();
 }