Exemplo n.º 1
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, FrontendRequest 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: // TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.type =
                  com.facebook.buck.distributed.thrift.FrontendRequestType.findByValue(
                      iprot.readI32());
              struct.setTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // START_BUILD
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.startBuild = new StartBuildRequest();
              struct.startBuild.read(iprot);
              struct.setStartBuildIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // BUILD_STATUS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.buildStatus = new BuildStatusRequest();
              struct.buildStatus.read(iprot);
              struct.setBuildStatusIsSet(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();
    }
Exemplo n.º 2
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, FrontendRequest struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     struct.type =
         com.facebook.buck.distributed.thrift.FrontendRequestType.findByValue(iprot.readI32());
     struct.setTypeIsSet(true);
   }
   if (incoming.get(1)) {
     struct.startBuild = new StartBuildRequest();
     struct.startBuild.read(iprot);
     struct.setStartBuildIsSet(true);
   }
   if (incoming.get(2)) {
     struct.buildStatus = new BuildStatusRequest();
     struct.buildStatus.read(iprot);
     struct.setBuildStatusIsSet(true);
   }
 }