| /** |
| * Autogenerated by Thrift Compiler (0.9.2) |
| * |
| * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING |
| * @generated |
| */ |
| package backtype.storm.generated; |
| |
| import org.apache.thrift.scheme.IScheme; |
| import org.apache.thrift.scheme.SchemeFactory; |
| import org.apache.thrift.scheme.StandardScheme; |
| |
| import org.apache.thrift.scheme.TupleScheme; |
| import org.apache.thrift.protocol.TTupleProtocol; |
| import org.apache.thrift.protocol.TProtocolException; |
| import org.apache.thrift.EncodingUtils; |
| import org.apache.thrift.TException; |
| import org.apache.thrift.async.AsyncMethodCallback; |
| import org.apache.thrift.server.AbstractNonblockingServer.*; |
| import java.util.List; |
| import java.util.ArrayList; |
| import java.util.Map; |
| import java.util.HashMap; |
| import java.util.EnumMap; |
| import java.util.Set; |
| import java.util.HashSet; |
| import java.util.EnumSet; |
| import java.util.Collections; |
| import java.util.BitSet; |
| import java.nio.ByteBuffer; |
| import java.util.Arrays; |
| import javax.annotation.Generated; |
| import org.slf4j.Logger; |
| import org.slf4j.LoggerFactory; |
| |
| @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) |
| @Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-10-20") |
| public class SupervisorSummary implements org.apache.thrift.TBase<SupervisorSummary, SupervisorSummary._Fields>, java.io.Serializable, Cloneable, Comparable<SupervisorSummary> { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SupervisorSummary"); |
| |
| private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)1); |
| private static final org.apache.thrift.protocol.TField SUPERVISOR_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("supervisorId", org.apache.thrift.protocol.TType.STRING, (short)2); |
| private static final org.apache.thrift.protocol.TField UPTIME_SECS_FIELD_DESC = new org.apache.thrift.protocol.TField("uptimeSecs", org.apache.thrift.protocol.TType.I32, (short)3); |
| private static final org.apache.thrift.protocol.TField NUM_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("numWorkers", org.apache.thrift.protocol.TType.I32, (short)4); |
| private static final org.apache.thrift.protocol.TField NUM_USED_WORKERS_FIELD_DESC = new org.apache.thrift.protocol.TField("numUsedWorkers", org.apache.thrift.protocol.TType.I32, (short)5); |
| |
| private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); |
| static { |
| schemes.put(StandardScheme.class, new SupervisorSummaryStandardSchemeFactory()); |
| schemes.put(TupleScheme.class, new SupervisorSummaryTupleSchemeFactory()); |
| } |
| |
| private String host; // required |
| private String supervisorId; // required |
| private int uptimeSecs; // required |
| private int numWorkers; // required |
| private int numUsedWorkers; // required |
| |
| /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ |
| public enum _Fields implements org.apache.thrift.TFieldIdEnum { |
| HOST((short)1, "host"), |
| SUPERVISOR_ID((short)2, "supervisorId"), |
| UPTIME_SECS((short)3, "uptimeSecs"), |
| NUM_WORKERS((short)4, "numWorkers"), |
| NUM_USED_WORKERS((short)5, "numUsedWorkers"); |
| |
| private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); |
| |
| static { |
| for (_Fields field : EnumSet.allOf(_Fields.class)) { |
| byName.put(field.getFieldName(), field); |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, or null if its not found. |
| */ |
| public static _Fields findByThriftId(int fieldId) { |
| switch(fieldId) { |
| case 1: // HOST |
| return HOST; |
| case 2: // SUPERVISOR_ID |
| return SUPERVISOR_ID; |
| case 3: // UPTIME_SECS |
| return UPTIME_SECS; |
| case 4: // NUM_WORKERS |
| return NUM_WORKERS; |
| case 5: // NUM_USED_WORKERS |
| return NUM_USED_WORKERS; |
| default: |
| return null; |
| } |
| } |
| |
| /** |
| * Find the _Fields constant that matches fieldId, throwing an exception |
| * if it is not found. |
| */ |
| public static _Fields findByThriftIdOrThrow(int fieldId) { |
| _Fields fields = findByThriftId(fieldId); |
| if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); |
| return fields; |
| } |
| |
| /** |
| * Find the _Fields constant that matches name, or null if its not found. |
| */ |
| public static _Fields findByName(String name) { |
| return byName.get(name); |
| } |
| |
| private final short _thriftId; |
| private final String _fieldName; |
| |
| _Fields(short thriftId, String fieldName) { |
| _thriftId = thriftId; |
| _fieldName = fieldName; |
| } |
| |
| public short getThriftFieldId() { |
| return _thriftId; |
| } |
| |
| public String getFieldName() { |
| return _fieldName; |
| } |
| } |
| |
| // isset id assignments |
| private static final int __UPTIMESECS_ISSET_ID = 0; |
| private static final int __NUMWORKERS_ISSET_ID = 1; |
| private static final int __NUMUSEDWORKERS_ISSET_ID = 2; |
| private byte __isset_bitfield = 0; |
| public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; |
| static { |
| Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); |
| tmpMap.put(_Fields.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| tmpMap.put(_Fields.SUPERVISOR_ID, new org.apache.thrift.meta_data.FieldMetaData("supervisorId", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); |
| tmpMap.put(_Fields.UPTIME_SECS, new org.apache.thrift.meta_data.FieldMetaData("uptimeSecs", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); |
| tmpMap.put(_Fields.NUM_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("numWorkers", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); |
| tmpMap.put(_Fields.NUM_USED_WORKERS, new org.apache.thrift.meta_data.FieldMetaData("numUsedWorkers", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); |
| metaDataMap = Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SupervisorSummary.class, metaDataMap); |
| } |
| |
| public SupervisorSummary() { |
| } |
| |
| public SupervisorSummary( |
| String host, |
| String supervisorId, |
| int uptimeSecs, |
| int numWorkers, |
| int numUsedWorkers) |
| { |
| this(); |
| this.host = host; |
| this.supervisorId = supervisorId; |
| this.uptimeSecs = uptimeSecs; |
| set_uptimeSecs_isSet(true); |
| this.numWorkers = numWorkers; |
| set_numWorkers_isSet(true); |
| this.numUsedWorkers = numUsedWorkers; |
| set_numUsedWorkers_isSet(true); |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public SupervisorSummary(SupervisorSummary other) { |
| __isset_bitfield = other.__isset_bitfield; |
| if (other.is_set_host()) { |
| this.host = other.host; |
| } |
| if (other.is_set_supervisorId()) { |
| this.supervisorId = other.supervisorId; |
| } |
| this.uptimeSecs = other.uptimeSecs; |
| this.numWorkers = other.numWorkers; |
| this.numUsedWorkers = other.numUsedWorkers; |
| } |
| |
| public SupervisorSummary deepCopy() { |
| return new SupervisorSummary(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.host = null; |
| this.supervisorId = null; |
| set_uptimeSecs_isSet(false); |
| this.uptimeSecs = 0; |
| set_numWorkers_isSet(false); |
| this.numWorkers = 0; |
| set_numUsedWorkers_isSet(false); |
| this.numUsedWorkers = 0; |
| } |
| |
| public String get_host() { |
| return this.host; |
| } |
| |
| public void set_host(String host) { |
| this.host = host; |
| } |
| |
| public void unset_host() { |
| this.host = null; |
| } |
| |
| /** Returns true if field host is set (has been assigned a value) and false otherwise */ |
| public boolean is_set_host() { |
| return this.host != null; |
| } |
| |
| public void set_host_isSet(boolean value) { |
| if (!value) { |
| this.host = null; |
| } |
| } |
| |
| public String get_supervisorId() { |
| return this.supervisorId; |
| } |
| |
| public void set_supervisorId(String supervisorId) { |
| this.supervisorId = supervisorId; |
| } |
| |
| public void unset_supervisorId() { |
| this.supervisorId = null; |
| } |
| |
| /** Returns true if field supervisorId is set (has been assigned a value) and false otherwise */ |
| public boolean is_set_supervisorId() { |
| return this.supervisorId != null; |
| } |
| |
| public void set_supervisorId_isSet(boolean value) { |
| if (!value) { |
| this.supervisorId = null; |
| } |
| } |
| |
| public int get_uptimeSecs() { |
| return this.uptimeSecs; |
| } |
| |
| public void set_uptimeSecs(int uptimeSecs) { |
| this.uptimeSecs = uptimeSecs; |
| set_uptimeSecs_isSet(true); |
| } |
| |
| public void unset_uptimeSecs() { |
| __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __UPTIMESECS_ISSET_ID); |
| } |
| |
| /** Returns true if field uptimeSecs is set (has been assigned a value) and false otherwise */ |
| public boolean is_set_uptimeSecs() { |
| return EncodingUtils.testBit(__isset_bitfield, __UPTIMESECS_ISSET_ID); |
| } |
| |
| public void set_uptimeSecs_isSet(boolean value) { |
| __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __UPTIMESECS_ISSET_ID, value); |
| } |
| |
| public int get_numWorkers() { |
| return this.numWorkers; |
| } |
| |
| public void set_numWorkers(int numWorkers) { |
| this.numWorkers = numWorkers; |
| set_numWorkers_isSet(true); |
| } |
| |
| public void unset_numWorkers() { |
| __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUMWORKERS_ISSET_ID); |
| } |
| |
| /** Returns true if field numWorkers is set (has been assigned a value) and false otherwise */ |
| public boolean is_set_numWorkers() { |
| return EncodingUtils.testBit(__isset_bitfield, __NUMWORKERS_ISSET_ID); |
| } |
| |
| public void set_numWorkers_isSet(boolean value) { |
| __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUMWORKERS_ISSET_ID, value); |
| } |
| |
| public int get_numUsedWorkers() { |
| return this.numUsedWorkers; |
| } |
| |
| public void set_numUsedWorkers(int numUsedWorkers) { |
| this.numUsedWorkers = numUsedWorkers; |
| set_numUsedWorkers_isSet(true); |
| } |
| |
| public void unset_numUsedWorkers() { |
| __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NUMUSEDWORKERS_ISSET_ID); |
| } |
| |
| /** Returns true if field numUsedWorkers is set (has been assigned a value) and false otherwise */ |
| public boolean is_set_numUsedWorkers() { |
| return EncodingUtils.testBit(__isset_bitfield, __NUMUSEDWORKERS_ISSET_ID); |
| } |
| |
| public void set_numUsedWorkers_isSet(boolean value) { |
| __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NUMUSEDWORKERS_ISSET_ID, value); |
| } |
| |
| public void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case HOST: |
| if (value == null) { |
| unset_host(); |
| } else { |
| set_host((String)value); |
| } |
| break; |
| |
| case SUPERVISOR_ID: |
| if (value == null) { |
| unset_supervisorId(); |
| } else { |
| set_supervisorId((String)value); |
| } |
| break; |
| |
| case UPTIME_SECS: |
| if (value == null) { |
| unset_uptimeSecs(); |
| } else { |
| set_uptimeSecs((Integer)value); |
| } |
| break; |
| |
| case NUM_WORKERS: |
| if (value == null) { |
| unset_numWorkers(); |
| } else { |
| set_numWorkers((Integer)value); |
| } |
| break; |
| |
| case NUM_USED_WORKERS: |
| if (value == null) { |
| unset_numUsedWorkers(); |
| } else { |
| set_numUsedWorkers((Integer)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case HOST: |
| return get_host(); |
| |
| case SUPERVISOR_ID: |
| return get_supervisorId(); |
| |
| case UPTIME_SECS: |
| return Integer.valueOf(get_uptimeSecs()); |
| |
| case NUM_WORKERS: |
| return Integer.valueOf(get_numWorkers()); |
| |
| case NUM_USED_WORKERS: |
| return Integer.valueOf(get_numUsedWorkers()); |
| |
| } |
| throw new IllegalStateException(); |
| } |
| |
| /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ |
| public boolean isSet(_Fields field) { |
| if (field == null) { |
| throw new IllegalArgumentException(); |
| } |
| |
| switch (field) { |
| case HOST: |
| return is_set_host(); |
| case SUPERVISOR_ID: |
| return is_set_supervisorId(); |
| case UPTIME_SECS: |
| return is_set_uptimeSecs(); |
| case NUM_WORKERS: |
| return is_set_numWorkers(); |
| case NUM_USED_WORKERS: |
| return is_set_numUsedWorkers(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof SupervisorSummary) |
| return this.equals((SupervisorSummary)that); |
| return false; |
| } |
| |
| public boolean equals(SupervisorSummary that) { |
| if (that == null) |
| return false; |
| |
| boolean this_present_host = true && this.is_set_host(); |
| boolean that_present_host = true && that.is_set_host(); |
| if (this_present_host || that_present_host) { |
| if (!(this_present_host && that_present_host)) |
| return false; |
| if (!this.host.equals(that.host)) |
| return false; |
| } |
| |
| boolean this_present_supervisorId = true && this.is_set_supervisorId(); |
| boolean that_present_supervisorId = true && that.is_set_supervisorId(); |
| if (this_present_supervisorId || that_present_supervisorId) { |
| if (!(this_present_supervisorId && that_present_supervisorId)) |
| return false; |
| if (!this.supervisorId.equals(that.supervisorId)) |
| return false; |
| } |
| |
| boolean this_present_uptimeSecs = true; |
| boolean that_present_uptimeSecs = true; |
| if (this_present_uptimeSecs || that_present_uptimeSecs) { |
| if (!(this_present_uptimeSecs && that_present_uptimeSecs)) |
| return false; |
| if (this.uptimeSecs != that.uptimeSecs) |
| return false; |
| } |
| |
| boolean this_present_numWorkers = true; |
| boolean that_present_numWorkers = true; |
| if (this_present_numWorkers || that_present_numWorkers) { |
| if (!(this_present_numWorkers && that_present_numWorkers)) |
| return false; |
| if (this.numWorkers != that.numWorkers) |
| return false; |
| } |
| |
| boolean this_present_numUsedWorkers = true; |
| boolean that_present_numUsedWorkers = true; |
| if (this_present_numUsedWorkers || that_present_numUsedWorkers) { |
| if (!(this_present_numUsedWorkers && that_present_numUsedWorkers)) |
| return false; |
| if (this.numUsedWorkers != that.numUsedWorkers) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| List<Object> list = new ArrayList<Object>(); |
| |
| boolean present_host = true && (is_set_host()); |
| list.add(present_host); |
| if (present_host) |
| list.add(host); |
| |
| boolean present_supervisorId = true && (is_set_supervisorId()); |
| list.add(present_supervisorId); |
| if (present_supervisorId) |
| list.add(supervisorId); |
| |
| boolean present_uptimeSecs = true; |
| list.add(present_uptimeSecs); |
| if (present_uptimeSecs) |
| list.add(uptimeSecs); |
| |
| boolean present_numWorkers = true; |
| list.add(present_numWorkers); |
| if (present_numWorkers) |
| list.add(numWorkers); |
| |
| boolean present_numUsedWorkers = true; |
| list.add(present_numUsedWorkers); |
| if (present_numUsedWorkers) |
| list.add(numUsedWorkers); |
| |
| return list.hashCode(); |
| } |
| |
| @Override |
| public int compareTo(SupervisorSummary other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| |
| lastComparison = Boolean.valueOf(is_set_host()).compareTo(other.is_set_host()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (is_set_host()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, other.host); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = Boolean.valueOf(is_set_supervisorId()).compareTo(other.is_set_supervisorId()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (is_set_supervisorId()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.supervisorId, other.supervisorId); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = Boolean.valueOf(is_set_uptimeSecs()).compareTo(other.is_set_uptimeSecs()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (is_set_uptimeSecs()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptimeSecs, other.uptimeSecs); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = Boolean.valueOf(is_set_numWorkers()).compareTo(other.is_set_numWorkers()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (is_set_numWorkers()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numWorkers, other.numWorkers); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = Boolean.valueOf(is_set_numUsedWorkers()).compareTo(other.is_set_numUsedWorkers()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (is_set_numUsedWorkers()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.numUsedWorkers, other.numUsedWorkers); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| return 0; |
| } |
| |
| public _Fields fieldForId(int fieldId) { |
| return _Fields.findByThriftId(fieldId); |
| } |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot) throws TException { |
| schemes.get(iprot.getScheme()).getScheme().read(iprot, this); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot) throws TException { |
| schemes.get(oprot.getScheme()).getScheme().write(oprot, this); |
| } |
| |
| @Override |
| public String toString() { |
| StringBuilder sb = new StringBuilder("SupervisorSummary("); |
| boolean first = true; |
| |
| sb.append("host:"); |
| if (this.host == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.host); |
| } |
| first = false; |
| if (!first) sb.append(", "); |
| sb.append("supervisorId:"); |
| if (this.supervisorId == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.supervisorId); |
| } |
| first = false; |
| if (!first) sb.append(", "); |
| sb.append("uptimeSecs:"); |
| sb.append(this.uptimeSecs); |
| first = false; |
| if (!first) sb.append(", "); |
| sb.append("numWorkers:"); |
| sb.append(this.numWorkers); |
| first = false; |
| if (!first) sb.append(", "); |
| sb.append("numUsedWorkers:"); |
| sb.append(this.numUsedWorkers); |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws TException { |
| // check for required fields |
| if (!is_set_host()) { |
| throw new TProtocolException("Required field 'host' is unset! Struct:" + toString()); |
| } |
| |
| if (!is_set_supervisorId()) { |
| throw new TProtocolException("Required field 'supervisorId' is unset! Struct:" + toString()); |
| } |
| |
| if (!is_set_uptimeSecs()) { |
| throw new TProtocolException("Required field 'uptimeSecs' is unset! Struct:" + toString()); |
| } |
| |
| if (!is_set_numWorkers()) { |
| throw new TProtocolException("Required field 'numWorkers' is unset! Struct:" + toString()); |
| } |
| |
| if (!is_set_numUsedWorkers()) { |
| throw new TProtocolException("Required field 'numUsedWorkers' is unset! Struct:" + toString()); |
| } |
| |
| // check for sub-struct validity |
| } |
| |
| private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { |
| try { |
| write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); |
| } catch (TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { |
| try { |
| // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. |
| __isset_bitfield = 0; |
| read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); |
| } catch (TException te) { |
| throw new java.io.IOException(te); |
| } |
| } |
| |
| private static class SupervisorSummaryStandardSchemeFactory implements SchemeFactory { |
| public SupervisorSummaryStandardScheme getScheme() { |
| return new SupervisorSummaryStandardScheme(); |
| } |
| } |
| |
| private static class SupervisorSummaryStandardScheme extends StandardScheme<SupervisorSummary> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, SupervisorSummary struct) throws TException { |
| org.apache.thrift.protocol.TField schemeField; |
| iprot.readStructBegin(); |
| while (true) |
| { |
| schemeField = iprot.readFieldBegin(); |
| if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { |
| break; |
| } |
| switch (schemeField.id) { |
| case 1: // HOST |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.host = iprot.readString(); |
| struct.set_host_isSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 2: // SUPERVISOR_ID |
| if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { |
| struct.supervisorId = iprot.readString(); |
| struct.set_supervisorId_isSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 3: // UPTIME_SECS |
| if (schemeField.type == org.apache.thrift.protocol.TType.I32) { |
| struct.uptimeSecs = iprot.readI32(); |
| struct.set_uptimeSecs_isSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 4: // NUM_WORKERS |
| if (schemeField.type == org.apache.thrift.protocol.TType.I32) { |
| struct.numWorkers = iprot.readI32(); |
| struct.set_numWorkers_isSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 5: // NUM_USED_WORKERS |
| if (schemeField.type == org.apache.thrift.protocol.TType.I32) { |
| struct.numUsedWorkers = iprot.readI32(); |
| struct.set_numUsedWorkers_isSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| default: |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| iprot.readFieldEnd(); |
| } |
| iprot.readStructEnd(); |
| struct.validate(); |
| } |
| |
| public void write(org.apache.thrift.protocol.TProtocol oprot, SupervisorSummary struct) throws TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.host != null) { |
| oprot.writeFieldBegin(HOST_FIELD_DESC); |
| oprot.writeString(struct.host); |
| oprot.writeFieldEnd(); |
| } |
| if (struct.supervisorId != null) { |
| oprot.writeFieldBegin(SUPERVISOR_ID_FIELD_DESC); |
| oprot.writeString(struct.supervisorId); |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldBegin(UPTIME_SECS_FIELD_DESC); |
| oprot.writeI32(struct.uptimeSecs); |
| oprot.writeFieldEnd(); |
| oprot.writeFieldBegin(NUM_WORKERS_FIELD_DESC); |
| oprot.writeI32(struct.numWorkers); |
| oprot.writeFieldEnd(); |
| oprot.writeFieldBegin(NUM_USED_WORKERS_FIELD_DESC); |
| oprot.writeI32(struct.numUsedWorkers); |
| oprot.writeFieldEnd(); |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class SupervisorSummaryTupleSchemeFactory implements SchemeFactory { |
| public SupervisorSummaryTupleScheme getScheme() { |
| return new SupervisorSummaryTupleScheme(); |
| } |
| } |
| |
| private static class SupervisorSummaryTupleScheme extends TupleScheme<SupervisorSummary> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, SupervisorSummary struct) throws TException { |
| TTupleProtocol oprot = (TTupleProtocol) prot; |
| oprot.writeString(struct.host); |
| oprot.writeString(struct.supervisorId); |
| oprot.writeI32(struct.uptimeSecs); |
| oprot.writeI32(struct.numWorkers); |
| oprot.writeI32(struct.numUsedWorkers); |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, SupervisorSummary struct) throws TException { |
| TTupleProtocol iprot = (TTupleProtocol) prot; |
| struct.host = iprot.readString(); |
| struct.set_host_isSet(true); |
| struct.supervisorId = iprot.readString(); |
| struct.set_supervisorId_isSet(true); |
| struct.uptimeSecs = iprot.readI32(); |
| struct.set_uptimeSecs_isSet(true); |
| struct.numWorkers = iprot.readI32(); |
| struct.set_numWorkers_isSet(true); |
| struct.numUsedWorkers = iprot.readI32(); |
| struct.set_numUsedWorkers_isSet(true); |
| } |
| } |
| |
| } |
| |