public void read(org.apache.thrift.protocol.TProtocol iprot, TCreateSentryRoleRequest 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: // PROTOCOL_VERSION
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.protocol_version = iprot.readI32();
           struct.setProtocol_versionIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // REQUESTOR_USER_NAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.requestorUserName = iprot.readString();
           struct.setRequestorUserNameIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // REQUESTOR_GROUP_NAMES
         if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
           {
             org.apache.thrift.protocol.TSet _set0 = iprot.readSetBegin();
             struct.requestorGroupNames = new HashSet<String>(2 * _set0.size);
             for (int _i1 = 0; _i1 < _set0.size; ++_i1) {
               String _elem2; // required
               _elem2 = iprot.readString();
               struct.requestorGroupNames.add(_elem2);
             }
             iprot.readSetEnd();
           }
           struct.setRequestorGroupNamesIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // ROLE_NAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.roleName = iprot.readString();
           struct.setRoleNameIsSet(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();
   struct.validate();
 }
 public void readSetEnd() throws TException {
   delegate.readSetEnd();
 }
    public void read(org.apache.thrift.protocol.TProtocol iprot, CrazyNesting 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: // STRING_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.string_field = iprot.readString();
              struct.setString_fieldIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // SET_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.SET) {
              {
                org.apache.thrift.protocol.TSet _set18 = iprot.readSetBegin();
                struct.set_field = new HashSet<Insanity>(2 * _set18.size);
                for (int _i19 = 0; _i19 < _set18.size; ++_i19) {
                  Insanity _elem20; // required
                  _elem20 = new Insanity();
                  _elem20.read(iprot);
                  struct.set_field.add(_elem20);
                }
                iprot.readSetEnd();
              }
              struct.setSet_fieldIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // LIST_FIELD
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list21 = iprot.readListBegin();
                struct.list_field =
                    new ArrayList<
                        Map<Set<Integer>, Map<Integer, Set<List<Map<Insanity, String>>>>>>(
                        _list21.size);
                for (int _i22 = 0; _i22 < _list21.size; ++_i22) {
                  Map<Set<Integer>, Map<Integer, Set<List<Map<Insanity, String>>>>>
                      _elem23; // required
                  {
                    org.apache.thrift.protocol.TMap _map24 = iprot.readMapBegin();
                    _elem23 =
                        new HashMap<Set<Integer>, Map<Integer, Set<List<Map<Insanity, String>>>>>(
                            2 * _map24.size);
                    for (int _i25 = 0; _i25 < _map24.size; ++_i25) {
                      Set<Integer> _key26; // required
                      Map<Integer, Set<List<Map<Insanity, String>>>> _val27; // required
                      {
                        org.apache.thrift.protocol.TSet _set28 = iprot.readSetBegin();
                        _key26 = new HashSet<Integer>(2 * _set28.size);
                        for (int _i29 = 0; _i29 < _set28.size; ++_i29) {
                          int _elem30; // required
                          _elem30 = iprot.readI32();
                          _key26.add(_elem30);
                        }
                        iprot.readSetEnd();
                      }
                      {
                        org.apache.thrift.protocol.TMap _map31 = iprot.readMapBegin();
                        _val27 =
                            new HashMap<Integer, Set<List<Map<Insanity, String>>>>(2 * _map31.size);
                        for (int _i32 = 0; _i32 < _map31.size; ++_i32) {
                          int _key33; // required
                          Set<List<Map<Insanity, String>>> _val34; // required
                          _key33 = iprot.readI32();
                          {
                            org.apache.thrift.protocol.TSet _set35 = iprot.readSetBegin();
                            _val34 = new HashSet<List<Map<Insanity, String>>>(2 * _set35.size);
                            for (int _i36 = 0; _i36 < _set35.size; ++_i36) {
                              List<Map<Insanity, String>> _elem37; // required
                              {
                                org.apache.thrift.protocol.TList _list38 = iprot.readListBegin();
                                _elem37 = new ArrayList<Map<Insanity, String>>(_list38.size);
                                for (int _i39 = 0; _i39 < _list38.size; ++_i39) {
                                  Map<Insanity, String> _elem40; // required
                                  {
                                    org.apache.thrift.protocol.TMap _map41 = iprot.readMapBegin();
                                    _elem40 = new HashMap<Insanity, String>(2 * _map41.size);
                                    for (int _i42 = 0; _i42 < _map41.size; ++_i42) {
                                      Insanity _key43; // required
                                      String _val44; // required
                                      _key43 = new Insanity();
                                      _key43.read(iprot);
                                      _val44 = iprot.readString();
                                      _elem40.put(_key43, _val44);
                                    }
                                    iprot.readMapEnd();
                                  }
                                  _elem37.add(_elem40);
                                }
                                iprot.readListEnd();
                              }
                              _val34.add(_elem37);
                            }
                            iprot.readSetEnd();
                          }
                          _val27.put(_key33, _val34);
                        }
                        iprot.readMapEnd();
                      }
                      _elem23.put(_key26, _val27);
                    }
                    iprot.readMapEnd();
                  }
                  struct.list_field.add(_elem23);
                }
                iprot.readListEnd();
              }
              struct.setList_fieldIsSet(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();
    }
Beispiel #4
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();
    }