All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.uber.cadence.TaskListStatus Maven / Gradle / Ivy

There is a newer version: 3.12.5
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.9.3)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package com.uber.cadence;

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.3)", date = "2019-06-18")
public class TaskListStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TaskListStatus");

  private static final org.apache.thrift.protocol.TField BACKLOG_COUNT_HINT_FIELD_DESC = new org.apache.thrift.protocol.TField("backlogCountHint", org.apache.thrift.protocol.TType.I64, (short)10);
  private static final org.apache.thrift.protocol.TField READ_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("readLevel", org.apache.thrift.protocol.TType.I64, (short)20);
  private static final org.apache.thrift.protocol.TField ACK_LEVEL_FIELD_DESC = new org.apache.thrift.protocol.TField("ackLevel", org.apache.thrift.protocol.TType.I64, (short)30);
  private static final org.apache.thrift.protocol.TField RATE_PER_SECOND_FIELD_DESC = new org.apache.thrift.protocol.TField("ratePerSecond", org.apache.thrift.protocol.TType.DOUBLE, (short)35);
  private static final org.apache.thrift.protocol.TField TASK_IDBLOCK_FIELD_DESC = new org.apache.thrift.protocol.TField("taskIDBlock", org.apache.thrift.protocol.TType.STRUCT, (short)40);

  private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
  static {
    schemes.put(StandardScheme.class, new TaskListStatusStandardSchemeFactory());
    schemes.put(TupleScheme.class, new TaskListStatusTupleSchemeFactory());
  }

  public long backlogCountHint; // optional
  public long readLevel; // optional
  public long ackLevel; // optional
  public double ratePerSecond; // optional
  public TaskIDBlock taskIDBlock; // optional

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    BACKLOG_COUNT_HINT((short)10, "backlogCountHint"),
    READ_LEVEL((short)20, "readLevel"),
    ACK_LEVEL((short)30, "ackLevel"),
    RATE_PER_SECOND((short)35, "ratePerSecond"),
    TASK_IDBLOCK((short)40, "taskIDBlock");

    private static final Map byName = new HashMap();

    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 10: // BACKLOG_COUNT_HINT
          return BACKLOG_COUNT_HINT;
        case 20: // READ_LEVEL
          return READ_LEVEL;
        case 30: // ACK_LEVEL
          return ACK_LEVEL;
        case 35: // RATE_PER_SECOND
          return RATE_PER_SECOND;
        case 40: // TASK_IDBLOCK
          return TASK_IDBLOCK;
        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 __BACKLOGCOUNTHINT_ISSET_ID = 0;
  private static final int __READLEVEL_ISSET_ID = 1;
  private static final int __ACKLEVEL_ISSET_ID = 2;
  private static final int __RATEPERSECOND_ISSET_ID = 3;
  private byte __isset_bitfield = 0;
  private static final _Fields optionals[] = {_Fields.BACKLOG_COUNT_HINT,_Fields.READ_LEVEL,_Fields.ACK_LEVEL,_Fields.RATE_PER_SECOND,_Fields.TASK_IDBLOCK};
  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.BACKLOG_COUNT_HINT, new org.apache.thrift.meta_data.FieldMetaData("backlogCountHint", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.READ_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("readLevel", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.ACK_LEVEL, new org.apache.thrift.meta_data.FieldMetaData("ackLevel", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
    tmpMap.put(_Fields.RATE_PER_SECOND, new org.apache.thrift.meta_data.FieldMetaData("ratePerSecond", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
    tmpMap.put(_Fields.TASK_IDBLOCK, new org.apache.thrift.meta_data.FieldMetaData("taskIDBlock", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT        , "TaskIDBlock")));
    metaDataMap = Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TaskListStatus.class, metaDataMap);
  }

  public TaskListStatus() {
  }

  /**
   * Performs a deep copy on other.
   */
  public TaskListStatus(TaskListStatus other) {
    __isset_bitfield = other.__isset_bitfield;
    this.backlogCountHint = other.backlogCountHint;
    this.readLevel = other.readLevel;
    this.ackLevel = other.ackLevel;
    this.ratePerSecond = other.ratePerSecond;
    if (other.isSetTaskIDBlock()) {
      this.taskIDBlock = other.taskIDBlock;
    }
  }

  public TaskListStatus deepCopy() {
    return new TaskListStatus(this);
  }

  @Override
  public void clear() {
    setBacklogCountHintIsSet(false);
    this.backlogCountHint = 0;
    setReadLevelIsSet(false);
    this.readLevel = 0;
    setAckLevelIsSet(false);
    this.ackLevel = 0;
    setRatePerSecondIsSet(false);
    this.ratePerSecond = 0.0;
    this.taskIDBlock = null;
  }

  public long getBacklogCountHint() {
    return this.backlogCountHint;
  }

  public TaskListStatus setBacklogCountHint(long backlogCountHint) {
    this.backlogCountHint = backlogCountHint;
    setBacklogCountHintIsSet(true);
    return this;
  }

  public void unsetBacklogCountHint() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BACKLOGCOUNTHINT_ISSET_ID);
  }

  /** Returns true if field backlogCountHint is set (has been assigned a value) and false otherwise */
  public boolean isSetBacklogCountHint() {
    return EncodingUtils.testBit(__isset_bitfield, __BACKLOGCOUNTHINT_ISSET_ID);
  }

  public void setBacklogCountHintIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BACKLOGCOUNTHINT_ISSET_ID, value);
  }

  public long getReadLevel() {
    return this.readLevel;
  }

  public TaskListStatus setReadLevel(long readLevel) {
    this.readLevel = readLevel;
    setReadLevelIsSet(true);
    return this;
  }

  public void unsetReadLevel() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __READLEVEL_ISSET_ID);
  }

  /** Returns true if field readLevel is set (has been assigned a value) and false otherwise */
  public boolean isSetReadLevel() {
    return EncodingUtils.testBit(__isset_bitfield, __READLEVEL_ISSET_ID);
  }

  public void setReadLevelIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __READLEVEL_ISSET_ID, value);
  }

  public long getAckLevel() {
    return this.ackLevel;
  }

  public TaskListStatus setAckLevel(long ackLevel) {
    this.ackLevel = ackLevel;
    setAckLevelIsSet(true);
    return this;
  }

  public void unsetAckLevel() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ACKLEVEL_ISSET_ID);
  }

  /** Returns true if field ackLevel is set (has been assigned a value) and false otherwise */
  public boolean isSetAckLevel() {
    return EncodingUtils.testBit(__isset_bitfield, __ACKLEVEL_ISSET_ID);
  }

  public void setAckLevelIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ACKLEVEL_ISSET_ID, value);
  }

  public double getRatePerSecond() {
    return this.ratePerSecond;
  }

  public TaskListStatus setRatePerSecond(double ratePerSecond) {
    this.ratePerSecond = ratePerSecond;
    setRatePerSecondIsSet(true);
    return this;
  }

  public void unsetRatePerSecond() {
    __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RATEPERSECOND_ISSET_ID);
  }

  /** Returns true if field ratePerSecond is set (has been assigned a value) and false otherwise */
  public boolean isSetRatePerSecond() {
    return EncodingUtils.testBit(__isset_bitfield, __RATEPERSECOND_ISSET_ID);
  }

  public void setRatePerSecondIsSet(boolean value) {
    __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RATEPERSECOND_ISSET_ID, value);
  }

  public TaskIDBlock getTaskIDBlock() {
    return this.taskIDBlock;
  }

  public TaskListStatus setTaskIDBlock(TaskIDBlock taskIDBlock) {
    this.taskIDBlock = taskIDBlock;
    return this;
  }

  public void unsetTaskIDBlock() {
    this.taskIDBlock = null;
  }

  /** Returns true if field taskIDBlock is set (has been assigned a value) and false otherwise */
  public boolean isSetTaskIDBlock() {
    return this.taskIDBlock != null;
  }

  public void setTaskIDBlockIsSet(boolean value) {
    if (!value) {
      this.taskIDBlock = null;
    }
  }

  public void setFieldValue(_Fields field, Object value) {
    switch (field) {
    case BACKLOG_COUNT_HINT:
      if (value == null) {
        unsetBacklogCountHint();
      } else {
        setBacklogCountHint((Long)value);
      }
      break;

    case READ_LEVEL:
      if (value == null) {
        unsetReadLevel();
      } else {
        setReadLevel((Long)value);
      }
      break;

    case ACK_LEVEL:
      if (value == null) {
        unsetAckLevel();
      } else {
        setAckLevel((Long)value);
      }
      break;

    case RATE_PER_SECOND:
      if (value == null) {
        unsetRatePerSecond();
      } else {
        setRatePerSecond((Double)value);
      }
      break;

    case TASK_IDBLOCK:
      if (value == null) {
        unsetTaskIDBlock();
      } else {
        setTaskIDBlock((TaskIDBlock)value);
      }
      break;

    }
  }

  public Object getFieldValue(_Fields field) {
    switch (field) {
    case BACKLOG_COUNT_HINT:
      return getBacklogCountHint();

    case READ_LEVEL:
      return getReadLevel();

    case ACK_LEVEL:
      return getAckLevel();

    case RATE_PER_SECOND:
      return getRatePerSecond();

    case TASK_IDBLOCK:
      return getTaskIDBlock();

    }
    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 BACKLOG_COUNT_HINT:
      return isSetBacklogCountHint();
    case READ_LEVEL:
      return isSetReadLevel();
    case ACK_LEVEL:
      return isSetAckLevel();
    case RATE_PER_SECOND:
      return isSetRatePerSecond();
    case TASK_IDBLOCK:
      return isSetTaskIDBlock();
    }
    throw new IllegalStateException();
  }

  @Override
  public boolean equals(Object that) {
    if (that == null)
      return false;
    if (that instanceof TaskListStatus)
      return this.equals((TaskListStatus)that);
    return false;
  }

  public boolean equals(TaskListStatus that) {
    if (that == null)
      return false;

    boolean this_present_backlogCountHint = true && this.isSetBacklogCountHint();
    boolean that_present_backlogCountHint = true && that.isSetBacklogCountHint();
    if (this_present_backlogCountHint || that_present_backlogCountHint) {
      if (!(this_present_backlogCountHint && that_present_backlogCountHint))
        return false;
      if (this.backlogCountHint != that.backlogCountHint)
        return false;
    }

    boolean this_present_readLevel = true && this.isSetReadLevel();
    boolean that_present_readLevel = true && that.isSetReadLevel();
    if (this_present_readLevel || that_present_readLevel) {
      if (!(this_present_readLevel && that_present_readLevel))
        return false;
      if (this.readLevel != that.readLevel)
        return false;
    }

    boolean this_present_ackLevel = true && this.isSetAckLevel();
    boolean that_present_ackLevel = true && that.isSetAckLevel();
    if (this_present_ackLevel || that_present_ackLevel) {
      if (!(this_present_ackLevel && that_present_ackLevel))
        return false;
      if (this.ackLevel != that.ackLevel)
        return false;
    }

    boolean this_present_ratePerSecond = true && this.isSetRatePerSecond();
    boolean that_present_ratePerSecond = true && that.isSetRatePerSecond();
    if (this_present_ratePerSecond || that_present_ratePerSecond) {
      if (!(this_present_ratePerSecond && that_present_ratePerSecond))
        return false;
      if (this.ratePerSecond != that.ratePerSecond)
        return false;
    }

    boolean this_present_taskIDBlock = true && this.isSetTaskIDBlock();
    boolean that_present_taskIDBlock = true && that.isSetTaskIDBlock();
    if (this_present_taskIDBlock || that_present_taskIDBlock) {
      if (!(this_present_taskIDBlock && that_present_taskIDBlock))
        return false;
      if (!this.taskIDBlock.equals(that.taskIDBlock))
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    List list = new ArrayList();

    boolean present_backlogCountHint = true && (isSetBacklogCountHint());
    list.add(present_backlogCountHint);
    if (present_backlogCountHint)
      list.add(backlogCountHint);

    boolean present_readLevel = true && (isSetReadLevel());
    list.add(present_readLevel);
    if (present_readLevel)
      list.add(readLevel);

    boolean present_ackLevel = true && (isSetAckLevel());
    list.add(present_ackLevel);
    if (present_ackLevel)
      list.add(ackLevel);

    boolean present_ratePerSecond = true && (isSetRatePerSecond());
    list.add(present_ratePerSecond);
    if (present_ratePerSecond)
      list.add(ratePerSecond);

    boolean present_taskIDBlock = true && (isSetTaskIDBlock());
    list.add(present_taskIDBlock);
    if (present_taskIDBlock)
      list.add(taskIDBlock);

    return list.hashCode();
  }

  @Override
  public int compareTo(TaskListStatus other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetBacklogCountHint()).compareTo(other.isSetBacklogCountHint());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBacklogCountHint()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.backlogCountHint, other.backlogCountHint);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetReadLevel()).compareTo(other.isSetReadLevel());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReadLevel()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.readLevel, other.readLevel);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAckLevel()).compareTo(other.isSetAckLevel());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAckLevel()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ackLevel, other.ackLevel);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRatePerSecond()).compareTo(other.isSetRatePerSecond());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRatePerSecond()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ratePerSecond, other.ratePerSecond);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTaskIDBlock()).compareTo(other.isSetTaskIDBlock());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTaskIDBlock()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskIDBlock, other.taskIDBlock);
      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 org.apache.thrift.TException {
    schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder("TaskListStatus(");
    boolean first = true;

    if (isSetBacklogCountHint()) {
      sb.append("backlogCountHint:");
      sb.append(this.backlogCountHint);
      first = false;
    }
    if (isSetReadLevel()) {
      if (!first) sb.append(", ");
      sb.append("readLevel:");
      sb.append(this.readLevel);
      first = false;
    }
    if (isSetAckLevel()) {
      if (!first) sb.append(", ");
      sb.append("ackLevel:");
      sb.append(this.ackLevel);
      first = false;
    }
    if (isSetRatePerSecond()) {
      if (!first) sb.append(", ");
      sb.append("ratePerSecond:");
      sb.append(this.ratePerSecond);
      first = false;
    }
    if (isSetTaskIDBlock()) {
      if (!first) sb.append(", ");
      sb.append("taskIDBlock:");
      if (this.taskIDBlock == null) {
        sb.append("null");
      } else {
        sb.append(this.taskIDBlock);
      }
      first = false;
    }
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // 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 (org.apache.thrift.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 (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class TaskListStatusStandardSchemeFactory implements SchemeFactory {
    public TaskListStatusStandardScheme getScheme() {
      return new TaskListStatusStandardScheme();
    }
  }

  private static class TaskListStatusStandardScheme extends StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, TaskListStatus struct) throws org.apache.thrift.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 10: // BACKLOG_COUNT_HINT
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.backlogCountHint = iprot.readI64();
              struct.setBacklogCountHintIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 20: // READ_LEVEL
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.readLevel = iprot.readI64();
              struct.setReadLevelIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 30: // ACK_LEVEL
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.ackLevel = iprot.readI64();
              struct.setAckLevelIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 35: // RATE_PER_SECOND
            if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
              struct.ratePerSecond = iprot.readDouble();
              struct.setRatePerSecondIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 40: // TASK_IDBLOCK
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.taskIDBlock = new TaskIDBlock();
              struct.taskIDBlock.read(iprot);
              struct.setTaskIDBlockIsSet(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();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, TaskListStatus struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetBacklogCountHint()) {
        oprot.writeFieldBegin(BACKLOG_COUNT_HINT_FIELD_DESC);
        oprot.writeI64(struct.backlogCountHint);
        oprot.writeFieldEnd();
      }
      if (struct.isSetReadLevel()) {
        oprot.writeFieldBegin(READ_LEVEL_FIELD_DESC);
        oprot.writeI64(struct.readLevel);
        oprot.writeFieldEnd();
      }
      if (struct.isSetAckLevel()) {
        oprot.writeFieldBegin(ACK_LEVEL_FIELD_DESC);
        oprot.writeI64(struct.ackLevel);
        oprot.writeFieldEnd();
      }
      if (struct.isSetRatePerSecond()) {
        oprot.writeFieldBegin(RATE_PER_SECOND_FIELD_DESC);
        oprot.writeDouble(struct.ratePerSecond);
        oprot.writeFieldEnd();
      }
      if (struct.taskIDBlock != null) {
        if (struct.isSetTaskIDBlock()) {
          oprot.writeFieldBegin(TASK_IDBLOCK_FIELD_DESC);
          struct.taskIDBlock.write(oprot);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class TaskListStatusTupleSchemeFactory implements SchemeFactory {
    public TaskListStatusTupleScheme getScheme() {
      return new TaskListStatusTupleScheme();
    }
  }

  private static class TaskListStatusTupleScheme extends TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, TaskListStatus struct) throws org.apache.thrift.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetBacklogCountHint()) {
        optionals.set(0);
      }
      if (struct.isSetReadLevel()) {
        optionals.set(1);
      }
      if (struct.isSetAckLevel()) {
        optionals.set(2);
      }
      if (struct.isSetRatePerSecond()) {
        optionals.set(3);
      }
      if (struct.isSetTaskIDBlock()) {
        optionals.set(4);
      }
      oprot.writeBitSet(optionals, 5);
      if (struct.isSetBacklogCountHint()) {
        oprot.writeI64(struct.backlogCountHint);
      }
      if (struct.isSetReadLevel()) {
        oprot.writeI64(struct.readLevel);
      }
      if (struct.isSetAckLevel()) {
        oprot.writeI64(struct.ackLevel);
      }
      if (struct.isSetRatePerSecond()) {
        oprot.writeDouble(struct.ratePerSecond);
      }
      if (struct.isSetTaskIDBlock()) {
        struct.taskIDBlock.write(oprot);
      }
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, TaskListStatus struct) throws org.apache.thrift.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.backlogCountHint = iprot.readI64();
        struct.setBacklogCountHintIsSet(true);
      }
      if (incoming.get(1)) {
        struct.readLevel = iprot.readI64();
        struct.setReadLevelIsSet(true);
      }
      if (incoming.get(2)) {
        struct.ackLevel = iprot.readI64();
        struct.setAckLevelIsSet(true);
      }
      if (incoming.get(3)) {
        struct.ratePerSecond = iprot.readDouble();
        struct.setRatePerSecondIsSet(true);
      }
      if (incoming.get(4)) {
        struct.taskIDBlock = new TaskIDBlock();
        struct.taskIDBlock.read(iprot);
        struct.setTaskIDBlockIsSet(true);
      }
    }
  }

}