// Tell master the server freezed public static bool Freeze(string url) { ILibraryComm master = (ILibraryComm)Activator.GetObject( typeof(ILibraryComm), _master_url + "LibraryComm"); return(master.freeze(url)); }
public static bool Status() { ILibraryComm master = (ILibraryComm)Activator.GetObject(typeof(ILibraryComm), _master_url + "LibraryComm"); master.status(); return(true); }
// Tell master the server failed public static bool Fail(string url) { ILibraryComm master = (ILibraryComm)Activator.GetObject(typeof(ILibraryComm), _master_url + "LibraryComm"); master.fail(url); return(true); }
internal void updateCache() { ILibraryComm master = (ILibraryComm)Activator.GetObject( typeof(ILibraryComm), PadiDstm.Master_Url + "LibraryComm"); _availableServers = master.updateCache(); }
// Tell master the master to recover the server public static bool Recover(string url) { ILibraryComm master = (ILibraryComm)Activator.GetObject( typeof(ILibraryComm), _master_url + "LibraryComm"); bool success = master.recover(url); return(success); }
internal Transaction(TcpChannel channel) { this.channel = channel; // aquire an unique transaction ID ILibraryComm master = (ILibraryComm)Activator.GetObject( typeof(ILibraryComm), PadiDstm.Master_Url + "LibraryComm"); _txID = master.getTxID(); // placeholder debug message Console.WriteLine("Started new transaction with id : " + _txID); // set the state of the transaction to ACTIVE State = TransactionState.ACTIVE; }
// Tell Master to kill the server internal void onTimeFail(object source, ElapsedEventArgs e, string server_url) { Console.WriteLine("Server " + server_url + " Died!"); _timer.Enabled = false; _timer.AutoReset = false; ILibraryComm master = (ILibraryComm)Activator.GetObject( typeof(ILibraryComm), PadiDstm.Master_Url + "LibraryComm"); failed_lock = true; master.fail(server_url); State = TransactionState.ABORTED; PadiDstm.Servers.updateCache(); failed_lock = false; }
// Manage the failure, the Master alters the sucessors of this class internal static void manageFailedServer(string failed_url) { Console.WriteLine("INSIDE CATCH IN DATASTORE!!!"); string sucessor_url; ILibraryComm master = (ILibraryComm)Activator.GetObject( typeof(ILibraryComm), Datastore.MASTER + "LibraryComm"); sucessor_url = master.setFailedServer(failed_url); // Server failed if (sucessor_url == null) { Console.WriteLine("ERROR: THERE ARE NO SERVERS THAT HAVE THE REQUESTED PADINT"); } }
// Returns the server url that has the requested UID objects (Sucessor) public static string manageFailedServer(string failed_url, int serverNumber) { string sucessor_url; ILibraryComm master = (ILibraryComm)Activator.GetObject( typeof(ILibraryComm), _master_url + "LibraryComm"); sucessor_url = master.setFailedServer(failed_url); // Server failed if (sucessor_url == null) { Console.WriteLine("ERROR: THERE ARE NO SERVERS THAT HAVE THE REQUESTED PADINT"); _transaction.State = TransactionState.ABORTED; } Servers.AvailableServers[serverNumber] = sucessor_url; return(sucessor_url); }