コード例 #1
0
ファイル: Role.java プロジェクト: Leolh/hive
 public void read(org.apache.thrift.protocol.TProtocol iprot, Role 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: // 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;
       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: // OWNER_NAME
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.ownerName = iprot.readString();
           struct.setOwnerNameIsSet(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
ファイル: Role.java プロジェクト: Leolh/hive
    public void write(org.apache.thrift.protocol.TProtocol oprot, Role struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.roleName != null) {
        oprot.writeFieldBegin(ROLE_NAME_FIELD_DESC);
        oprot.writeString(struct.roleName);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(CREATE_TIME_FIELD_DESC);
      oprot.writeI32(struct.createTime);
      oprot.writeFieldEnd();
      if (struct.ownerName != null) {
        oprot.writeFieldBegin(OWNER_NAME_FIELD_DESC);
        oprot.writeString(struct.ownerName);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }