public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); case HAS_MORE_ROWS: return Boolean.valueOf(isHasMoreRows()); case RESULTS: return getResults(); } throw new IllegalStateException(); }
public TFetchResultsResp deepCopy() { return new TFetchResultsResp(this); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof TFetchResultsResp) return this.equals((TFetchResultsResp)that); return false; }
/** 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 STATUS: return isSetStatus(); case HAS_MORE_ROWS: return isSetHasMoreRows(); case RESULTS: return isSetResults(); } throw new IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { unsetStatus(); } else { setStatus((TStatus)value); } break; case HAS_MORE_ROWS: if (value == null) { unsetHasMoreRows(); } else { setHasMoreRows((Boolean)value); } break; case RESULTS: if (value == null) { unsetResults(); } else { setResults((TRowSet)value); } break; } }
Utils.verifySuccessWithInfo(fetchResp.getStatus()); TRowSet results = fetchResp.getResults(); fetchedRows = RowSetFactory.create(results, protocol); fetchedRowsItr = fetchedRows.iterator();
@Override public TFetchResultsResp FetchResults(TFetchResultsReq req) throws TException { TFetchResultsResp resp = new TFetchResultsResp(); try { RowSet rowSet = cliService.fetchResults( new OperationHandle(req.getOperationHandle()), FetchOrientation.getFetchOrientation(req.getOrientation()), req.getMaxRows(), FetchType.getFetchType(req.getFetchType())); resp.setResults(rowSet.toTRowSet()); resp.setHasMoreRows(false); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error fetching results: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchResultsResp struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.status != null) { oprot.writeFieldBegin(STATUS_FIELD_DESC); struct.status.write(oprot); oprot.writeFieldEnd(); } if (struct.isSetHasMoreRows()) { oprot.writeFieldBegin(HAS_MORE_ROWS_FIELD_DESC); oprot.writeBool(struct.hasMoreRows); oprot.writeFieldEnd(); } if (struct.results != null) { if (struct.isSetResults()) { oprot.writeFieldBegin(RESULTS_FIELD_DESC); struct.results.write(oprot); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TFetchResultsResp(); struct.success.read(iprot); struct.setSuccessIsSet(true); } } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); BitSet optionals = new BitSet(); if (struct.isSetHasMoreRows()) { optionals.set(0); } if (struct.isSetResults()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetHasMoreRows()) { oprot.writeBool(struct.hasMoreRows); } if (struct.isSetResults()) { struct.results.write(oprot); } }
/** * Performs a deep copy on <i>other</i>. */ public TFetchResultsResp(TFetchResultsResp other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetStatus()) { this.status = new TStatus(other.status); } this.hasMoreRows = other.hasMoreRows; if (other.isSetResults()) { this.results = new TRowSet(other.results); } }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetStatus()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); } // check for sub-struct validity if (status != null) { status.validate(); } if (results != null) { results.validate(); } }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; 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); } }
/** 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 STATUS: return isSetStatus(); case HAS_MORE_ROWS: return isSetHasMoreRows(); case RESULTS: return isSetResults(); } throw new IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { unsetStatus(); } else { setStatus((TStatus)value); } break; case HAS_MORE_ROWS: if (value == null) { unsetHasMoreRows(); } else { setHasMoreRows((Boolean)value); } break; case RESULTS: if (value == null) { unsetResults(); } else { setResults((TRowSet)value); } break; } }
Utils.verifySuccessWithInfo(fetchResp.getStatus()); TRowSet results = fetchResp.getResults(); fetchedRows = RowSetFactory.create(results, protocol); fetchedRowsItr = fetchedRows.iterator();
@Override public TFetchResultsResp FetchResults(TFetchResultsReq req) throws TException { TFetchResultsResp resp = new TFetchResultsResp(); try { RowSet rowSet = cliService.fetchResults( new OperationHandle(req.getOperationHandle()), FetchOrientation.getFetchOrientation(req.getOrientation()), req.getMaxRows(), FetchType.getFetchType(req.getFetchType())); resp.setResults(rowSet.toTRowSet()); resp.setHasMoreRows(false); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error fetching results: ", e); resp.setStatus(HiveSQLException.toTStatus(e)); } return resp; }
public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchResultsResp struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.status != null) { oprot.writeFieldBegin(STATUS_FIELD_DESC); struct.status.write(oprot); oprot.writeFieldEnd(); } if (struct.isSetHasMoreRows()) { oprot.writeFieldBegin(HAS_MORE_ROWS_FIELD_DESC); oprot.writeBool(struct.hasMoreRows); oprot.writeFieldEnd(); } if (struct.results != null) { if (struct.isSetResults()) { oprot.writeFieldBegin(RESULTS_FIELD_DESC); struct.results.write(oprot); oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TFetchResultsResp(); struct.success.read(iprot); struct.setSuccessIsSet(true); } } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); BitSet optionals = new BitSet(); if (struct.isSetHasMoreRows()) { optionals.set(0); } if (struct.isSetResults()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetHasMoreRows()) { oprot.writeBool(struct.hasMoreRows); } if (struct.isSetResults()) { struct.results.write(oprot); } }