Exemple #1
0
 public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
   org.apache.thrift.protocol.TField field;
   iprot.readStructBegin();
   while (true) {
     field = iprot.readFieldBegin();
     if (field.type == org.apache.thrift.protocol.TType.STOP) {
       break;
     }
     switch (field.id) {
       case 1: // COLS
         if (field.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list49 = iprot.readListBegin();
             this.cols = new ArrayList<FieldSchema>(_list49.size);
             for (int _i50 = 0; _i50 < _list49.size; ++_i50) {
               FieldSchema _elem51; // required
               _elem51 = new FieldSchema();
               _elem51.read(iprot);
               this.cols.add(_elem51);
             }
             iprot.readListEnd();
           }
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 2: // LOCATION
         if (field.type == org.apache.thrift.protocol.TType.STRING) {
           this.location = iprot.readString();
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 3: // INPUT_FORMAT
         if (field.type == org.apache.thrift.protocol.TType.STRING) {
           this.inputFormat = iprot.readString();
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 4: // OUTPUT_FORMAT
         if (field.type == org.apache.thrift.protocol.TType.STRING) {
           this.outputFormat = iprot.readString();
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 5: // COMPRESSED
         if (field.type == org.apache.thrift.protocol.TType.BOOL) {
           this.compressed = iprot.readBool();
           setCompressedIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 6: // NUM_BUCKETS
         if (field.type == org.apache.thrift.protocol.TType.I32) {
           this.numBuckets = iprot.readI32();
           setNumBucketsIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 7: // SERDE_INFO
         if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
           this.serdeInfo = new SerDeInfo();
           this.serdeInfo.read(iprot);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 8: // BUCKET_COLS
         if (field.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list52 = iprot.readListBegin();
             this.bucketCols = new ArrayList<String>(_list52.size);
             for (int _i53 = 0; _i53 < _list52.size; ++_i53) {
               String _elem54; // required
               _elem54 = iprot.readString();
               this.bucketCols.add(_elem54);
             }
             iprot.readListEnd();
           }
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 9: // SORT_COLS
         if (field.type == org.apache.thrift.protocol.TType.LIST) {
           {
             org.apache.thrift.protocol.TList _list55 = iprot.readListBegin();
             this.sortCols = new ArrayList<Order>(_list55.size);
             for (int _i56 = 0; _i56 < _list55.size; ++_i56) {
               Order _elem57; // required
               _elem57 = new Order();
               _elem57.read(iprot);
               this.sortCols.add(_elem57);
             }
             iprot.readListEnd();
           }
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       case 10: // PARAMETERS
         if (field.type == org.apache.thrift.protocol.TType.MAP) {
           {
             org.apache.thrift.protocol.TMap _map58 = iprot.readMapBegin();
             this.parameters = new HashMap<String, String>(2 * _map58.size);
             for (int _i59 = 0; _i59 < _map58.size; ++_i59) {
               String _key60; // required
               String _val61; // required
               _key60 = iprot.readString();
               _val61 = iprot.readString();
               this.parameters.put(_key60, _val61);
             }
             iprot.readMapEnd();
           }
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
         }
         break;
       default:
         org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
     }
     iprot.readFieldEnd();
   }
   iprot.readStructEnd();
   validate();
 }
Exemple #2
0
  public void write(org.apache.thrift.protocol.TProtocol oprot)
      throws org.apache.thrift.TException {
    validate();

    oprot.writeStructBegin(STRUCT_DESC);
    if (this.cols != null) {
      oprot.writeFieldBegin(COLS_FIELD_DESC);
      {
        oprot.writeListBegin(
            new org.apache.thrift.protocol.TList(
                org.apache.thrift.protocol.TType.STRUCT, this.cols.size()));
        for (FieldSchema _iter62 : this.cols) {
          _iter62.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
    if (this.location != null) {
      oprot.writeFieldBegin(LOCATION_FIELD_DESC);
      oprot.writeString(this.location);
      oprot.writeFieldEnd();
    }
    if (this.inputFormat != null) {
      oprot.writeFieldBegin(INPUT_FORMAT_FIELD_DESC);
      oprot.writeString(this.inputFormat);
      oprot.writeFieldEnd();
    }
    if (this.outputFormat != null) {
      oprot.writeFieldBegin(OUTPUT_FORMAT_FIELD_DESC);
      oprot.writeString(this.outputFormat);
      oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(COMPRESSED_FIELD_DESC);
    oprot.writeBool(this.compressed);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(NUM_BUCKETS_FIELD_DESC);
    oprot.writeI32(this.numBuckets);
    oprot.writeFieldEnd();
    if (this.serdeInfo != null) {
      oprot.writeFieldBegin(SERDE_INFO_FIELD_DESC);
      this.serdeInfo.write(oprot);
      oprot.writeFieldEnd();
    }
    if (this.bucketCols != null) {
      oprot.writeFieldBegin(BUCKET_COLS_FIELD_DESC);
      {
        oprot.writeListBegin(
            new org.apache.thrift.protocol.TList(
                org.apache.thrift.protocol.TType.STRING, this.bucketCols.size()));
        for (String _iter63 : this.bucketCols) {
          oprot.writeString(_iter63);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
    if (this.sortCols != null) {
      oprot.writeFieldBegin(SORT_COLS_FIELD_DESC);
      {
        oprot.writeListBegin(
            new org.apache.thrift.protocol.TList(
                org.apache.thrift.protocol.TType.STRUCT, this.sortCols.size()));
        for (Order _iter64 : this.sortCols) {
          _iter64.write(oprot);
        }
        oprot.writeListEnd();
      }
      oprot.writeFieldEnd();
    }
    if (this.parameters != null) {
      oprot.writeFieldBegin(PARAMETERS_FIELD_DESC);
      {
        oprot.writeMapBegin(
            new org.apache.thrift.protocol.TMap(
                org.apache.thrift.protocol.TType.STRING,
                org.apache.thrift.protocol.TType.STRING,
                this.parameters.size()));
        for (Map.Entry<String, String> _iter65 : this.parameters.entrySet()) {
          oprot.writeString(_iter65.getKey());
          oprot.writeString(_iter65.getValue());
        }
        oprot.writeMapEnd();
      }
      oprot.writeFieldEnd();
    }
    oprot.writeFieldStop();
    oprot.writeStructEnd();
  }