public StormBase(string name, TopologyStatus status, int num_workers) : this() { this.Name = name; this.Status = status; this.Num_workers = num_workers; }
public void Read (TProtocol iprot) { bool isset_name = false; bool isset_status = false; bool isset_num_workers = 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) { Name = iprot.ReadString(); isset_name = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.I32) { Status = (TopologyStatus)iprot.ReadI32(); isset_status = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 3: if (field.Type == TType.I32) { Num_workers = iprot.ReadI32(); isset_num_workers = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 4: if (field.Type == TType.Map) { { Component_executors = new Dictionary<string, int>(); TMap _map208 = iprot.ReadMapBegin(); for( int _i209 = 0; _i209 < _map208.Count; ++_i209) { string _key210; int _val211; _key210 = iprot.ReadString(); _val211 = iprot.ReadI32(); Component_executors[_key210] = _val211; } iprot.ReadMapEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 5: if (field.Type == TType.I32) { Launch_time_secs = iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 6: if (field.Type == TType.String) { Owner = iprot.ReadString(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 7: if (field.Type == TType.Struct) { Topology_action_options = new TopologyActionOptions(); Topology_action_options.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 8: if (field.Type == TType.I32) { Prev_status = (TopologyStatus)iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); if (!isset_name) throw new TProtocolException(TProtocolException.INVALID_DATA); if (!isset_status) throw new TProtocolException(TProtocolException.INVALID_DATA); if (!isset_num_workers) throw new TProtocolException(TProtocolException.INVALID_DATA); }
public void Read(TProtocol iprot) { bool isset_name = false; bool isset_status = false; bool isset_num_workers = 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) { Name = iprot.ReadString(); isset_name = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.I32) { Status = (TopologyStatus)iprot.ReadI32(); isset_status = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 3: if (field.Type == TType.I32) { Num_workers = iprot.ReadI32(); isset_num_workers = true; } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 4: if (field.Type == TType.Map) { { Component_executors = new Dictionary <string, int>(); TMap _map208 = iprot.ReadMapBegin(); for (int _i209 = 0; _i209 < _map208.Count; ++_i209) { string _key210; int _val211; _key210 = iprot.ReadString(); _val211 = iprot.ReadI32(); Component_executors[_key210] = _val211; } iprot.ReadMapEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 5: if (field.Type == TType.I32) { Launch_time_secs = iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 6: if (field.Type == TType.String) { Owner = iprot.ReadString(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 7: if (field.Type == TType.Struct) { Topology_action_options = new TopologyActionOptions(); Topology_action_options.Read(iprot); } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 8: if (field.Type == TType.I32) { Prev_status = (TopologyStatus)iprot.ReadI32(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); if (!isset_name) { throw new TProtocolException(TProtocolException.INVALID_DATA); } if (!isset_status) { throw new TProtocolException(TProtocolException.INVALID_DATA); } if (!isset_num_workers) { throw new TProtocolException(TProtocolException.INVALID_DATA); } }