예제 #1
0
        // 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));
        }
예제 #2
0
        public static bool Status()
        {
            ILibraryComm master = (ILibraryComm)Activator.GetObject(typeof(ILibraryComm), _master_url + "LibraryComm");

            master.status();
            return(true);
        }
예제 #3
0
        // 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);
        }
예제 #4
0
        internal void updateCache()
        {
            ILibraryComm master = (ILibraryComm)Activator.GetObject(
                typeof(ILibraryComm),
                PadiDstm.Master_Url + "LibraryComm");

            _availableServers = master.updateCache();
        }
예제 #5
0
        // 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);
        }
예제 #6
0
        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;
        }
예제 #7
0
        // 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;
        }
예제 #8
0
        // 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");
            }
        }
예제 #9
0
        // 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);
        }