Back to home page

OSCL-LXR

 
 

    


0001 /**
0002  * Autogenerated by Thrift Compiler (0.9.3)
0003  *
0004  * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
0005  *  @generated
0006  */
0007 package org.apache.hive.service.rpc.thrift;
0008 
0009 import org.apache.thrift.scheme.IScheme;
0010 import org.apache.thrift.scheme.SchemeFactory;
0011 import org.apache.thrift.scheme.StandardScheme;
0012 
0013 import org.apache.thrift.scheme.TupleScheme;
0014 import org.apache.thrift.protocol.TTupleProtocol;
0015 import org.apache.thrift.protocol.TProtocolException;
0016 import org.apache.thrift.EncodingUtils;
0017 import org.apache.thrift.TException;
0018 import org.apache.thrift.async.AsyncMethodCallback;
0019 import org.apache.thrift.server.AbstractNonblockingServer.*;
0020 import java.util.List;
0021 import java.util.ArrayList;
0022 import java.util.Map;
0023 import java.util.HashMap;
0024 import java.util.EnumMap;
0025 import java.util.Set;
0026 import java.util.HashSet;
0027 import java.util.EnumSet;
0028 import java.util.Collections;
0029 import java.util.BitSet;
0030 import java.nio.ByteBuffer;
0031 import java.util.Arrays;
0032 import javax.annotation.Generated;
0033 import org.slf4j.Logger;
0034 import org.slf4j.LoggerFactory;
0035 
0036 @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
0037 @Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
0038 public class TCancelOperationReq implements org.apache.thrift.TBase<TCancelOperationReq, TCancelOperationReq._Fields>, java.io.Serializable, Cloneable, Comparable<TCancelOperationReq> {
0039   private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationReq");
0040 
0041   private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1);
0042 
0043   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
0044   static {
0045     schemes.put(StandardScheme.class, new TCancelOperationReqStandardSchemeFactory());
0046     schemes.put(TupleScheme.class, new TCancelOperationReqTupleSchemeFactory());
0047   }
0048 
0049   private TOperationHandle operationHandle; // required
0050 
0051   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
0052   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
0053     OPERATION_HANDLE((short)1, "operationHandle");
0054 
0055     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
0056 
0057     static {
0058       for (_Fields field : EnumSet.allOf(_Fields.class)) {
0059         byName.put(field.getFieldName(), field);
0060       }
0061     }
0062 
0063     /**
0064      * Find the _Fields constant that matches fieldId, or null if its not found.
0065      */
0066     public static _Fields findByThriftId(int fieldId) {
0067       switch(fieldId) {
0068         case 1: // OPERATION_HANDLE
0069           return OPERATION_HANDLE;
0070         default:
0071           return null;
0072       }
0073     }
0074 
0075     /**
0076      * Find the _Fields constant that matches fieldId, throwing an exception
0077      * if it is not found.
0078      */
0079     public static _Fields findByThriftIdOrThrow(int fieldId) {
0080       _Fields fields = findByThriftId(fieldId);
0081       if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
0082       return fields;
0083     }
0084 
0085     /**
0086      * Find the _Fields constant that matches name, or null if its not found.
0087      */
0088     public static _Fields findByName(String name) {
0089       return byName.get(name);
0090     }
0091 
0092     private final short _thriftId;
0093     private final String _fieldName;
0094 
0095     _Fields(short thriftId, String fieldName) {
0096       _thriftId = thriftId;
0097       _fieldName = fieldName;
0098     }
0099 
0100     public short getThriftFieldId() {
0101       return _thriftId;
0102     }
0103 
0104     public String getFieldName() {
0105       return _fieldName;
0106     }
0107   }
0108 
0109   // isset id assignments
0110   public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
0111   static {
0112     Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
0113     tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, 
0114         new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class)));
0115     metaDataMap = Collections.unmodifiableMap(tmpMap);
0116     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationReq.class, metaDataMap);
0117   }
0118 
0119   public TCancelOperationReq() {
0120   }
0121 
0122   public TCancelOperationReq(
0123     TOperationHandle operationHandle)
0124   {
0125     this();
0126     this.operationHandle = operationHandle;
0127   }
0128 
0129   /**
0130    * Performs a deep copy on <i>other</i>.
0131    */
0132   public TCancelOperationReq(TCancelOperationReq other) {
0133     if (other.isSetOperationHandle()) {
0134       this.operationHandle = new TOperationHandle(other.operationHandle);
0135     }
0136   }
0137 
0138   public TCancelOperationReq deepCopy() {
0139     return new TCancelOperationReq(this);
0140   }
0141 
0142   @Override
0143   public void clear() {
0144     this.operationHandle = null;
0145   }
0146 
0147   public TOperationHandle getOperationHandle() {
0148     return this.operationHandle;
0149   }
0150 
0151   public void setOperationHandle(TOperationHandle operationHandle) {
0152     this.operationHandle = operationHandle;
0153   }
0154 
0155   public void unsetOperationHandle() {
0156     this.operationHandle = null;
0157   }
0158 
0159   /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */
0160   public boolean isSetOperationHandle() {
0161     return this.operationHandle != null;
0162   }
0163 
0164   public void setOperationHandleIsSet(boolean value) {
0165     if (!value) {
0166       this.operationHandle = null;
0167     }
0168   }
0169 
0170   public void setFieldValue(_Fields field, Object value) {
0171     switch (field) {
0172     case OPERATION_HANDLE:
0173       if (value == null) {
0174         unsetOperationHandle();
0175       } else {
0176         setOperationHandle((TOperationHandle)value);
0177       }
0178       break;
0179 
0180     }
0181   }
0182 
0183   public Object getFieldValue(_Fields field) {
0184     switch (field) {
0185     case OPERATION_HANDLE:
0186       return getOperationHandle();
0187 
0188     }
0189     throw new IllegalStateException();
0190   }
0191 
0192   /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
0193   public boolean isSet(_Fields field) {
0194     if (field == null) {
0195       throw new IllegalArgumentException();
0196     }
0197 
0198     switch (field) {
0199     case OPERATION_HANDLE:
0200       return isSetOperationHandle();
0201     }
0202     throw new IllegalStateException();
0203   }
0204 
0205   @Override
0206   public boolean equals(Object that) {
0207     if (that == null)
0208       return false;
0209     if (that instanceof TCancelOperationReq)
0210       return this.equals((TCancelOperationReq)that);
0211     return false;
0212   }
0213 
0214   public boolean equals(TCancelOperationReq that) {
0215     if (that == null)
0216       return false;
0217 
0218     boolean this_present_operationHandle = true && this.isSetOperationHandle();
0219     boolean that_present_operationHandle = true && that.isSetOperationHandle();
0220     if (this_present_operationHandle || that_present_operationHandle) {
0221       if (!(this_present_operationHandle && that_present_operationHandle))
0222         return false;
0223       if (!this.operationHandle.equals(that.operationHandle))
0224         return false;
0225     }
0226 
0227     return true;
0228   }
0229 
0230   @Override
0231   public int hashCode() {
0232     List<Object> list = new ArrayList<Object>();
0233 
0234     boolean present_operationHandle = true && (isSetOperationHandle());
0235     list.add(present_operationHandle);
0236     if (present_operationHandle)
0237       list.add(operationHandle);
0238 
0239     return list.hashCode();
0240   }
0241 
0242   @Override
0243   public int compareTo(TCancelOperationReq other) {
0244     if (!getClass().equals(other.getClass())) {
0245       return getClass().getName().compareTo(other.getClass().getName());
0246     }
0247 
0248     int lastComparison = 0;
0249 
0250     lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle());
0251     if (lastComparison != 0) {
0252       return lastComparison;
0253     }
0254     if (isSetOperationHandle()) {
0255       lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle);
0256       if (lastComparison != 0) {
0257         return lastComparison;
0258       }
0259     }
0260     return 0;
0261   }
0262 
0263   public _Fields fieldForId(int fieldId) {
0264     return _Fields.findByThriftId(fieldId);
0265   }
0266 
0267   public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
0268     schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
0269   }
0270 
0271   public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
0272     schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
0273   }
0274 
0275   @Override
0276   public String toString() {
0277     StringBuilder sb = new StringBuilder("TCancelOperationReq(");
0278     boolean first = true;
0279 
0280     sb.append("operationHandle:");
0281     if (this.operationHandle == null) {
0282       sb.append("null");
0283     } else {
0284       sb.append(this.operationHandle);
0285     }
0286     first = false;
0287     sb.append(")");
0288     return sb.toString();
0289   }
0290 
0291   public void validate() throws org.apache.thrift.TException {
0292     // check for required fields
0293     if (!isSetOperationHandle()) {
0294       throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString());
0295     }
0296 
0297     // check for sub-struct validity
0298     if (operationHandle != null) {
0299       operationHandle.validate();
0300     }
0301   }
0302 
0303   private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
0304     try {
0305       write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
0306     } catch (org.apache.thrift.TException te) {
0307       throw new java.io.IOException(te);
0308     }
0309   }
0310 
0311   private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
0312     try {
0313       read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
0314     } catch (org.apache.thrift.TException te) {
0315       throw new java.io.IOException(te);
0316     }
0317   }
0318 
0319   private static class TCancelOperationReqStandardSchemeFactory implements SchemeFactory {
0320     public TCancelOperationReqStandardScheme getScheme() {
0321       return new TCancelOperationReqStandardScheme();
0322     }
0323   }
0324 
0325   private static class TCancelOperationReqStandardScheme extends StandardScheme<TCancelOperationReq> {
0326 
0327     public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationReq struct) throws org.apache.thrift.TException {
0328       org.apache.thrift.protocol.TField schemeField;
0329       iprot.readStructBegin();
0330       while (true)
0331       {
0332         schemeField = iprot.readFieldBegin();
0333         if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
0334           break;
0335         }
0336         switch (schemeField.id) {
0337           case 1: // OPERATION_HANDLE
0338             if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
0339               struct.operationHandle = new TOperationHandle();
0340               struct.operationHandle.read(iprot);
0341               struct.setOperationHandleIsSet(true);
0342             } else { 
0343               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0344             }
0345             break;
0346           default:
0347             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
0348         }
0349         iprot.readFieldEnd();
0350       }
0351       iprot.readStructEnd();
0352       struct.validate();
0353     }
0354 
0355     public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelOperationReq struct) throws org.apache.thrift.TException {
0356       struct.validate();
0357 
0358       oprot.writeStructBegin(STRUCT_DESC);
0359       if (struct.operationHandle != null) {
0360         oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC);
0361         struct.operationHandle.write(oprot);
0362         oprot.writeFieldEnd();
0363       }
0364       oprot.writeFieldStop();
0365       oprot.writeStructEnd();
0366     }
0367 
0368   }
0369 
0370   private static class TCancelOperationReqTupleSchemeFactory implements SchemeFactory {
0371     public TCancelOperationReqTupleScheme getScheme() {
0372       return new TCancelOperationReqTupleScheme();
0373     }
0374   }
0375 
0376   private static class TCancelOperationReqTupleScheme extends TupleScheme<TCancelOperationReq> {
0377 
0378     @Override
0379     public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException {
0380       TTupleProtocol oprot = (TTupleProtocol) prot;
0381       struct.operationHandle.write(oprot);
0382     }
0383 
0384     @Override
0385     public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException {
0386       TTupleProtocol iprot = (TTupleProtocol) prot;
0387       struct.operationHandle = new TOperationHandle();
0388       struct.operationHandle.read(iprot);
0389       struct.setOperationHandleIsSet(true);
0390     }
0391   }
0392 
0393 }
0394