示例#1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, WorkerInfo struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(7);
   if (incoming.get(0)) {
     struct.id = iprot.readI64();
     struct.setIdIsSet(true);
   }
   if (incoming.get(1)) {
     struct.address = new tachyon.thrift.NetAddress();
     struct.address.read(iprot);
     struct.setAddressIsSet(true);
   }
   if (incoming.get(2)) {
     struct.lastContactSec = iprot.readI32();
     struct.setLastContactSecIsSet(true);
   }
   if (incoming.get(3)) {
     struct.state = iprot.readString();
     struct.setStateIsSet(true);
   }
   if (incoming.get(4)) {
     struct.capacityBytes = iprot.readI64();
     struct.setCapacityBytesIsSet(true);
   }
   if (incoming.get(5)) {
     struct.usedBytes = iprot.readI64();
     struct.setUsedBytesIsSet(true);
   }
   if (incoming.get(6)) {
     struct.startTimeMs = iprot.readI64();
     struct.setStartTimeMsIsSet(true);
   }
 }
示例#2
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, WorkerInfo 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 1: // ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.id = iprot.readI64();
              struct.setIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // ADDRESS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.address = new tachyon.thrift.NetAddress();
              struct.address.read(iprot);
              struct.setAddressIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LAST_CONTACT_SEC
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.lastContactSec = iprot.readI32();
              struct.setLastContactSecIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // STATE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.state = iprot.readString();
              struct.setStateIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CAPACITY_BYTES
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.capacityBytes = iprot.readI64();
              struct.setCapacityBytesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // USED_BYTES
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.usedBytes = iprot.readI64();
              struct.setUsedBytesIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // START_TIME_MS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.startTimeMs = iprot.readI64();
              struct.setStartTimeMsIsSet(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();
    }