Ejemplo n.º 1
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, TblPriv struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.db != null) {
        oprot.writeFieldBegin(DB_FIELD_DESC);
        oprot.writeString(struct.db);
        oprot.writeFieldEnd();
      }
      if (struct.tbl != null) {
        oprot.writeFieldBegin(TBL_FIELD_DESC);
        oprot.writeString(struct.tbl);
        oprot.writeFieldEnd();
      }
      if (struct.user != null) {
        oprot.writeFieldBegin(USER_FIELD_DESC);
        oprot.writeString(struct.user);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(SELECT_PRIV_FIELD_DESC);
      oprot.writeBool(struct.selectPriv);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(INSERT_PRIV_FIELD_DESC);
      oprot.writeBool(struct.insertPriv);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(INDEX_PRIV_FIELD_DESC);
      oprot.writeBool(struct.indexPriv);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(CREATE_PRIV_FIELD_DESC);
      oprot.writeBool(struct.createPriv);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(DROP_PRIV_FIELD_DESC);
      oprot.writeBool(struct.dropPriv);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(DELETE_PRIV_FIELD_DESC);
      oprot.writeBool(struct.deletePriv);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(ALTER_PRIV_FIELD_DESC);
      oprot.writeBool(struct.alterPriv);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(UPDATE_PRIV_FIELD_DESC);
      oprot.writeBool(struct.updatePriv);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Ejemplo n.º 2
0
 public void read(org.apache.thrift.protocol.TProtocol iprot, TblPriv 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:
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.db = iprot.readString();
           struct.setDbIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 2:
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.tbl = iprot.readString();
           struct.setTblIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 3:
         if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
           struct.user = iprot.readString();
           struct.setUserIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 4:
         if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
           struct.selectPriv = iprot.readBool();
           struct.setSelectPrivIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 5:
         if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
           struct.insertPriv = iprot.readBool();
           struct.setInsertPrivIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 6:
         if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
           struct.indexPriv = iprot.readBool();
           struct.setIndexPrivIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 7:
         if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
           struct.createPriv = iprot.readBool();
           struct.setCreatePrivIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 8:
         if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
           struct.dropPriv = iprot.readBool();
           struct.setDropPrivIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 9:
         if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
           struct.deletePriv = iprot.readBool();
           struct.setDeletePrivIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 10:
         if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
           struct.alterPriv = iprot.readBool();
           struct.setAlterPrivIsSet(true);
         } else {
           org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
         break;
       case 11:
         if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
           struct.updatePriv = iprot.readBool();
           struct.setUpdatePrivIsSet(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();
 }