public TCancelOperationReq deepCopy() { return new TCancelOperationReq(this); }
public Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); } throw new IllegalStateException(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof TCancelOperationReq) return this.equals((TCancelOperationReq)that); return false; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { unsetOperationHandle(); } else { setOperationHandle((TOperationHandle)value); } break; } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TCancelOperationReq(); struct.req.read(iprot); struct.setReqIsSet(true); } } }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetOperationHandle()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); } // check for sub-struct validity if (operationHandle != null) { operationHandle.validate(); } }
public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationReq 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: // OPERATION_HANDLE if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(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(); }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case OPERATION_HANDLE: return isSetOperationHandle(); } throw new IllegalStateException(); }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); } }
public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_args 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: // REQ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.req = new TCancelOperationReq(); struct.req.read(iprot); struct.setReqIsSet(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(); }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_operationHandle = true && (isSetOperationHandle()); list.add(present_operationHandle); if (present_operationHandle) list.add(operationHandle); return list.hashCode(); }
/** * Performs a deep copy on <i>other</i>. */ public CancelOperation_args(CancelOperation_args other) { if (other.isSetReq()) { this.req = new TCancelOperationReq(other.req); } }
@Override public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException { TCancelOperationResp resp = new TCancelOperationResp(); try { cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error cancelling operation: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
public boolean equals(TCancelOperationReq that) { if (that == null) return false; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); if (this_present_operationHandle || that_present_operationHandle) { if (!(this_present_operationHandle && that_present_operationHandle)) return false; if (!this.operationHandle.equals(that.operationHandle)) return false; } return true; }
public boolean equals(CancelOperation_args that) { if (that == null) return false; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); if (this_present_req || that_present_req) { if (!(this_present_req && that_present_req)) return false; if (!this.req.equals(that.req)) return false; } return true; }
@Override public void cancel() throws SQLException { checkConnection("cancel"); if (isCancelled) { return; } try { if (stmtHandle != null) { TCancelOperationReq cancelReq = new TCancelOperationReq(stmtHandle); TCancelOperationResp cancelResp = client.CancelOperation(cancelReq); Utils.verifySuccessWithInfo(cancelResp.getStatus()); } } catch (SQLException e) { throw e; } catch (Exception e) { throw new SQLException(e.toString(), "08S01", e); } isCancelled = true; }
@Override public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException { TCancelOperationResp resp = new TCancelOperationResp(); try { cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error cancelling operation: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
/** * Performs a deep copy on <i>other</i>. */ public TCancelOperationReq(TCancelOperationReq other) { if (other.isSetOperationHandle()) { this.operationHandle = new TOperationHandle(other.operationHandle); } }
@Override public void cancelOperation(OperationHandle opHandle) throws HiveSQLException { try { TCancelOperationReq req = new TCancelOperationReq(opHandle.toTOperationHandle()); TCancelOperationResp resp = cliService.CancelOperation(req); checkStatus(resp.getStatus()); } catch (HiveSQLException e) { throw e; } catch (Exception e) { throw new HiveSQLException(e); } }