Пример #1
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, MkdirCmd struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.path != null) {
        oprot.writeFieldBegin(PATH_FIELD_DESC);
        oprot.writeString(struct.path);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(MODE_FIELD_DESC);
      oprot.writeI32(struct.mode);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(UID_FIELD_DESC);
      oprot.writeI32(struct.uid);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(GID_FIELD_DESC);
      oprot.writeI32(struct.gid);
      oprot.writeFieldEnd();
      if (struct.parentPartition != null) {
        oprot.writeFieldBegin(PARENT_PARTITION_FIELD_DESC);
        {
          oprot.writeSetBegin(
              new org.apache.thrift.protocol.TSet(
                  org.apache.thrift.protocol.TType.BYTE, struct.parentPartition.size()));
          for (byte _iter38 : struct.parentPartition) {
            oprot.writeByte(_iter38);
          }
          oprot.writeSetEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.partition != null) {
        oprot.writeFieldBegin(PARTITION_FIELD_DESC);
        {
          oprot.writeSetBegin(
              new org.apache.thrift.protocol.TSet(
                  org.apache.thrift.protocol.TType.BYTE, struct.partition.size()));
          for (byte _iter39 : struct.partition) {
            oprot.writeByte(_iter39);
          }
          oprot.writeSetEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    public void write(org.apache.thrift.protocol.TProtocol oprot, TCreateSentryRoleRequest struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PROTOCOL_VERSION_FIELD_DESC);
      oprot.writeI32(struct.protocol_version);
      oprot.writeFieldEnd();
      if (struct.requestorUserName != null) {
        oprot.writeFieldBegin(REQUESTOR_USER_NAME_FIELD_DESC);
        oprot.writeString(struct.requestorUserName);
        oprot.writeFieldEnd();
      }
      if (struct.requestorGroupNames != null) {
        oprot.writeFieldBegin(REQUESTOR_GROUP_NAMES_FIELD_DESC);
        {
          oprot.writeSetBegin(
              new org.apache.thrift.protocol.TSet(
                  org.apache.thrift.protocol.TType.STRING, struct.requestorGroupNames.size()));
          for (String _iter3 : struct.requestorGroupNames) {
            oprot.writeString(_iter3);
          }
          oprot.writeSetEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.roleName != null) {
        oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC);
        oprot.writeString(struct.roleName);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
 public void writeSetBegin(TSet set) throws TException {
   delegate.writeSetBegin(set);
 }
Пример #4
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, CrazyNesting struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.string_field != null) {
        oprot.writeFieldBegin(STRING_FIELD_FIELD_DESC);
        oprot.writeString(struct.string_field);
        oprot.writeFieldEnd();
      }
      if (struct.set_field != null) {
        if (struct.isSetSet_field()) {
          oprot.writeFieldBegin(SET_FIELD_FIELD_DESC);
          {
            oprot.writeSetBegin(
                new org.apache.thrift.protocol.TSet(
                    org.apache.thrift.protocol.TType.STRUCT, struct.set_field.size()));
            for (Insanity _iter45 : struct.set_field) {
              _iter45.write(oprot);
            }
            oprot.writeSetEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      if (struct.list_field != null) {
        oprot.writeFieldBegin(LIST_FIELD_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.MAP, struct.list_field.size()));
          for (Map<Set<Integer>, Map<Integer, Set<List<Map<Insanity, String>>>>> _iter46 :
              struct.list_field) {
            {
              oprot.writeMapBegin(
                  new org.apache.thrift.protocol.TMap(
                      org.apache.thrift.protocol.TType.SET,
                      org.apache.thrift.protocol.TType.MAP,
                      _iter46.size()));
              for (Map.Entry<Set<Integer>, Map<Integer, Set<List<Map<Insanity, String>>>>> _iter47 :
                  _iter46.entrySet()) {
                {
                  oprot.writeSetBegin(
                      new org.apache.thrift.protocol.TSet(
                          org.apache.thrift.protocol.TType.I32, _iter47.getKey().size()));
                  for (int _iter48 : _iter47.getKey()) {
                    oprot.writeI32(_iter48);
                  }
                  oprot.writeSetEnd();
                }
                {
                  oprot.writeMapBegin(
                      new org.apache.thrift.protocol.TMap(
                          org.apache.thrift.protocol.TType.I32,
                          org.apache.thrift.protocol.TType.SET,
                          _iter47.getValue().size()));
                  for (Map.Entry<Integer, Set<List<Map<Insanity, String>>>> _iter49 :
                      _iter47.getValue().entrySet()) {
                    oprot.writeI32(_iter49.getKey());
                    {
                      oprot.writeSetBegin(
                          new org.apache.thrift.protocol.TSet(
                              org.apache.thrift.protocol.TType.LIST, _iter49.getValue().size()));
                      for (List<Map<Insanity, String>> _iter50 : _iter49.getValue()) {
                        {
                          oprot.writeListBegin(
                              new org.apache.thrift.protocol.TList(
                                  org.apache.thrift.protocol.TType.MAP, _iter50.size()));
                          for (Map<Insanity, String> _iter51 : _iter50) {
                            {
                              oprot.writeMapBegin(
                                  new org.apache.thrift.protocol.TMap(
                                      org.apache.thrift.protocol.TType.STRUCT,
                                      org.apache.thrift.protocol.TType.STRING,
                                      _iter51.size()));
                              for (Map.Entry<Insanity, String> _iter52 : _iter51.entrySet()) {
                                _iter52.getKey().write(oprot);
                                oprot.writeString(_iter52.getValue());
                              }
                              oprot.writeMapEnd();
                            }
                          }
                          oprot.writeListEnd();
                        }
                      }
                      oprot.writeSetEnd();
                    }
                  }
                  oprot.writeMapEnd();
                }
              }
              oprot.writeMapEnd();
            }
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }