Exemple #1
0
    public void Read(TProtocol iprot)
    {
        TField field;

        iprot.ReadStructBegin();
        while (true)
        {
            field = iprot.ReadFieldBegin();
            if (field.Type == TType.Stop)
            {
                break;
            }
            switch (field.ID)
            {
            case 1:
                if (field.Type == TType.Struct)
                {
                    Kill_options = new KillOptions();
                    Kill_options.Read(iprot);
                }
                else
                {
                    TProtocolUtil.Skip(iprot, field.Type);
                }
                break;

            case 2:
                if (field.Type == TType.Struct)
                {
                    Rebalance_options = new RebalanceOptions();
                    Rebalance_options.Read(iprot);
                }
                else
                {
                    TProtocolUtil.Skip(iprot, field.Type);
                }
                break;

            default:
                TProtocolUtil.Skip(iprot, field.Type);
                break;
            }
            iprot.ReadFieldEnd();
        }
        iprot.ReadStructEnd();
    }
        public static int Execute(KillOptions opts)
        {
            var _defaultColor = Console.ForegroundColor;

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Stopping the receive listener...");
            Console.ForegroundColor = _defaultColor;

            // Read pid from external file
            var pid = File.ReadAllText(".pid");

            // Kill process
            var process = Process.GetProcessById(int.Parse(pid));

            process.Kill();

            // Remove remaining external file
            File.Delete(".pid");

            return(0);
        }
 public void Read (TProtocol iprot)
 {
   TField field;
   iprot.ReadStructBegin();
   while (true)
   {
     field = iprot.ReadFieldBegin();
     if (field.Type == TType.Stop) { 
       break;
     }
     switch (field.ID)
     {
       case 1:
         if (field.Type == TType.Struct) {
           Kill_options = new KillOptions();
           Kill_options.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       case 2:
         if (field.Type == TType.Struct) {
           Rebalance_options = new RebalanceOptions();
           Rebalance_options.Read(iprot);
         } else { 
           TProtocolUtil.Skip(iprot, field.Type);
         }
         break;
       default: 
         TProtocolUtil.Skip(iprot, field.Type);
         break;
     }
     iprot.ReadFieldEnd();
   }
   iprot.ReadStructEnd();
 }
Exemple #4
0
 public void send_killTopologyWithOpts(string name, KillOptions options)
 #endif
 {
   oprot_.WriteMessageBegin(new TMessage("killTopologyWithOpts", TMessageType.Call, seqid_));
   killTopologyWithOpts_args args = new killTopologyWithOpts_args();
   args.Name = name;
   args.Options = options;
   args.Write(oprot_);
   oprot_.WriteMessageEnd();
   #if SILVERLIGHT
   return oprot_.Transport.BeginFlush(callback, state);
   #else
   oprot_.Transport.Flush();
   #endif
 }
Exemple #5
0
 public IAsyncResult send_killTopologyWithOpts(AsyncCallback callback, object state, string name, KillOptions options)
Exemple #6
0
    public void killTopologyWithOpts(string name, KillOptions options)
    {
      #if !SILVERLIGHT
      send_killTopologyWithOpts(name, options);
      recv_killTopologyWithOpts();

      #else
      var asyncResult = Begin_killTopologyWithOpts(null, null, name, options);
      End_killTopologyWithOpts(asyncResult);

      #endif
    }
Exemple #7
0
 public IAsyncResult Begin_killTopologyWithOpts(AsyncCallback callback, object state, string name, KillOptions options)
 {
   return send_killTopologyWithOpts(callback, state, name, options);
 }