You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2017/02/07 20:59:34 UTC
[66/70] [abbrv] hive git commit: HIVE-15473: Progress Bar on Beeline
client (Anishek Agarwal via Thejas Nair)
http://git-wip-us.apache.org/repos/asf/hive/blob/3e01ef32/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetOperationStatusResp.java
----------------------------------------------------------------------
diff --git a/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetOperationStatusResp.java b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetOperationStatusResp.java
index b981368..dbfbb44 100644
--- a/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetOperationStatusResp.java
+++ b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TGetOperationStatusResp.java
@@ -47,6 +47,7 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
private static final org.apache.thrift.protocol.TField OPERATION_STARTED_FIELD_DESC = new org.apache.thrift.protocol.TField("operationStarted", org.apache.thrift.protocol.TType.I64, (short)7);
private static final org.apache.thrift.protocol.TField OPERATION_COMPLETED_FIELD_DESC = new org.apache.thrift.protocol.TField("operationCompleted", org.apache.thrift.protocol.TType.I64, (short)8);
private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)9);
+ private static final org.apache.thrift.protocol.TField PROGRESS_UPDATE_RESPONSE_FIELD_DESC = new org.apache.thrift.protocol.TField("progressUpdateResponse", org.apache.thrift.protocol.TType.STRUCT, (short)10);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
@@ -63,6 +64,7 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
private long operationStarted; // optional
private long operationCompleted; // optional
private boolean hasResultSet; // optional
+ private TProgressUpdateResp progressUpdateResponse; // optional
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -78,7 +80,8 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
TASK_STATUS((short)6, "taskStatus"),
OPERATION_STARTED((short)7, "operationStarted"),
OPERATION_COMPLETED((short)8, "operationCompleted"),
- HAS_RESULT_SET((short)9, "hasResultSet");
+ HAS_RESULT_SET((short)9, "hasResultSet"),
+ PROGRESS_UPDATE_RESPONSE((short)10, "progressUpdateResponse");
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
@@ -111,6 +114,8 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
return OPERATION_COMPLETED;
case 9: // HAS_RESULT_SET
return HAS_RESULT_SET;
+ case 10: // PROGRESS_UPDATE_RESPONSE
+ return PROGRESS_UPDATE_RESPONSE;
default:
return null;
}
@@ -156,7 +161,7 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
private static final int __OPERATIONCOMPLETED_ISSET_ID = 2;
private static final int __HASRESULTSET_ISSET_ID = 3;
private byte __isset_bitfield = 0;
- private static final _Fields optionals[] = {_Fields.OPERATION_STATE,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE,_Fields.TASK_STATUS,_Fields.OPERATION_STARTED,_Fields.OPERATION_COMPLETED,_Fields.HAS_RESULT_SET};
+ private static final _Fields optionals[] = {_Fields.OPERATION_STATE,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE,_Fields.TASK_STATUS,_Fields.OPERATION_STARTED,_Fields.OPERATION_COMPLETED,_Fields.HAS_RESULT_SET,_Fields.PROGRESS_UPDATE_RESPONSE};
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
@@ -178,6 +183,8 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.OPTIONAL,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
+ tmpMap.put(_Fields.PROGRESS_UPDATE_RESPONSE, new org.apache.thrift.meta_data.FieldMetaData("progressUpdateResponse", org.apache.thrift.TFieldRequirementType.OPTIONAL,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "TProgressUpdateResp")));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusResp.class, metaDataMap);
}
@@ -216,6 +223,9 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
this.operationStarted = other.operationStarted;
this.operationCompleted = other.operationCompleted;
this.hasResultSet = other.hasResultSet;
+ if (other.isSetProgressUpdateResponse()) {
+ this.progressUpdateResponse = other.progressUpdateResponse;
+ }
}
public TGetOperationStatusResp deepCopy() {
@@ -237,6 +247,7 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
this.operationCompleted = 0;
setHasResultSetIsSet(false);
this.hasResultSet = false;
+ this.progressUpdateResponse = null;
}
public TStatus getStatus() {
@@ -450,6 +461,29 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value);
}
+ public TProgressUpdateResp getProgressUpdateResponse() {
+ return this.progressUpdateResponse;
+ }
+
+ public void setProgressUpdateResponse(TProgressUpdateResp progressUpdateResponse) {
+ this.progressUpdateResponse = progressUpdateResponse;
+ }
+
+ public void unsetProgressUpdateResponse() {
+ this.progressUpdateResponse = null;
+ }
+
+ /** Returns true if field progressUpdateResponse is set (has been assigned a value) and false otherwise */
+ public boolean isSetProgressUpdateResponse() {
+ return this.progressUpdateResponse != null;
+ }
+
+ public void setProgressUpdateResponseIsSet(boolean value) {
+ if (!value) {
+ this.progressUpdateResponse = null;
+ }
+ }
+
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case STATUS:
@@ -524,6 +558,14 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
}
break;
+ case PROGRESS_UPDATE_RESPONSE:
+ if (value == null) {
+ unsetProgressUpdateResponse();
+ } else {
+ setProgressUpdateResponse((TProgressUpdateResp)value);
+ }
+ break;
+
}
}
@@ -556,6 +598,9 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
case HAS_RESULT_SET:
return isHasResultSet();
+ case PROGRESS_UPDATE_RESPONSE:
+ return getProgressUpdateResponse();
+
}
throw new IllegalStateException();
}
@@ -585,6 +630,8 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
return isSetOperationCompleted();
case HAS_RESULT_SET:
return isSetHasResultSet();
+ case PROGRESS_UPDATE_RESPONSE:
+ return isSetProgressUpdateResponse();
}
throw new IllegalStateException();
}
@@ -683,6 +730,15 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
return false;
}
+ boolean this_present_progressUpdateResponse = true && this.isSetProgressUpdateResponse();
+ boolean that_present_progressUpdateResponse = true && that.isSetProgressUpdateResponse();
+ if (this_present_progressUpdateResponse || that_present_progressUpdateResponse) {
+ if (!(this_present_progressUpdateResponse && that_present_progressUpdateResponse))
+ return false;
+ if (!this.progressUpdateResponse.equals(that.progressUpdateResponse))
+ return false;
+ }
+
return true;
}
@@ -735,6 +791,11 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
if (present_hasResultSet)
list.add(hasResultSet);
+ boolean present_progressUpdateResponse = true && (isSetProgressUpdateResponse());
+ list.add(present_progressUpdateResponse);
+ if (present_progressUpdateResponse)
+ list.add(progressUpdateResponse);
+
return list.hashCode();
}
@@ -836,6 +897,16 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
return lastComparison;
}
}
+ lastComparison = Boolean.valueOf(isSetProgressUpdateResponse()).compareTo(other.isSetProgressUpdateResponse());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetProgressUpdateResponse()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.progressUpdateResponse, other.progressUpdateResponse);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
return 0;
}
@@ -927,6 +998,16 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
sb.append(this.hasResultSet);
first = false;
}
+ if (isSetProgressUpdateResponse()) {
+ if (!first) sb.append(", ");
+ sb.append("progressUpdateResponse:");
+ if (this.progressUpdateResponse == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.progressUpdateResponse);
+ }
+ first = false;
+ }
sb.append(")");
return sb.toString();
}
@@ -1052,6 +1133,15 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
+ case 10: // PROGRESS_UPDATE_RESPONSE
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
+ struct.progressUpdateResponse = new TProgressUpdateResp();
+ struct.progressUpdateResponse.read(iprot);
+ struct.setProgressUpdateResponseIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
default:
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
@@ -1118,6 +1208,13 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
oprot.writeBool(struct.hasResultSet);
oprot.writeFieldEnd();
}
+ if (struct.progressUpdateResponse != null) {
+ if (struct.isSetProgressUpdateResponse()) {
+ oprot.writeFieldBegin(PROGRESS_UPDATE_RESPONSE_FIELD_DESC);
+ struct.progressUpdateResponse.write(oprot);
+ oprot.writeFieldEnd();
+ }
+ }
oprot.writeFieldStop();
oprot.writeStructEnd();
}
@@ -1161,7 +1258,10 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
if (struct.isSetHasResultSet()) {
optionals.set(7);
}
- oprot.writeBitSet(optionals, 8);
+ if (struct.isSetProgressUpdateResponse()) {
+ optionals.set(8);
+ }
+ oprot.writeBitSet(optionals, 9);
if (struct.isSetOperationState()) {
oprot.writeI32(struct.operationState.getValue());
}
@@ -1186,6 +1286,9 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
if (struct.isSetHasResultSet()) {
oprot.writeBool(struct.hasResultSet);
}
+ if (struct.isSetProgressUpdateResponse()) {
+ struct.progressUpdateResponse.write(oprot);
+ }
}
@Override
@@ -1194,7 +1297,7 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
struct.status = new TStatus();
struct.status.read(iprot);
struct.setStatusIsSet(true);
- BitSet incoming = iprot.readBitSet(8);
+ BitSet incoming = iprot.readBitSet(9);
if (incoming.get(0)) {
struct.operationState = org.apache.hive.service.rpc.thrift.TOperationState.findByValue(iprot.readI32());
struct.setOperationStateIsSet(true);
@@ -1227,6 +1330,11 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase<TGetOper
struct.hasResultSet = iprot.readBool();
struct.setHasResultSetIsSet(true);
}
+ if (incoming.get(8)) {
+ struct.progressUpdateResponse = new TProgressUpdateResp();
+ struct.progressUpdateResponse.read(iprot);
+ struct.setProgressUpdateResponseIsSet(true);
+ }
}
}
http://git-wip-us.apache.org/repos/asf/hive/blob/3e01ef32/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TJobExecutionStatus.java
----------------------------------------------------------------------
diff --git a/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TJobExecutionStatus.java b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TJobExecutionStatus.java
new file mode 100644
index 0000000..b39f208
--- /dev/null
+++ b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TJobExecutionStatus.java
@@ -0,0 +1,48 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.hive.service.rpc.thrift;
+
+
+import java.util.Map;
+import java.util.HashMap;
+import org.apache.thrift.TEnum;
+
+public enum TJobExecutionStatus implements org.apache.thrift.TEnum {
+ IN_PROGRESS(0),
+ COMPLETE(1),
+ NOT_AVAILABLE(2);
+
+ private final int value;
+
+ private TJobExecutionStatus(int value) {
+ this.value = value;
+ }
+
+ /**
+ * Get the integer value of this enum value, as defined in the Thrift IDL.
+ */
+ public int getValue() {
+ return value;
+ }
+
+ /**
+ * Find a the enum type by its integer value, as defined in the Thrift IDL.
+ * @return null if the value is not found.
+ */
+ public static TJobExecutionStatus findByValue(int value) {
+ switch (value) {
+ case 0:
+ return IN_PROGRESS;
+ case 1:
+ return COMPLETE;
+ case 2:
+ return NOT_AVAILABLE;
+ default:
+ return null;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/hive/blob/3e01ef32/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TProgressUpdateResp.java
----------------------------------------------------------------------
diff --git a/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TProgressUpdateResp.java b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TProgressUpdateResp.java
new file mode 100644
index 0000000..ecc413a
--- /dev/null
+++ b/service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TProgressUpdateResp.java
@@ -0,0 +1,1033 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.3)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ * @generated
+ */
+package org.apache.hive.service.rpc.thrift;
+
+import org.apache.thrift.scheme.IScheme;
+import org.apache.thrift.scheme.SchemeFactory;
+import org.apache.thrift.scheme.StandardScheme;
+
+import org.apache.thrift.scheme.TupleScheme;
+import org.apache.thrift.protocol.TTupleProtocol;
+import org.apache.thrift.protocol.TProtocolException;
+import org.apache.thrift.EncodingUtils;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.server.AbstractNonblockingServer.*;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.EnumMap;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.EnumSet;
+import java.util.Collections;
+import java.util.BitSet;
+import java.nio.ByteBuffer;
+import java.util.Arrays;
+import javax.annotation.Generated;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
+@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
+public class TProgressUpdateResp implements org.apache.thrift.TBase<TProgressUpdateResp, TProgressUpdateResp._Fields>, java.io.Serializable, Cloneable, Comparable<TProgressUpdateResp> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TProgressUpdateResp");
+
+ private static final org.apache.thrift.protocol.TField HEADER_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("headerNames", org.apache.thrift.protocol.TType.LIST, (short)1);
+ private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2);
+ private static final org.apache.thrift.protocol.TField PROGRESSED_PERCENTAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("progressedPercentage", org.apache.thrift.protocol.TType.DOUBLE, (short)3);
+ private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)4);
+ private static final org.apache.thrift.protocol.TField FOOTER_SUMMARY_FIELD_DESC = new org.apache.thrift.protocol.TField("footerSummary", org.apache.thrift.protocol.TType.STRING, (short)5);
+ private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)6);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new TProgressUpdateRespStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new TProgressUpdateRespTupleSchemeFactory());
+ }
+
+ private List<String> headerNames; // required
+ private List<List<String>> rows; // required
+ private double progressedPercentage; // required
+ private TJobExecutionStatus status; // required
+ private String footerSummary; // required
+ private long startTime; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ HEADER_NAMES((short)1, "headerNames"),
+ ROWS((short)2, "rows"),
+ PROGRESSED_PERCENTAGE((short)3, "progressedPercentage"),
+ /**
+ *
+ * @see TJobExecutionStatus
+ */
+ STATUS((short)4, "status"),
+ FOOTER_SUMMARY((short)5, "footerSummary"),
+ START_TIME((short)6, "startTime");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // HEADER_NAMES
+ return HEADER_NAMES;
+ case 2: // ROWS
+ return ROWS;
+ case 3: // PROGRESSED_PERCENTAGE
+ return PROGRESSED_PERCENTAGE;
+ case 4: // STATUS
+ return STATUS;
+ case 5: // FOOTER_SUMMARY
+ return FOOTER_SUMMARY;
+ case 6: // START_TIME
+ return START_TIME;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ private static final int __PROGRESSEDPERCENTAGE_ISSET_ID = 0;
+ private static final int __STARTTIME_ISSET_ID = 1;
+ private byte __isset_bitfield = 0;
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.HEADER_NAMES, new org.apache.thrift.meta_data.FieldMetaData("headerNames", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
+ tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+ new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))));
+ tmpMap.put(_Fields.PROGRESSED_PERCENTAGE, new org.apache.thrift.meta_data.FieldMetaData("progressedPercentage", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)));
+ tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TJobExecutionStatus.class)));
+ tmpMap.put(_Fields.FOOTER_SUMMARY, new org.apache.thrift.meta_data.FieldMetaData("footerSummary", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
+ tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.REQUIRED,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TProgressUpdateResp.class, metaDataMap);
+ }
+
+ public TProgressUpdateResp() {
+ }
+
+ public TProgressUpdateResp(
+ List<String> headerNames,
+ List<List<String>> rows,
+ double progressedPercentage,
+ TJobExecutionStatus status,
+ String footerSummary,
+ long startTime)
+ {
+ this();
+ this.headerNames = headerNames;
+ this.rows = rows;
+ this.progressedPercentage = progressedPercentage;
+ setProgressedPercentageIsSet(true);
+ this.status = status;
+ this.footerSummary = footerSummary;
+ this.startTime = startTime;
+ setStartTimeIsSet(true);
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public TProgressUpdateResp(TProgressUpdateResp other) {
+ __isset_bitfield = other.__isset_bitfield;
+ if (other.isSetHeaderNames()) {
+ List<String> __this__headerNames = new ArrayList<String>(other.headerNames);
+ this.headerNames = __this__headerNames;
+ }
+ if (other.isSetRows()) {
+ List<List<String>> __this__rows = new ArrayList<List<String>>(other.rows.size());
+ for (List<String> other_element : other.rows) {
+ List<String> __this__rows_copy = new ArrayList<String>(other_element);
+ __this__rows.add(__this__rows_copy);
+ }
+ this.rows = __this__rows;
+ }
+ this.progressedPercentage = other.progressedPercentage;
+ if (other.isSetStatus()) {
+ this.status = other.status;
+ }
+ if (other.isSetFooterSummary()) {
+ this.footerSummary = other.footerSummary;
+ }
+ this.startTime = other.startTime;
+ }
+
+ public TProgressUpdateResp deepCopy() {
+ return new TProgressUpdateResp(this);
+ }
+
+ @Override
+ public void clear() {
+ this.headerNames = null;
+ this.rows = null;
+ setProgressedPercentageIsSet(false);
+ this.progressedPercentage = 0.0;
+ this.status = null;
+ this.footerSummary = null;
+ setStartTimeIsSet(false);
+ this.startTime = 0;
+ }
+
+ public int getHeaderNamesSize() {
+ return (this.headerNames == null) ? 0 : this.headerNames.size();
+ }
+
+ public java.util.Iterator<String> getHeaderNamesIterator() {
+ return (this.headerNames == null) ? null : this.headerNames.iterator();
+ }
+
+ public void addToHeaderNames(String elem) {
+ if (this.headerNames == null) {
+ this.headerNames = new ArrayList<String>();
+ }
+ this.headerNames.add(elem);
+ }
+
+ public List<String> getHeaderNames() {
+ return this.headerNames;
+ }
+
+ public void setHeaderNames(List<String> headerNames) {
+ this.headerNames = headerNames;
+ }
+
+ public void unsetHeaderNames() {
+ this.headerNames = null;
+ }
+
+ /** Returns true if field headerNames is set (has been assigned a value) and false otherwise */
+ public boolean isSetHeaderNames() {
+ return this.headerNames != null;
+ }
+
+ public void setHeaderNamesIsSet(boolean value) {
+ if (!value) {
+ this.headerNames = null;
+ }
+ }
+
+ public int getRowsSize() {
+ return (this.rows == null) ? 0 : this.rows.size();
+ }
+
+ public java.util.Iterator<List<String>> getRowsIterator() {
+ return (this.rows == null) ? null : this.rows.iterator();
+ }
+
+ public void addToRows(List<String> elem) {
+ if (this.rows == null) {
+ this.rows = new ArrayList<List<String>>();
+ }
+ this.rows.add(elem);
+ }
+
+ public List<List<String>> getRows() {
+ return this.rows;
+ }
+
+ public void setRows(List<List<String>> rows) {
+ this.rows = rows;
+ }
+
+ public void unsetRows() {
+ this.rows = null;
+ }
+
+ /** Returns true if field rows is set (has been assigned a value) and false otherwise */
+ public boolean isSetRows() {
+ return this.rows != null;
+ }
+
+ public void setRowsIsSet(boolean value) {
+ if (!value) {
+ this.rows = null;
+ }
+ }
+
+ public double getProgressedPercentage() {
+ return this.progressedPercentage;
+ }
+
+ public void setProgressedPercentage(double progressedPercentage) {
+ this.progressedPercentage = progressedPercentage;
+ setProgressedPercentageIsSet(true);
+ }
+
+ public void unsetProgressedPercentage() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID);
+ }
+
+ /** Returns true if field progressedPercentage is set (has been assigned a value) and false otherwise */
+ public boolean isSetProgressedPercentage() {
+ return EncodingUtils.testBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID);
+ }
+
+ public void setProgressedPercentageIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID, value);
+ }
+
+ /**
+ *
+ * @see TJobExecutionStatus
+ */
+ public TJobExecutionStatus getStatus() {
+ return this.status;
+ }
+
+ /**
+ *
+ * @see TJobExecutionStatus
+ */
+ public void setStatus(TJobExecutionStatus status) {
+ this.status = status;
+ }
+
+ public void unsetStatus() {
+ this.status = null;
+ }
+
+ /** Returns true if field status is set (has been assigned a value) and false otherwise */
+ public boolean isSetStatus() {
+ return this.status != null;
+ }
+
+ public void setStatusIsSet(boolean value) {
+ if (!value) {
+ this.status = null;
+ }
+ }
+
+ public String getFooterSummary() {
+ return this.footerSummary;
+ }
+
+ public void setFooterSummary(String footerSummary) {
+ this.footerSummary = footerSummary;
+ }
+
+ public void unsetFooterSummary() {
+ this.footerSummary = null;
+ }
+
+ /** Returns true if field footerSummary is set (has been assigned a value) and false otherwise */
+ public boolean isSetFooterSummary() {
+ return this.footerSummary != null;
+ }
+
+ public void setFooterSummaryIsSet(boolean value) {
+ if (!value) {
+ this.footerSummary = null;
+ }
+ }
+
+ public long getStartTime() {
+ return this.startTime;
+ }
+
+ public void setStartTime(long startTime) {
+ this.startTime = startTime;
+ setStartTimeIsSet(true);
+ }
+
+ public void unsetStartTime() {
+ __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID);
+ }
+
+ /** Returns true if field startTime is set (has been assigned a value) and false otherwise */
+ public boolean isSetStartTime() {
+ return EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID);
+ }
+
+ public void setStartTimeIsSet(boolean value) {
+ __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value);
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case HEADER_NAMES:
+ if (value == null) {
+ unsetHeaderNames();
+ } else {
+ setHeaderNames((List<String>)value);
+ }
+ break;
+
+ case ROWS:
+ if (value == null) {
+ unsetRows();
+ } else {
+ setRows((List<List<String>>)value);
+ }
+ break;
+
+ case PROGRESSED_PERCENTAGE:
+ if (value == null) {
+ unsetProgressedPercentage();
+ } else {
+ setProgressedPercentage((Double)value);
+ }
+ break;
+
+ case STATUS:
+ if (value == null) {
+ unsetStatus();
+ } else {
+ setStatus((TJobExecutionStatus)value);
+ }
+ break;
+
+ case FOOTER_SUMMARY:
+ if (value == null) {
+ unsetFooterSummary();
+ } else {
+ setFooterSummary((String)value);
+ }
+ break;
+
+ case START_TIME:
+ if (value == null) {
+ unsetStartTime();
+ } else {
+ setStartTime((Long)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case HEADER_NAMES:
+ return getHeaderNames();
+
+ case ROWS:
+ return getRows();
+
+ case PROGRESSED_PERCENTAGE:
+ return getProgressedPercentage();
+
+ case STATUS:
+ return getStatus();
+
+ case FOOTER_SUMMARY:
+ return getFooterSummary();
+
+ case START_TIME:
+ return getStartTime();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** 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 HEADER_NAMES:
+ return isSetHeaderNames();
+ case ROWS:
+ return isSetRows();
+ case PROGRESSED_PERCENTAGE:
+ return isSetProgressedPercentage();
+ case STATUS:
+ return isSetStatus();
+ case FOOTER_SUMMARY:
+ return isSetFooterSummary();
+ case START_TIME:
+ return isSetStartTime();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof TProgressUpdateResp)
+ return this.equals((TProgressUpdateResp)that);
+ return false;
+ }
+
+ public boolean equals(TProgressUpdateResp that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_headerNames = true && this.isSetHeaderNames();
+ boolean that_present_headerNames = true && that.isSetHeaderNames();
+ if (this_present_headerNames || that_present_headerNames) {
+ if (!(this_present_headerNames && that_present_headerNames))
+ return false;
+ if (!this.headerNames.equals(that.headerNames))
+ return false;
+ }
+
+ boolean this_present_rows = true && this.isSetRows();
+ boolean that_present_rows = true && that.isSetRows();
+ if (this_present_rows || that_present_rows) {
+ if (!(this_present_rows && that_present_rows))
+ return false;
+ if (!this.rows.equals(that.rows))
+ return false;
+ }
+
+ boolean this_present_progressedPercentage = true;
+ boolean that_present_progressedPercentage = true;
+ if (this_present_progressedPercentage || that_present_progressedPercentage) {
+ if (!(this_present_progressedPercentage && that_present_progressedPercentage))
+ return false;
+ if (this.progressedPercentage != that.progressedPercentage)
+ return false;
+ }
+
+ boolean this_present_status = true && this.isSetStatus();
+ boolean that_present_status = true && that.isSetStatus();
+ if (this_present_status || that_present_status) {
+ if (!(this_present_status && that_present_status))
+ return false;
+ if (!this.status.equals(that.status))
+ return false;
+ }
+
+ boolean this_present_footerSummary = true && this.isSetFooterSummary();
+ boolean that_present_footerSummary = true && that.isSetFooterSummary();
+ if (this_present_footerSummary || that_present_footerSummary) {
+ if (!(this_present_footerSummary && that_present_footerSummary))
+ return false;
+ if (!this.footerSummary.equals(that.footerSummary))
+ return false;
+ }
+
+ boolean this_present_startTime = true;
+ boolean that_present_startTime = true;
+ if (this_present_startTime || that_present_startTime) {
+ if (!(this_present_startTime && that_present_startTime))
+ return false;
+ if (this.startTime != that.startTime)
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ List<Object> list = new ArrayList<Object>();
+
+ boolean present_headerNames = true && (isSetHeaderNames());
+ list.add(present_headerNames);
+ if (present_headerNames)
+ list.add(headerNames);
+
+ boolean present_rows = true && (isSetRows());
+ list.add(present_rows);
+ if (present_rows)
+ list.add(rows);
+
+ boolean present_progressedPercentage = true;
+ list.add(present_progressedPercentage);
+ if (present_progressedPercentage)
+ list.add(progressedPercentage);
+
+ boolean present_status = true && (isSetStatus());
+ list.add(present_status);
+ if (present_status)
+ list.add(status.getValue());
+
+ boolean present_footerSummary = true && (isSetFooterSummary());
+ list.add(present_footerSummary);
+ if (present_footerSummary)
+ list.add(footerSummary);
+
+ boolean present_startTime = true;
+ list.add(present_startTime);
+ if (present_startTime)
+ list.add(startTime);
+
+ return list.hashCode();
+ }
+
+ @Override
+ public int compareTo(TProgressUpdateResp other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetHeaderNames()).compareTo(other.isSetHeaderNames());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetHeaderNames()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.headerNames, other.headerNames);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetRows()).compareTo(other.isSetRows());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetRows()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetProgressedPercentage()).compareTo(other.isSetProgressedPercentage());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetProgressedPercentage()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.progressedPercentage, other.progressedPercentage);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStatus()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetFooterSummary()).compareTo(other.isSetFooterSummary());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetFooterSummary()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.footerSummary, other.footerSummary);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetStartTime()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, other.startTime);
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ }
+ return 0;
+ }
+
+ public _Fields fieldForId(int fieldId) {
+ return _Fields.findByThriftId(fieldId);
+ }
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
+ schemes.get(iprot.getScheme()).getScheme().read(iprot, this);
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
+ schemes.get(oprot.getScheme()).getScheme().write(oprot, this);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("TProgressUpdateResp(");
+ boolean first = true;
+
+ sb.append("headerNames:");
+ if (this.headerNames == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.headerNames);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("rows:");
+ if (this.rows == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.rows);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("progressedPercentage:");
+ sb.append(this.progressedPercentage);
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("status:");
+ if (this.status == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.status);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("footerSummary:");
+ if (this.footerSummary == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.footerSummary);
+ }
+ first = false;
+ if (!first) sb.append(", ");
+ sb.append("startTime:");
+ sb.append(this.startTime);
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ if (!isSetHeaderNames()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'headerNames' is unset! Struct:" + toString());
+ }
+
+ if (!isSetRows()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'rows' is unset! Struct:" + toString());
+ }
+
+ if (!isSetProgressedPercentage()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'progressedPercentage' is unset! Struct:" + toString());
+ }
+
+ if (!isSetStatus()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString());
+ }
+
+ if (!isSetFooterSummary()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'footerSummary' is unset! Struct:" + toString());
+ }
+
+ if (!isSetStartTime()) {
+ throw new org.apache.thrift.protocol.TProtocolException("Required field 'startTime' is unset! Struct:" + toString());
+ }
+
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ 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);
+ }
+ }
+
+ private static class TProgressUpdateRespStandardSchemeFactory implements SchemeFactory {
+ public TProgressUpdateRespStandardScheme getScheme() {
+ return new TProgressUpdateRespStandardScheme();
+ }
+ }
+
+ private static class TProgressUpdateRespStandardScheme extends StandardScheme<TProgressUpdateResp> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, TProgressUpdateResp 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: // HEADER_NAMES
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list180 = iprot.readListBegin();
+ struct.headerNames = new ArrayList<String>(_list180.size);
+ String _elem181;
+ for (int _i182 = 0; _i182 < _list180.size; ++_i182)
+ {
+ _elem181 = iprot.readString();
+ struct.headerNames.add(_elem181);
+ }
+ iprot.readListEnd();
+ }
+ struct.setHeaderNamesIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 2: // ROWS
+ if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
+ {
+ org.apache.thrift.protocol.TList _list183 = iprot.readListBegin();
+ struct.rows = new ArrayList<List<String>>(_list183.size);
+ List<String> _elem184;
+ for (int _i185 = 0; _i185 < _list183.size; ++_i185)
+ {
+ {
+ org.apache.thrift.protocol.TList _list186 = iprot.readListBegin();
+ _elem184 = new ArrayList<String>(_list186.size);
+ String _elem187;
+ for (int _i188 = 0; _i188 < _list186.size; ++_i188)
+ {
+ _elem187 = iprot.readString();
+ _elem184.add(_elem187);
+ }
+ iprot.readListEnd();
+ }
+ struct.rows.add(_elem184);
+ }
+ iprot.readListEnd();
+ }
+ struct.setRowsIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 3: // PROGRESSED_PERCENTAGE
+ if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) {
+ struct.progressedPercentage = iprot.readDouble();
+ struct.setProgressedPercentageIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 4: // STATUS
+ if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
+ struct.status = org.apache.hive.service.rpc.thrift.TJobExecutionStatus.findByValue(iprot.readI32());
+ struct.setStatusIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 5: // FOOTER_SUMMARY
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.footerSummary = iprot.readString();
+ struct.setFooterSummaryIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ case 6: // START_TIME
+ if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
+ struct.startTime = iprot.readI64();
+ struct.setStartTimeIsSet(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();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, TProgressUpdateResp struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.headerNames != null) {
+ oprot.writeFieldBegin(HEADER_NAMES_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.headerNames.size()));
+ for (String _iter189 : struct.headerNames)
+ {
+ oprot.writeString(_iter189);
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ if (struct.rows != null) {
+ oprot.writeFieldBegin(ROWS_FIELD_DESC);
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.rows.size()));
+ for (List<String> _iter190 : struct.rows)
+ {
+ {
+ oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter190.size()));
+ for (String _iter191 : _iter190)
+ {
+ oprot.writeString(_iter191);
+ }
+ oprot.writeListEnd();
+ }
+ }
+ oprot.writeListEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(PROGRESSED_PERCENTAGE_FIELD_DESC);
+ oprot.writeDouble(struct.progressedPercentage);
+ oprot.writeFieldEnd();
+ if (struct.status != null) {
+ oprot.writeFieldBegin(STATUS_FIELD_DESC);
+ oprot.writeI32(struct.status.getValue());
+ oprot.writeFieldEnd();
+ }
+ if (struct.footerSummary != null) {
+ oprot.writeFieldBegin(FOOTER_SUMMARY_FIELD_DESC);
+ oprot.writeString(struct.footerSummary);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldBegin(START_TIME_FIELD_DESC);
+ oprot.writeI64(struct.startTime);
+ oprot.writeFieldEnd();
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class TProgressUpdateRespTupleSchemeFactory implements SchemeFactory {
+ public TProgressUpdateRespTupleScheme getScheme() {
+ return new TProgressUpdateRespTupleScheme();
+ }
+ }
+
+ private static class TProgressUpdateRespTupleScheme extends TupleScheme<TProgressUpdateResp> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ {
+ oprot.writeI32(struct.headerNames.size());
+ for (String _iter192 : struct.headerNames)
+ {
+ oprot.writeString(_iter192);
+ }
+ }
+ {
+ oprot.writeI32(struct.rows.size());
+ for (List<String> _iter193 : struct.rows)
+ {
+ {
+ oprot.writeI32(_iter193.size());
+ for (String _iter194 : _iter193)
+ {
+ oprot.writeString(_iter194);
+ }
+ }
+ }
+ }
+ oprot.writeDouble(struct.progressedPercentage);
+ oprot.writeI32(struct.status.getValue());
+ oprot.writeString(struct.footerSummary);
+ oprot.writeI64(struct.startTime);
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ {
+ org.apache.thrift.protocol.TList _list195 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.headerNames = new ArrayList<String>(_list195.size);
+ String _elem196;
+ for (int _i197 = 0; _i197 < _list195.size; ++_i197)
+ {
+ _elem196 = iprot.readString();
+ struct.headerNames.add(_elem196);
+ }
+ }
+ struct.setHeaderNamesIsSet(true);
+ {
+ org.apache.thrift.protocol.TList _list198 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32());
+ struct.rows = new ArrayList<List<String>>(_list198.size);
+ List<String> _elem199;
+ for (int _i200 = 0; _i200 < _list198.size; ++_i200)
+ {
+ {
+ org.apache.thrift.protocol.TList _list201 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ _elem199 = new ArrayList<String>(_list201.size);
+ String _elem202;
+ for (int _i203 = 0; _i203 < _list201.size; ++_i203)
+ {
+ _elem202 = iprot.readString();
+ _elem199.add(_elem202);
+ }
+ }
+ struct.rows.add(_elem199);
+ }
+ }
+ struct.setRowsIsSet(true);
+ struct.progressedPercentage = iprot.readDouble();
+ struct.setProgressedPercentageIsSet(true);
+ struct.status = org.apache.hive.service.rpc.thrift.TJobExecutionStatus.findByValue(iprot.readI32());
+ struct.setStatusIsSet(true);
+ struct.footerSummary = iprot.readString();
+ struct.setFooterSummaryIsSet(true);
+ struct.startTime = iprot.readI64();
+ struct.setStartTimeIsSet(true);
+ }
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/hive/blob/3e01ef32/service-rpc/src/gen/thrift/gen-php/Types.php
----------------------------------------------------------------------
diff --git a/service-rpc/src/gen/thrift/gen-php/Types.php b/service-rpc/src/gen/thrift/gen-php/Types.php
index 786c773..29b14d9 100644
--- a/service-rpc/src/gen/thrift/gen-php/Types.php
+++ b/service-rpc/src/gen/thrift/gen-php/Types.php
@@ -264,6 +264,17 @@ final class TFetchOrientation {
);
}
+final class TJobExecutionStatus {
+ const IN_PROGRESS = 0;
+ const COMPLETE = 1;
+ const NOT_AVAILABLE = 2;
+ static public $__names = array(
+ 0 => 'IN_PROGRESS',
+ 1 => 'COMPLETE',
+ 2 => 'NOT_AVAILABLE',
+ );
+}
+
class TTypeQualifierValue {
static $_TSPEC;
@@ -7976,6 +7987,10 @@ class TGetOperationStatusReq {
* @var \TOperationHandle
*/
public $operationHandle = null;
+ /**
+ * @var bool
+ */
+ public $getProgressUpdate = null;
public function __construct($vals=null) {
if (!isset(self::$_TSPEC)) {
@@ -7985,12 +8000,19 @@ class TGetOperationStatusReq {
'type' => TType::STRUCT,
'class' => '\TOperationHandle',
),
+ 2 => array(
+ 'var' => 'getProgressUpdate',
+ 'type' => TType::BOOL,
+ ),
);
}
if (is_array($vals)) {
if (isset($vals['operationHandle'])) {
$this->operationHandle = $vals['operationHandle'];
}
+ if (isset($vals['getProgressUpdate'])) {
+ $this->getProgressUpdate = $vals['getProgressUpdate'];
+ }
}
}
@@ -8021,6 +8043,13 @@ class TGetOperationStatusReq {
$xfer += $input->skip($ftype);
}
break;
+ case 2:
+ if ($ftype == TType::BOOL) {
+ $xfer += $input->readBool($this->getProgressUpdate);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
default:
$xfer += $input->skip($ftype);
break;
@@ -8042,6 +8071,11 @@ class TGetOperationStatusReq {
$xfer += $this->operationHandle->write($output);
$xfer += $output->writeFieldEnd();
}
+ if ($this->getProgressUpdate !== null) {
+ $xfer += $output->writeFieldBegin('getProgressUpdate', TType::BOOL, 2);
+ $xfer += $output->writeBool($this->getProgressUpdate);
+ $xfer += $output->writeFieldEnd();
+ }
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
@@ -8088,6 +8122,10 @@ class TGetOperationStatusResp {
* @var bool
*/
public $hasResultSet = null;
+ /**
+ * @var \TProgressUpdateResp
+ */
+ public $progressUpdateResponse = null;
public function __construct($vals=null) {
if (!isset(self::$_TSPEC)) {
@@ -8129,6 +8167,11 @@ class TGetOperationStatusResp {
'var' => 'hasResultSet',
'type' => TType::BOOL,
),
+ 10 => array(
+ 'var' => 'progressUpdateResponse',
+ 'type' => TType::STRUCT,
+ 'class' => '\TProgressUpdateResp',
+ ),
);
}
if (is_array($vals)) {
@@ -8159,6 +8202,9 @@ class TGetOperationStatusResp {
if (isset($vals['hasResultSet'])) {
$this->hasResultSet = $vals['hasResultSet'];
}
+ if (isset($vals['progressUpdateResponse'])) {
+ $this->progressUpdateResponse = $vals['progressUpdateResponse'];
+ }
}
}
@@ -8245,6 +8291,14 @@ class TGetOperationStatusResp {
$xfer += $input->skip($ftype);
}
break;
+ case 10:
+ if ($ftype == TType::STRUCT) {
+ $this->progressUpdateResponse = new \TProgressUpdateResp();
+ $xfer += $this->progressUpdateResponse->read($input);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
default:
$xfer += $input->skip($ftype);
break;
@@ -8306,6 +8360,14 @@ class TGetOperationStatusResp {
$xfer += $output->writeBool($this->hasResultSet);
$xfer += $output->writeFieldEnd();
}
+ if ($this->progressUpdateResponse !== null) {
+ if (!is_object($this->progressUpdateResponse)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('progressUpdateResponse', TType::STRUCT, 10);
+ $xfer += $this->progressUpdateResponse->write($output);
+ $xfer += $output->writeFieldEnd();
+ }
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
@@ -9696,6 +9758,271 @@ class TRenewDelegationTokenResp {
}
+class TProgressUpdateResp {
+ static $_TSPEC;
+
+ /**
+ * @var string[]
+ */
+ public $headerNames = null;
+ /**
+ * @var (string[])[]
+ */
+ public $rows = null;
+ /**
+ * @var double
+ */
+ public $progressedPercentage = null;
+ /**
+ * @var int
+ */
+ public $status = null;
+ /**
+ * @var string
+ */
+ public $footerSummary = null;
+ /**
+ * @var int
+ */
+ public $startTime = null;
+
+ public function __construct($vals=null) {
+ if (!isset(self::$_TSPEC)) {
+ self::$_TSPEC = array(
+ 1 => array(
+ 'var' => 'headerNames',
+ 'type' => TType::LST,
+ 'etype' => TType::STRING,
+ 'elem' => array(
+ 'type' => TType::STRING,
+ ),
+ ),
+ 2 => array(
+ 'var' => 'rows',
+ 'type' => TType::LST,
+ 'etype' => TType::LST,
+ 'elem' => array(
+ 'type' => TType::LST,
+ 'etype' => TType::STRING,
+ 'elem' => array(
+ 'type' => TType::STRING,
+ ),
+ ),
+ ),
+ 3 => array(
+ 'var' => 'progressedPercentage',
+ 'type' => TType::DOUBLE,
+ ),
+ 4 => array(
+ 'var' => 'status',
+ 'type' => TType::I32,
+ ),
+ 5 => array(
+ 'var' => 'footerSummary',
+ 'type' => TType::STRING,
+ ),
+ 6 => array(
+ 'var' => 'startTime',
+ 'type' => TType::I64,
+ ),
+ );
+ }
+ if (is_array($vals)) {
+ if (isset($vals['headerNames'])) {
+ $this->headerNames = $vals['headerNames'];
+ }
+ if (isset($vals['rows'])) {
+ $this->rows = $vals['rows'];
+ }
+ if (isset($vals['progressedPercentage'])) {
+ $this->progressedPercentage = $vals['progressedPercentage'];
+ }
+ if (isset($vals['status'])) {
+ $this->status = $vals['status'];
+ }
+ if (isset($vals['footerSummary'])) {
+ $this->footerSummary = $vals['footerSummary'];
+ }
+ if (isset($vals['startTime'])) {
+ $this->startTime = $vals['startTime'];
+ }
+ }
+ }
+
+ public function getName() {
+ return 'TProgressUpdateResp';
+ }
+
+ public function read($input)
+ {
+ $xfer = 0;
+ $fname = null;
+ $ftype = 0;
+ $fid = 0;
+ $xfer += $input->readStructBegin($fname);
+ while (true)
+ {
+ $xfer += $input->readFieldBegin($fname, $ftype, $fid);
+ if ($ftype == TType::STOP) {
+ break;
+ }
+ switch ($fid)
+ {
+ case 1:
+ if ($ftype == TType::LST) {
+ $this->headerNames = array();
+ $_size159 = 0;
+ $_etype162 = 0;
+ $xfer += $input->readListBegin($_etype162, $_size159);
+ for ($_i163 = 0; $_i163 < $_size159; ++$_i163)
+ {
+ $elem164 = null;
+ $xfer += $input->readString($elem164);
+ $this->headerNames []= $elem164;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 2:
+ if ($ftype == TType::LST) {
+ $this->rows = array();
+ $_size165 = 0;
+ $_etype168 = 0;
+ $xfer += $input->readListBegin($_etype168, $_size165);
+ for ($_i169 = 0; $_i169 < $_size165; ++$_i169)
+ {
+ $elem170 = null;
+ $elem170 = array();
+ $_size171 = 0;
+ $_etype174 = 0;
+ $xfer += $input->readListBegin($_etype174, $_size171);
+ for ($_i175 = 0; $_i175 < $_size171; ++$_i175)
+ {
+ $elem176 = null;
+ $xfer += $input->readString($elem176);
+ $elem170 []= $elem176;
+ }
+ $xfer += $input->readListEnd();
+ $this->rows []= $elem170;
+ }
+ $xfer += $input->readListEnd();
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 3:
+ if ($ftype == TType::DOUBLE) {
+ $xfer += $input->readDouble($this->progressedPercentage);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 4:
+ if ($ftype == TType::I32) {
+ $xfer += $input->readI32($this->status);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 5:
+ if ($ftype == TType::STRING) {
+ $xfer += $input->readString($this->footerSummary);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ case 6:
+ if ($ftype == TType::I64) {
+ $xfer += $input->readI64($this->startTime);
+ } else {
+ $xfer += $input->skip($ftype);
+ }
+ break;
+ default:
+ $xfer += $input->skip($ftype);
+ break;
+ }
+ $xfer += $input->readFieldEnd();
+ }
+ $xfer += $input->readStructEnd();
+ return $xfer;
+ }
+
+ public function write($output) {
+ $xfer = 0;
+ $xfer += $output->writeStructBegin('TProgressUpdateResp');
+ if ($this->headerNames !== null) {
+ if (!is_array($this->headerNames)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('headerNames', TType::LST, 1);
+ {
+ $output->writeListBegin(TType::STRING, count($this->headerNames));
+ {
+ foreach ($this->headerNames as $iter177)
+ {
+ $xfer += $output->writeString($iter177);
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->rows !== null) {
+ if (!is_array($this->rows)) {
+ throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
+ }
+ $xfer += $output->writeFieldBegin('rows', TType::LST, 2);
+ {
+ $output->writeListBegin(TType::LST, count($this->rows));
+ {
+ foreach ($this->rows as $iter178)
+ {
+ {
+ $output->writeListBegin(TType::STRING, count($iter178));
+ {
+ foreach ($iter178 as $iter179)
+ {
+ $xfer += $output->writeString($iter179);
+ }
+ }
+ $output->writeListEnd();
+ }
+ }
+ }
+ $output->writeListEnd();
+ }
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->progressedPercentage !== null) {
+ $xfer += $output->writeFieldBegin('progressedPercentage', TType::DOUBLE, 3);
+ $xfer += $output->writeDouble($this->progressedPercentage);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->status !== null) {
+ $xfer += $output->writeFieldBegin('status', TType::I32, 4);
+ $xfer += $output->writeI32($this->status);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->footerSummary !== null) {
+ $xfer += $output->writeFieldBegin('footerSummary', TType::STRING, 5);
+ $xfer += $output->writeString($this->footerSummary);
+ $xfer += $output->writeFieldEnd();
+ }
+ if ($this->startTime !== null) {
+ $xfer += $output->writeFieldBegin('startTime', TType::I64, 6);
+ $xfer += $output->writeI64($this->startTime);
+ $xfer += $output->writeFieldEnd();
+ }
+ $xfer += $output->writeFieldStop();
+ $xfer += $output->writeStructEnd();
+ return $xfer;
+ }
+
+}
+
final class Constant extends \Thrift\Type\TConstant {
static protected $PRIMITIVE_TYPES;
static protected $COMPLEX_TYPES;
http://git-wip-us.apache.org/repos/asf/hive/blob/3e01ef32/service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py
----------------------------------------------------------------------
diff --git a/service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py b/service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py
index fdf6b1f..4ed2091 100644
--- a/service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py
+++ b/service-rpc/src/gen/thrift/gen-py/TCLIService/ttypes.py
@@ -393,6 +393,23 @@ class TFetchOrientation:
"FETCH_LAST": 5,
}
+class TJobExecutionStatus:
+ IN_PROGRESS = 0
+ COMPLETE = 1
+ NOT_AVAILABLE = 2
+
+ _VALUES_TO_NAMES = {
+ 0: "IN_PROGRESS",
+ 1: "COMPLETE",
+ 2: "NOT_AVAILABLE",
+ }
+
+ _NAMES_TO_VALUES = {
+ "IN_PROGRESS": 0,
+ "COMPLETE": 1,
+ "NOT_AVAILABLE": 2,
+ }
+
class TTypeQualifierValue:
"""
@@ -6025,15 +6042,18 @@ class TGetOperationStatusReq:
"""
Attributes:
- operationHandle
+ - getProgressUpdate
"""
thrift_spec = (
None, # 0
(1, TType.STRUCT, 'operationHandle', (TOperationHandle, TOperationHandle.thrift_spec), None, ), # 1
+ (2, TType.BOOL, 'getProgressUpdate', None, None, ), # 2
)
- def __init__(self, operationHandle=None,):
+ def __init__(self, operationHandle=None, getProgressUpdate=None,):
self.operationHandle = operationHandle
+ self.getProgressUpdate = getProgressUpdate
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -6050,6 +6070,11 @@ class TGetOperationStatusReq:
self.operationHandle.read(iprot)
else:
iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.BOOL:
+ self.getProgressUpdate = iprot.readBool()
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -6064,6 +6089,10 @@ class TGetOperationStatusReq:
oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1)
self.operationHandle.write(oprot)
oprot.writeFieldEnd()
+ if self.getProgressUpdate is not None:
+ oprot.writeFieldBegin('getProgressUpdate', TType.BOOL, 2)
+ oprot.writeBool(self.getProgressUpdate)
+ oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
@@ -6076,6 +6105,7 @@ class TGetOperationStatusReq:
def __hash__(self):
value = 17
value = (value * 31) ^ hash(self.operationHandle)
+ value = (value * 31) ^ hash(self.getProgressUpdate)
return value
def __repr__(self):
@@ -6101,6 +6131,7 @@ class TGetOperationStatusResp:
- operationStarted
- operationCompleted
- hasResultSet
+ - progressUpdateResponse
"""
thrift_spec = (
@@ -6114,9 +6145,10 @@ class TGetOperationStatusResp:
(7, TType.I64, 'operationStarted', None, None, ), # 7
(8, TType.I64, 'operationCompleted', None, None, ), # 8
(9, TType.BOOL, 'hasResultSet', None, None, ), # 9
+ (10, TType.STRUCT, 'progressUpdateResponse', (TProgressUpdateResp, TProgressUpdateResp.thrift_spec), None, ), # 10
)
- def __init__(self, status=None, operationState=None, sqlState=None, errorCode=None, errorMessage=None, taskStatus=None, operationStarted=None, operationCompleted=None, hasResultSet=None,):
+ def __init__(self, status=None, operationState=None, sqlState=None, errorCode=None, errorMessage=None, taskStatus=None, operationStarted=None, operationCompleted=None, hasResultSet=None, progressUpdateResponse=None,):
self.status = status
self.operationState = operationState
self.sqlState = sqlState
@@ -6126,6 +6158,7 @@ class TGetOperationStatusResp:
self.operationStarted = operationStarted
self.operationCompleted = operationCompleted
self.hasResultSet = hasResultSet
+ self.progressUpdateResponse = progressUpdateResponse
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
@@ -6182,6 +6215,12 @@ class TGetOperationStatusResp:
self.hasResultSet = iprot.readBool()
else:
iprot.skip(ftype)
+ elif fid == 10:
+ if ftype == TType.STRUCT:
+ self.progressUpdateResponse = TProgressUpdateResp()
+ self.progressUpdateResponse.read(iprot)
+ else:
+ iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
@@ -6228,6 +6267,10 @@ class TGetOperationStatusResp:
oprot.writeFieldBegin('hasResultSet', TType.BOOL, 9)
oprot.writeBool(self.hasResultSet)
oprot.writeFieldEnd()
+ if self.progressUpdateResponse is not None:
+ oprot.writeFieldBegin('progressUpdateResponse', TType.STRUCT, 10)
+ self.progressUpdateResponse.write(oprot)
+ oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()
@@ -6248,6 +6291,7 @@ class TGetOperationStatusResp:
value = (value * 31) ^ hash(self.operationStarted)
value = (value * 31) ^ hash(self.operationCompleted)
value = (value * 31) ^ hash(self.hasResultSet)
+ value = (value * 31) ^ hash(self.progressUpdateResponse)
return value
def __repr__(self):
@@ -7369,3 +7413,169 @@ class TRenewDelegationTokenResp:
def __ne__(self, other):
return not (self == other)
+
+class TProgressUpdateResp:
+ """
+ Attributes:
+ - headerNames
+ - rows
+ - progressedPercentage
+ - status
+ - footerSummary
+ - startTime
+ """
+
+ thrift_spec = (
+ None, # 0
+ (1, TType.LIST, 'headerNames', (TType.STRING,None), None, ), # 1
+ (2, TType.LIST, 'rows', (TType.LIST,(TType.STRING,None)), None, ), # 2
+ (3, TType.DOUBLE, 'progressedPercentage', None, None, ), # 3
+ (4, TType.I32, 'status', None, None, ), # 4
+ (5, TType.STRING, 'footerSummary', None, None, ), # 5
+ (6, TType.I64, 'startTime', None, None, ), # 6
+ )
+
+ def __init__(self, headerNames=None, rows=None, progressedPercentage=None, status=None, footerSummary=None, startTime=None,):
+ self.headerNames = headerNames
+ self.rows = rows
+ self.progressedPercentage = progressedPercentage
+ self.status = status
+ self.footerSummary = footerSummary
+ self.startTime = startTime
+
+ def read(self, iprot):
+ if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
+ fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))
+ return
+ iprot.readStructBegin()
+ while True:
+ (fname, ftype, fid) = iprot.readFieldBegin()
+ if ftype == TType.STOP:
+ break
+ if fid == 1:
+ if ftype == TType.LIST:
+ self.headerNames = []
+ (_etype162, _size159) = iprot.readListBegin()
+ for _i163 in xrange(_size159):
+ _elem164 = iprot.readString()
+ self.headerNames.append(_elem164)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 2:
+ if ftype == TType.LIST:
+ self.rows = []
+ (_etype168, _size165) = iprot.readListBegin()
+ for _i169 in xrange(_size165):
+ _elem170 = []
+ (_etype174, _size171) = iprot.readListBegin()
+ for _i175 in xrange(_size171):
+ _elem176 = iprot.readString()
+ _elem170.append(_elem176)
+ iprot.readListEnd()
+ self.rows.append(_elem170)
+ iprot.readListEnd()
+ else:
+ iprot.skip(ftype)
+ elif fid == 3:
+ if ftype == TType.DOUBLE:
+ self.progressedPercentage = iprot.readDouble()
+ else:
+ iprot.skip(ftype)
+ elif fid == 4:
+ if ftype == TType.I32:
+ self.status = iprot.readI32()
+ else:
+ iprot.skip(ftype)
+ elif fid == 5:
+ if ftype == TType.STRING:
+ self.footerSummary = iprot.readString()
+ else:
+ iprot.skip(ftype)
+ elif fid == 6:
+ if ftype == TType.I64:
+ self.startTime = iprot.readI64()
+ else:
+ iprot.skip(ftype)
+ else:
+ iprot.skip(ftype)
+ iprot.readFieldEnd()
+ iprot.readStructEnd()
+
+ def write(self, oprot):
+ if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
+ oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))
+ return
+ oprot.writeStructBegin('TProgressUpdateResp')
+ if self.headerNames is not None:
+ oprot.writeFieldBegin('headerNames', TType.LIST, 1)
+ oprot.writeListBegin(TType.STRING, len(self.headerNames))
+ for iter177 in self.headerNames:
+ oprot.writeString(iter177)
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.rows is not None:
+ oprot.writeFieldBegin('rows', TType.LIST, 2)
+ oprot.writeListBegin(TType.LIST, len(self.rows))
+ for iter178 in self.rows:
+ oprot.writeListBegin(TType.STRING, len(iter178))
+ for iter179 in iter178:
+ oprot.writeString(iter179)
+ oprot.writeListEnd()
+ oprot.writeListEnd()
+ oprot.writeFieldEnd()
+ if self.progressedPercentage is not None:
+ oprot.writeFieldBegin('progressedPercentage', TType.DOUBLE, 3)
+ oprot.writeDouble(self.progressedPercentage)
+ oprot.writeFieldEnd()
+ if self.status is not None:
+ oprot.writeFieldBegin('status', TType.I32, 4)
+ oprot.writeI32(self.status)
+ oprot.writeFieldEnd()
+ if self.footerSummary is not None:
+ oprot.writeFieldBegin('footerSummary', TType.STRING, 5)
+ oprot.writeString(self.footerSummary)
+ oprot.writeFieldEnd()
+ if self.startTime is not None:
+ oprot.writeFieldBegin('startTime', TType.I64, 6)
+ oprot.writeI64(self.startTime)
+ oprot.writeFieldEnd()
+ oprot.writeFieldStop()
+ oprot.writeStructEnd()
+
+ def validate(self):
+ if self.headerNames is None:
+ raise TProtocol.TProtocolException(message='Required field headerNames is unset!')
+ if self.rows is None:
+ raise TProtocol.TProtocolException(message='Required field rows is unset!')
+ if self.progressedPercentage is None:
+ raise TProtocol.TProtocolException(message='Required field progressedPercentage is unset!')
+ if self.status is None:
+ raise TProtocol.TProtocolException(message='Required field status is unset!')
+ if self.footerSummary is None:
+ raise TProtocol.TProtocolException(message='Required field footerSummary is unset!')
+ if self.startTime is None:
+ raise TProtocol.TProtocolException(message='Required field startTime is unset!')
+ return
+
+
+ def __hash__(self):
+ value = 17
+ value = (value * 31) ^ hash(self.headerNames)
+ value = (value * 31) ^ hash(self.rows)
+ value = (value * 31) ^ hash(self.progressedPercentage)
+ value = (value * 31) ^ hash(self.status)
+ value = (value * 31) ^ hash(self.footerSummary)
+ value = (value * 31) ^ hash(self.startTime)
+ return value
+
+ def __repr__(self):
+ L = ['%s=%r' % (key, value)
+ for key, value in self.__dict__.iteritems()]
+ return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
+
+ def __eq__(self, other):
+ return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
+
+ def __ne__(self, other):
+ return not (self == other)
http://git-wip-us.apache.org/repos/asf/hive/blob/3e01ef32/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb
----------------------------------------------------------------------
diff --git a/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb b/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb
index 4b1854c..c536a8a 100644
--- a/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb
+++ b/service-rpc/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb
@@ -148,6 +148,14 @@ module TFetchOrientation
VALID_VALUES = Set.new([FETCH_NEXT, FETCH_PRIOR, FETCH_RELATIVE, FETCH_ABSOLUTE, FETCH_FIRST, FETCH_LAST]).freeze
end
+module TJobExecutionStatus
+ IN_PROGRESS = 0
+ COMPLETE = 1
+ NOT_AVAILABLE = 2
+ VALUE_MAP = {0 => "IN_PROGRESS", 1 => "COMPLETE", 2 => "NOT_AVAILABLE"}
+ VALID_VALUES = Set.new([IN_PROGRESS, COMPLETE, NOT_AVAILABLE]).freeze
+end
+
class TTypeQualifierValue < ::Thrift::Union
include ::Thrift::Struct_Union
class << self
@@ -1548,9 +1556,11 @@ end
class TGetOperationStatusReq
include ::Thrift::Struct, ::Thrift::Struct_Union
OPERATIONHANDLE = 1
+ GETPROGRESSUPDATE = 2
FIELDS = {
- OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle}
+ OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle},
+ GETPROGRESSUPDATE => {:type => ::Thrift::Types::BOOL, :name => 'getProgressUpdate', :optional => true}
}
def struct_fields; FIELDS; end
@@ -1573,6 +1583,7 @@ class TGetOperationStatusResp
OPERATIONSTARTED = 7
OPERATIONCOMPLETED = 8
HASRESULTSET = 9
+ PROGRESSUPDATERESPONSE = 10
FIELDS = {
STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus},
@@ -1583,7 +1594,8 @@ class TGetOperationStatusResp
TASKSTATUS => {:type => ::Thrift::Types::STRING, :name => 'taskStatus', :optional => true},
OPERATIONSTARTED => {:type => ::Thrift::Types::I64, :name => 'operationStarted', :optional => true},
OPERATIONCOMPLETED => {:type => ::Thrift::Types::I64, :name => 'operationCompleted', :optional => true},
- HASRESULTSET => {:type => ::Thrift::Types::BOOL, :name => 'hasResultSet', :optional => true}
+ HASRESULTSET => {:type => ::Thrift::Types::BOOL, :name => 'hasResultSet', :optional => true},
+ PROGRESSUPDATERESPONSE => {:type => ::Thrift::Types::STRUCT, :name => 'progressUpdateResponse', :class => ::TProgressUpdateResp, :optional => true}
}
def struct_fields; FIELDS; end
@@ -1867,3 +1879,38 @@ class TRenewDelegationTokenResp
::Thrift::Struct.generate_accessors self
end
+class TProgressUpdateResp
+ include ::Thrift::Struct, ::Thrift::Struct_Union
+ HEADERNAMES = 1
+ ROWS = 2
+ PROGRESSEDPERCENTAGE = 3
+ STATUS = 4
+ FOOTERSUMMARY = 5
+ STARTTIME = 6
+
+ FIELDS = {
+ HEADERNAMES => {:type => ::Thrift::Types::LIST, :name => 'headerNames', :element => {:type => ::Thrift::Types::STRING}},
+ ROWS => {:type => ::Thrift::Types::LIST, :name => 'rows', :element => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRING}}},
+ PROGRESSEDPERCENTAGE => {:type => ::Thrift::Types::DOUBLE, :name => 'progressedPercentage'},
+ STATUS => {:type => ::Thrift::Types::I32, :name => 'status', :enum_class => ::TJobExecutionStatus},
+ FOOTERSUMMARY => {:type => ::Thrift::Types::STRING, :name => 'footerSummary'},
+ STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime'}
+ }
+
+ def struct_fields; FIELDS; end
+
+ def validate
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field headerNames is unset!') unless @headerNames
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field rows is unset!') unless @rows
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field progressedPercentage is unset!') unless @progressedPercentage
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field footerSummary is unset!') unless @footerSummary
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field startTime is unset!') unless @startTime
+ unless @status.nil? || ::TJobExecutionStatus::VALID_VALUES.include?(@status)
+ raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field status!')
+ end
+ end
+
+ ::Thrift::Struct.generate_accessors self
+end
+
http://git-wip-us.apache.org/repos/asf/hive/blob/3e01ef32/service/src/java/org/apache/hive/service/cli/CLIService.java
----------------------------------------------------------------------
diff --git a/service/src/java/org/apache/hive/service/cli/CLIService.java b/service/src/java/org/apache/hive/service/cli/CLIService.java
index de44ecb..b842f37 100644
--- a/service/src/java/org/apache/hive/service/cli/CLIService.java
+++ b/service/src/java/org/apache/hive/service/cli/CLIService.java
@@ -46,6 +46,8 @@ import org.apache.hive.service.rpc.thrift.TProtocolVersion;
import org.apache.hive.service.server.HiveServer2;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.apache.hadoop.hive.common.log.ProgressMonitor;
+import org.apache.hive.service.cli.session.HiveSession;
/**
* CLIService.
@@ -255,8 +257,11 @@ public class CLIService extends CompositeService implements ICLIService {
@Override
public OperationHandle executeStatement(SessionHandle sessionHandle, String statement,
Map<String, String> confOverlay) throws HiveSQLException {
- OperationHandle opHandle =
- sessionManager.getSession(sessionHandle).executeStatement(statement, confOverlay);
+ HiveSession session = sessionManager.getSession(sessionHandle);
+ // need to reset the monitor, as operation handle is not available down stream, Ideally the
+ // monitor should be associated with the operation handle.
+ session.getSessionState().updateProgressMonitor(null);
+ OperationHandle opHandle = session.executeStatement(statement, confOverlay);
LOG.debug(sessionHandle + ": executeStatement()");
return opHandle;
}
@@ -267,9 +272,11 @@ public class CLIService extends CompositeService implements ICLIService {
@Override
public OperationHandle executeStatement(SessionHandle sessionHandle, String statement,
Map<String, String> confOverlay, long queryTimeout) throws HiveSQLException {
- OperationHandle opHandle =
- sessionManager.getSession(sessionHandle).executeStatement(statement, confOverlay,
- queryTimeout);
+ HiveSession session = sessionManager.getSession(sessionHandle);
+ // need to reset the monitor, as operation handle is not available down stream, Ideally the
+ // monitor should be associated with the operation handle.
+ session.getSessionState().updateProgressMonitor(null);
+ OperationHandle opHandle = session.executeStatement(statement, confOverlay, queryTimeout);
LOG.debug(sessionHandle + ": executeStatement()");
return opHandle;
}
@@ -280,8 +287,11 @@ public class CLIService extends CompositeService implements ICLIService {
@Override
public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement,
Map<String, String> confOverlay) throws HiveSQLException {
- OperationHandle opHandle =
- sessionManager.getSession(sessionHandle).executeStatementAsync(statement, confOverlay);
+ HiveSession session = sessionManager.getSession(sessionHandle);
+ // need to reset the monitor, as operation handle is not available down stream, Ideally the
+ // monitor should be associated with the operation handle.
+ session.getSessionState().updateProgressMonitor(null);
+ OperationHandle opHandle = session.executeStatementAsync(statement, confOverlay);
LOG.debug(sessionHandle + ": executeStatementAsync()");
return opHandle;
}
@@ -292,9 +302,11 @@ public class CLIService extends CompositeService implements ICLIService {
@Override
public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement,
Map<String, String> confOverlay, long queryTimeout) throws HiveSQLException {
- OperationHandle opHandle =
- sessionManager.getSession(sessionHandle).executeStatementAsync(statement, confOverlay,
- queryTimeout);
+ HiveSession session = sessionManager.getSession(sessionHandle);
+ // need to reset the monitor, as operation handle is not available down stream, Ideally the
+ // monitor should be associated with the operation handle.
+ session.getSessionState().updateProgressMonitor(null);
+ OperationHandle opHandle = session.executeStatementAsync(statement, confOverlay, queryTimeout);
LOG.debug(sessionHandle + ": executeStatementAsync()");
return opHandle;
}
@@ -410,18 +422,18 @@ public class CLIService extends CompositeService implements ICLIService {
String foreignSchema, String foreignTable)
throws HiveSQLException {
OperationHandle opHandle = sessionManager.getSession(sessionHandle)
- .getCrossReference(primaryCatalog, primarySchema, primaryTable,
+ .getCrossReference(primaryCatalog, primarySchema, primaryTable,
foreignCatalog,
foreignSchema, foreignTable);
LOG.debug(sessionHandle + ": getCrossReference()");
return opHandle;
}
-
+
/* (non-Javadoc)
* @see org.apache.hive.service.cli.ICLIService#getOperationStatus(org.apache.hive.service.cli.OperationHandle)
*/
@Override
- public OperationStatus getOperationStatus(OperationHandle opHandle)
+ public OperationStatus getOperationStatus(OperationHandle opHandle, boolean getProgressUpdate)
throws HiveSQLException {
Operation operation = sessionManager.getOperationManager().getOperation(opHandle);
/**
@@ -457,9 +469,34 @@ public class CLIService extends CompositeService implements ICLIService {
}
OperationStatus opStatus = operation.getStatus();
LOG.debug(opHandle + ": getOperationStatus()");
+ opStatus.setJobProgressUpdate(progressUpdateLog(getProgressUpdate, operation));
return opStatus;
}
+ private JobProgressUpdate progressUpdateLog(boolean isProgressLogRequested, Operation operation) {
+ if (isProgressLogRequested && canProvideProgressLog()) {
+ if (OperationType.EXECUTE_STATEMENT.equals(operation.getType())) {
+ SessionState sessionState = operation.getParentSession().getSessionState();
+ try {
+ while (sessionState.getProgressMonitor() == null && !operation.isFinished()) {
+ Thread.sleep(10L); // sleep for 10 ms
+ }
+ } catch (InterruptedException e) {
+ LOG.warn("Error while getting progress update", e);
+ }
+ if (sessionState.getProgressMonitor() != null) {
+ return new JobProgressUpdate(sessionState.getProgressMonitor());
+ }
+ }
+ }
+ return new JobProgressUpdate(ProgressMonitor.NULL);
+ }
+
+ private boolean canProvideProgressLog() {
+ return "tez".equals(hiveConf.getVar(ConfVars.HIVE_EXECUTION_ENGINE))
+ && hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_INPLACE_PROGRESS);
+ }
+
/* (non-Javadoc)
* @see org.apache.hive.service.cli.ICLIService#cancelOperation(org.apache.hive.service.cli.OperationHandle)
*/
http://git-wip-us.apache.org/repos/asf/hive/blob/3e01ef32/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java
----------------------------------------------------------------------
diff --git a/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java b/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java
index 2a3bcca..43fbb00 100644
--- a/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java
+++ b/service/src/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java
@@ -159,8 +159,8 @@ public class EmbeddedCLIServiceClient extends CLIServiceClient {
* @see org.apache.hive.service.cli.CLIServiceClient#getOperationStatus(org.apache.hive.service.cli.OperationHandle)
*/
@Override
- public OperationStatus getOperationStatus(OperationHandle opHandle) throws HiveSQLException {
- return cliService.getOperationStatus(opHandle);
+ public OperationStatus getOperationStatus(OperationHandle opHandle, boolean getProgressUpdate) throws HiveSQLException {
+ return cliService.getOperationStatus(opHandle, getProgressUpdate);
}
/* (non-Javadoc)
http://git-wip-us.apache.org/repos/asf/hive/blob/3e01ef32/service/src/java/org/apache/hive/service/cli/ICLIService.java
----------------------------------------------------------------------
diff --git a/service/src/java/org/apache/hive/service/cli/ICLIService.java b/service/src/java/org/apache/hive/service/cli/ICLIService.java
index fef772d..9f2039c 100644
--- a/service/src/java/org/apache/hive/service/cli/ICLIService.java
+++ b/service/src/java/org/apache/hive/service/cli/ICLIService.java
@@ -75,7 +75,7 @@ public interface ICLIService {
String catalogName, String schemaName, String functionName)
throws HiveSQLException;
- OperationStatus getOperationStatus(OperationHandle opHandle)
+ OperationStatus getOperationStatus(OperationHandle opHandle, boolean getProgressUpdate)
throws HiveSQLException;
void cancelOperation(OperationHandle opHandle)