Esempio n. 1
0
 /*
  * return the task that run the command on the node with seq# not changed.
  * if the command are considered as in the same group, they should use this to start the transaction.
  */
 private Task <string> StartCmdGroupTransaction(IMachineInfo machine, string command)
 {
     return(Task.Run(() => {
         var trx = GammaClientTXFactory.GetCmdExecTX(machine, command);
         GammaClientTXLogger.GetInstance().RegisterTransaction(trx);
         AddTransaction(trx, seq);
         return StartTransaction(trx, machine, command);
     }));
 }
Esempio n. 2
0
        internal static GammaClientTransaction GetCmdExecTX(IMachineInfo machine, string command)
        {
            var trx = new GammaClientTransaction()
            {
                Machine        = machine.MachineName,
                TX_TYPE        = GammaTransactionType.COMMAND,
                TX_CONTENT     = command,
                TX_RESULT      = string.Empty,
                TX_RESULT_CODE = GammaTransactionRC.RUNNING,
            };

            GammaClientTXLogger.GetInstance().RegisterTransaction(trx);
            return(trx);
        }
Esempio n. 3
0
        internal static GammaClientTransaction GetClearEnvTX(IMachineInfo machine, GammaTXClearEnv op_code)
        {
            var trx = new GammaClientTransaction()
            {
                Machine        = machine.MachineName,
                TX_TYPE        = GammaTransactionType.CLEARENV,
                TX_SUB_TYPE    = (int)op_code,
                TX_CONTENT     = string.Empty,
                TX_RESULT      = string.Empty,
                TX_RESULT_CODE = GammaTransactionRC.RUNNING,
            };

            GammaClientTXLogger.GetInstance().RegisterTransaction(trx);
            return(trx);
        }
Esempio n. 4
0
        internal static GammaClientTransaction GetCmdExecTX(IMachineInfo machine, string[] command)
        {
            var sb = new StringBuilder();

            foreach (var cmd in command)
            {
                sb.AppendFormat("{0};", cmd);
            }
            var trx = new GammaClientTransaction()
            {
                Machine        = machine.MachineName,
                TX_TYPE        = GammaTransactionType.COMMAND,
                TX_CONTENT     = sb.ToString(),
                TX_RESULT      = string.Empty,
                TX_RESULT_CODE = GammaTransactionRC.RUNNING,
            };

            GammaClientTXLogger.GetInstance().RegisterTransaction(trx);
            return(trx);
        }