예제 #1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, MkdirCmd struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(6);
   if (incoming.get(0)) {
     struct.path = iprot.readString();
     struct.setPathIsSet(true);
   }
   if (incoming.get(1)) {
     struct.mode = iprot.readI32();
     struct.setModeIsSet(true);
   }
   if (incoming.get(2)) {
     struct.uid = iprot.readI32();
     struct.setUidIsSet(true);
   }
   if (incoming.get(3)) {
     struct.gid = iprot.readI32();
     struct.setGidIsSet(true);
   }
   if (incoming.get(4)) {
     {
       org.apache.thrift.protocol.TSet _set42 =
           new org.apache.thrift.protocol.TSet(
               org.apache.thrift.protocol.TType.BYTE, iprot.readI32());
       struct.parentPartition = new HashSet<Byte>(2 * _set42.size);
       for (int _i43 = 0; _i43 < _set42.size; ++_i43) {
         byte _elem44;
         _elem44 = iprot.readByte();
         struct.parentPartition.add(_elem44);
       }
     }
     struct.setParentPartitionIsSet(true);
   }
   if (incoming.get(5)) {
     {
       org.apache.thrift.protocol.TSet _set45 =
           new org.apache.thrift.protocol.TSet(
               org.apache.thrift.protocol.TType.BYTE, iprot.readI32());
       struct.partition = new HashSet<Byte>(2 * _set45.size);
       for (int _i46 = 0; _i46 < _set45.size; ++_i46) {
         byte _elem47;
         _elem47 = iprot.readByte();
         struct.partition.add(_elem47);
       }
     }
     struct.setPartitionIsSet(true);
   }
 }
예제 #2
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, MkdirCmd 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 3: // PATH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.path = iprot.readString();
              struct.setPathIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // MODE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.mode = iprot.readI32();
              struct.setModeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // UID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.uid = iprot.readI32();
              struct.setUidIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // GID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.gid = iprot.readI32();
              struct.setGidIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 7: // PARENT_PARTITION
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set32 = iprot.readSetBegin();
                struct.parentPartition = new HashSet<Byte>(2 * _set32.size);
                for (int _i33 = 0; _i33 < _set32.size; ++_i33) {
                  byte _elem34;
                  _elem34 = iprot.readByte();
                  struct.parentPartition.add(_elem34);
                }
                iprot.readSetEnd();
              }
              struct.setParentPartitionIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 8: // PARTITION
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set35 = iprot.readSetBegin();
                struct.partition = new HashSet<Byte>(2 * _set35.size);
                for (int _i36 = 0; _i36 < _set35.size; ++_i36) {
                  byte _elem37;
                  _elem37 = iprot.readByte();
                  struct.partition.add(_elem37);
                }
                iprot.readSetEnd();
              }
              struct.setPartitionIsSet(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();
    }