Example #1
0
 public ExecutorSummary(ExecutorInfo executor_info, string component_id, string host, int port, int uptime_secs) : this()
 {
     this.Executor_info = executor_info;
     this.Component_id  = component_id;
     this.Host          = host;
     this.Port          = port;
     this.Uptime_secs   = uptime_secs;
 }
Example #2
0
        public void Read(TProtocol iprot)
        {
            bool   isset_executor_info = false;
            bool   isset_component_id  = false;
            bool   isset_host          = false;
            bool   isset_port          = false;
            bool   isset_uptime_secs   = false;
            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)
                    {
                        Executor_info = new ExecutorInfo();
                        Executor_info.Read(iprot);
                        isset_executor_info = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        Component_id       = iprot.ReadString();
                        isset_component_id = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.String)
                    {
                        Host       = iprot.ReadString();
                        isset_host = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.I32)
                    {
                        Port       = iprot.ReadI32();
                        isset_port = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 5:
                    if (field.Type == TType.I32)
                    {
                        Uptime_secs       = iprot.ReadI32();
                        isset_uptime_secs = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 7:
                    if (field.Type == TType.Struct)
                    {
                        Stats = new ExecutorStats();
                        Stats.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_executor_info)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_component_id)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_host)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_port)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_uptime_secs)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
Example #3
0
        public void Read(TProtocol iprot)
        {
            bool   isset_storm_id       = false;
            bool   isset_executor_stats = false;
            bool   isset_time_secs      = false;
            bool   isset_uptime_secs    = false;
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.String)
                    {
                        Storm_id       = iprot.ReadString();
                        isset_storm_id = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.Map)
                    {
                        {
                            Executor_stats = new Dictionary <ExecutorInfo, ExecutorStats>();
                            TMap _map312 = iprot.ReadMapBegin();
                            for (int _i313 = 0; _i313 < _map312.Count; ++_i313)
                            {
                                ExecutorInfo  _key314;
                                ExecutorStats _val315;
                                _key314 = new ExecutorInfo();
                                _key314.Read(iprot);
                                _val315 = new ExecutorStats();
                                _val315.Read(iprot);
                                Executor_stats[_key314] = _val315;
                            }
                            iprot.ReadMapEnd();
                        }
                        isset_executor_stats = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.I32)
                    {
                        Time_secs       = iprot.ReadI32();
                        isset_time_secs = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.I32)
                    {
                        Uptime_secs       = iprot.ReadI32();
                        isset_uptime_secs = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_storm_id)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_executor_stats)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_time_secs)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_uptime_secs)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
        public void Read(TProtocol iprot)
        {
            bool   isset_topology_id = false;
            bool   isset_executors   = false;
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.String)
                    {
                        Topology_id       = iprot.ReadString();
                        isset_topology_id = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.List)
                    {
                        {
                            Executors = new List <ExecutorInfo>();
                            TList _list322 = iprot.ReadListBegin();
                            for (int _i323 = 0; _i323 < _list322.Count; ++_i323)
                            {
                                ExecutorInfo _elem324 = new ExecutorInfo();
                                _elem324 = new ExecutorInfo();
                                _elem324.Read(iprot);
                                Executors.Add(_elem324);
                            }
                            iprot.ReadListEnd();
                        }
                        isset_executors = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.Struct)
                    {
                        Resources = new WorkerResources();
                        Resources.Read(iprot);
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_topology_id)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_executors)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }
Example #5
0
        public void Read(TProtocol iprot)
        {
            bool   isset_time_secs   = false;
            bool   isset_topology_id = false;
            bool   isset_executors   = false;
            bool   isset_port        = false;
            TField field;

            iprot.ReadStructBegin();
            while (true)
            {
                field = iprot.ReadFieldBegin();
                if (field.Type == TType.Stop)
                {
                    break;
                }
                switch (field.ID)
                {
                case 1:
                    if (field.Type == TType.I32)
                    {
                        Time_secs       = iprot.ReadI32();
                        isset_time_secs = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 2:
                    if (field.Type == TType.String)
                    {
                        Topology_id       = iprot.ReadString();
                        isset_topology_id = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 3:
                    if (field.Type == TType.List)
                    {
                        {
                            Executors = new List <ExecutorInfo>();
                            TList _list336 = iprot.ReadListBegin();
                            for (int _i337 = 0; _i337 < _list336.Count; ++_i337)
                            {
                                ExecutorInfo _elem338 = new ExecutorInfo();
                                _elem338 = new ExecutorInfo();
                                _elem338.Read(iprot);
                                Executors.Add(_elem338);
                            }
                            iprot.ReadListEnd();
                        }
                        isset_executors = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                case 4:
                    if (field.Type == TType.I32)
                    {
                        Port       = iprot.ReadI32();
                        isset_port = true;
                    }
                    else
                    {
                        TProtocolUtil.Skip(iprot, field.Type);
                    }
                    break;

                default:
                    TProtocolUtil.Skip(iprot, field.Type);
                    break;
                }
                iprot.ReadFieldEnd();
            }
            iprot.ReadStructEnd();
            if (!isset_time_secs)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_topology_id)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_executors)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
            if (!isset_port)
            {
                throw new TProtocolException(TProtocolException.INVALID_DATA);
            }
        }