// If received, resets the timer for the worker internal static void IAmAlive(String worker_url) { if (!WorkerManager.isFailedServer(worker_url)) { Console.WriteLine("I Am ALIVE " + worker_url + "!"); resetTimer(_timerServers[worker_url]); } else { // If the worker_url is not in the heartbeat servers it means // that it came back from failure Console.WriteLine("CAME BACK FROM FAILURE " + worker_url + "!"); } }
public WorkerRegister() { wm = new WorkerManager(); }
public bool registerWorker(string url) { bool success = WorkerManager.addServer(url); return(success); }
public bool recover(string url) { return(WorkerManager.recover(url)); }
public void status() { WorkerManager.status(); }
public bool fail(string url) { return(WorkerManager.fail(url)); }
// Freezes from the library. The master manages this situation public bool freeze(string url) { return(WorkerManager.freeze(url)); }
public string getSucessorURL(int id) { return(WorkerManager.getWorkerSucessor(id)); }
// Sets the server with the specified url with a failed state public string setFailedServer(string failed_url) { Console.WriteLine("Setting failed server : " + failed_url); return(WorkerManager.setFailedServer(failed_url)); }
public IDictionary <int, string> updateCache() { IDictionary <int, string> servers = WorkerManager.getAvailableServers(); return(servers); }