コード例 #1
0
ファイル: PrivilegeGrantInfo.java プロジェクト: nssalian/hive
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, PrivilegeGrantInfo struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(5);
   if (incoming.get(0)) {
     struct.privilege = iprot.readString();
     struct.setPrivilegeIsSet(true);
   }
   if (incoming.get(1)) {
     struct.createTime = iprot.readI32();
     struct.setCreateTimeIsSet(true);
   }
   if (incoming.get(2)) {
     struct.grantor = iprot.readString();
     struct.setGrantorIsSet(true);
   }
   if (incoming.get(3)) {
     struct.grantorType =
         org.apache.hadoop.hive.metastore.api.PrincipalType.findByValue(iprot.readI32());
     struct.setGrantorTypeIsSet(true);
   }
   if (incoming.get(4)) {
     struct.grantOption = iprot.readBool();
     struct.setGrantOptionIsSet(true);
   }
 }
コード例 #2
0
ファイル: PrivilegeGrantInfo.java プロジェクト: nssalian/hive
 public void read(org.apache.thrift.protocol.TProtocol iprot, PrivilegeGrantInfo 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: // PRIVILEGE
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.privilege = iprot.readString();
           struct.setPrivilegeIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2: // CREATE_TIME
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.createTime = iprot.readI32();
           struct.setCreateTimeIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3: // GRANTOR
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.grantor = iprot.readString();
           struct.setGrantorIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4: // GRANTOR_TYPE
         if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
           struct.grantorType =
               org.apache.hadoop.hive.metastore.api.PrincipalType.findByValue(iprot.readI32());
           struct.setGrantorTypeIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5: // GRANT_OPTION
         if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
           struct.grantOption = iprot.readBool();
           struct.setGrantOptionIsSet(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();
 }