コード例 #1
0
 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();
 }
コード例 #2
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TCreateSentryRoleRequest struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.protocol_version = iprot.readI32();
   struct.setProtocol_versionIsSet(true);
   struct.requestorUserName = iprot.readString();
   struct.setRequestorUserNameIsSet(true);
   {
     org.apache.thrift.protocol.TSet _set5 =
         new org.apache.thrift.protocol.TSet(
             org.apache.thrift.protocol.TType.STRING, iprot.readI32());
     struct.requestorGroupNames = new HashSet<String>(2 * _set5.size);
     for (int _i6 = 0; _i6 < _set5.size; ++_i6) {
       String _elem7; // required
       _elem7 = iprot.readString();
       struct.requestorGroupNames.add(_elem7);
     }
   }
   struct.setRequestorGroupNamesIsSet(true);
   struct.roleName = iprot.readString();
   struct.setRoleNameIsSet(true);
 }