statusOptions, String vertexName) {
+ try {
+ return dagClient.getVertexStatus(vertexName, statusOptions).getVertexCounters();
+ } catch (IOException | TezException e) {
+ // best attempt, shouldn't really kill DAG for this
+ }
+ return null;
+ }
+
+}
diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/PrintSummary.java ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/PrintSummary.java
new file mode 100644
index 0000000..6311335
--- /dev/null
+++ ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/PrintSummary.java
@@ -0,0 +1,7 @@
+package org.apache.hadoop.hive.ql.exec.tez.monitoring;
+
+import org.apache.hadoop.hive.ql.session.SessionState;
+
+interface PrintSummary {
+ void print(SessionState.LogHelper console);
+}
diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/QueryExecutionBreakdownSummary.java ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/QueryExecutionBreakdownSummary.java
new file mode 100644
index 0000000..1625ce1
--- /dev/null
+++ ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/QueryExecutionBreakdownSummary.java
@@ -0,0 +1,75 @@
+package org.apache.hadoop.hive.ql.exec.tez.monitoring;
+
+import org.apache.hadoop.hive.ql.log.PerfLogger;
+import org.apache.hadoop.hive.ql.session.SessionState;
+
+import java.text.DecimalFormat;
+
+import static org.apache.hadoop.hive.ql.exec.tez.monitoring.Constants.SEPARATOR;
+
+class QueryExecutionBreakdownSummary implements PrintSummary {
+ // Methods summary
+ private static final String OPERATION_SUMMARY = "%-35s %9s";
+ private static final String OPERATION = "OPERATION";
+ private static final String DURATION = "DURATION";
+
+
+ private DecimalFormat decimalFormat = new DecimalFormat("#0.00");
+ private PerfLogger perfLogger;
+
+ private final Long compileEndTime;
+ private final Long dagSubmitStartTime;
+ private final Long submitToRunningDuration;
+
+ QueryExecutionBreakdownSummary(PerfLogger perfLogger) {
+ this.perfLogger = perfLogger;
+ this.compileEndTime = perfLogger.getEndTime(PerfLogger.COMPILE);
+ this.dagSubmitStartTime = perfLogger.getStartTime(PerfLogger.TEZ_SUBMIT_DAG);
+ this.submitToRunningDuration = perfLogger.getDuration(PerfLogger.TEZ_SUBMIT_TO_RUNNING);
+ }
+
+ private String formatNumber(long number) {
+ return decimalFormat.format(number / 1000.0) + "s";
+ }
+
+ private String format(String value, long number) {
+ return String.format(OPERATION_SUMMARY, value, formatNumber(number));
+ }
+
+ public void print(SessionState.LogHelper console) {
+ console.printInfo("Query Execution Summary");
+
+ String execBreakdownHeader = String.format(OPERATION_SUMMARY, OPERATION, DURATION);
+ console.printInfo(SEPARATOR);
+ console.printInfo(execBreakdownHeader);
+ console.printInfo(SEPARATOR);
+
+ // parse, analyze, optimize and compile
+ long compile = compileEndTime - perfLogger.getStartTime(PerfLogger.COMPILE);
+ console.printInfo(format("Compile Query", compile));
+
+ // prepare plan for submission (building DAG, adding resources, creating scratch dirs etc.)
+ long totalDAGPrep = dagSubmitStartTime - compileEndTime;
+ console.printInfo(format("Prepare Plan", totalDAGPrep));
+
+ // submit to accept dag (if session is closed, this will include re-opening of session time,
+ // localizing files for AM, submitting DAG)
+ long submitToAccept = perfLogger.getStartTime(PerfLogger.TEZ_RUN_DAG) - dagSubmitStartTime;
+ console.printInfo(format("Submit Plan", submitToAccept));
+
+ // accept to start dag (schedule wait time, resource wait time etc.)
+ console.printInfo(format("Start DAG", submitToRunningDuration));
+
+ // time to actually run the dag (actual dag runtime)
+ final long startToEnd;
+ if (submitToRunningDuration == 0) {
+ startToEnd = perfLogger.getDuration(PerfLogger.TEZ_RUN_DAG);
+ } else {
+ startToEnd = perfLogger.getEndTime(PerfLogger.TEZ_RUN_DAG) -
+ perfLogger.getEndTime(PerfLogger.TEZ_SUBMIT_TO_RUNNING);
+ }
+ console.printInfo(format("Run DAG", startToEnd));
+ console.printInfo(SEPARATOR);
+ console.printInfo("");
+ }
+}
diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/TezJobMonitor.java ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/TezJobMonitor.java
new file mode 100644
index 0000000..ee3af3e
--- /dev/null
+++ ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/TezJobMonitor.java
@@ -0,0 +1,395 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+package org.apache.hadoop.hive.ql.exec.tez.monitoring;
+
+import com.google.common.base.Preconditions;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.hadoop.hive.ql.Context;
+import org.apache.hadoop.hive.ql.exec.Utilities;
+import org.apache.hadoop.hive.ql.exec.tez.TezSessionPoolManager;
+import org.apache.hadoop.hive.common.log.InPlaceUpdate;
+import org.apache.hadoop.hive.ql.log.PerfLogger;
+import org.apache.hadoop.hive.common.log.ProgressMonitor;
+import org.apache.hadoop.hive.ql.plan.BaseWork;
+import org.apache.hadoop.hive.ql.session.SessionState;
+import org.apache.hadoop.hive.ql.session.SessionState.LogHelper;
+import org.apache.hive.common.util.ShutdownHookManager;
+import org.apache.tez.common.counters.TezCounter;
+import org.apache.tez.common.counters.TezCounters;
+import org.apache.tez.dag.api.DAG;
+import org.apache.tez.dag.api.TezException;
+import org.apache.tez.dag.api.client.DAGClient;
+import org.apache.tez.dag.api.client.DAGStatus;
+import org.apache.tez.dag.api.client.Progress;
+import org.apache.tez.dag.api.client.StatusGetOpts;
+
+import java.io.IOException;
+import java.io.InterruptedIOException;
+import java.io.StringWriter;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import static org.apache.tez.dag.api.client.DAGStatus.State.RUNNING;
+
+/**
+ * TezJobMonitor keeps track of a tez job while it's being executed. It will
+ * print status to the console and retrieve final status of the job after
+ * completion.
+ */
+public class TezJobMonitor {
+
+ private static final String CLASS_NAME = TezJobMonitor.class.getName();
+ private static final int CHECK_INTERVAL = 200;
+ private static final int MAX_RETRY_INTERVAL = 2500;
+ private static final int PRINT_INTERVAL = 3000;
+
+ private final PerfLogger perfLogger = SessionState.getPerfLogger();
+ private static final List shutdownList;
+ private final Map workMap;
+
+ private transient LogHelper console;
+
+ private long lastPrintTime;
+ private StringWriter diagnostics = new StringWriter();
+
+ interface UpdateFunction {
+ void update(DAGStatus status, Map vertexProgressMap, String report);
+ }
+
+ static {
+ shutdownList = new LinkedList<>();
+ ShutdownHookManager.addShutdownHook(new Runnable() {
+ @Override
+ public void run() {
+ TezJobMonitor.killRunningJobs();
+ try {
+ TezSessionPoolManager.getInstance().closeNonDefaultSessions(false);
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ });
+ }
+
+ public static void initShutdownHook() {
+ Preconditions.checkNotNull(shutdownList,
+ "Shutdown hook was not properly initialized");
+ }
+
+ private final DAGClient dagClient;
+ private final HiveConf hiveConf;
+ private final DAG dag;
+ private final Context context;
+ private long executionStartTime = 0;
+ private final UpdateFunction updateFunction;
+ /**
+ * Have to use the same instance to render else the number lines printed earlier is lost and the
+ * screen will print the table again and again.
+ */
+ private final InPlaceUpdate inPlaceUpdate;
+
+ public TezJobMonitor(Map workMap, final DAGClient dagClient, HiveConf conf, DAG dag,
+ Context ctx) {
+ this.workMap = workMap;
+ this.dagClient = dagClient;
+ this.hiveConf = conf;
+ this.dag = dag;
+ this.context = ctx;
+ console = SessionState.getConsole();
+ inPlaceUpdate = new InPlaceUpdate(LogHelper.getInfoStream());
+ updateFunction = updateFunction();
+ }
+
+ private UpdateFunction updateFunction() {
+ UpdateFunction logToFileFunction = new UpdateFunction() {
+ @Override
+ public void update(DAGStatus status, Map vertexProgressMap, String report) {
+ SessionState.get().updateProgress(progressMonitor(status, vertexProgressMap));
+ console.printInfo(report);
+ }
+ };
+ UpdateFunction inPlaceUpdateFunction = new UpdateFunction() {
+ @Override
+ public void update(DAGStatus status, Map vertexProgressMap, String report) {
+ inPlaceUpdate.render(progressMonitor(status, vertexProgressMap));
+ console.logInfo(report);
+ }
+ };
+ return InPlaceUpdate.canRenderInPlace(hiveConf) && !SessionState.getConsole().getIsSilent()
+ ? inPlaceUpdateFunction : logToFileFunction;
+ }
+
+ private boolean isProfilingEnabled() {
+ return HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.TEZ_EXEC_SUMMARY) ||
+ Utilities.isPerfOrAboveLogging(hiveConf);
+ }
+
+ public int monitorExecution() {
+ boolean done = false;
+ boolean success = false;
+ int failedCounter = 0;
+ int rc = 0;
+ DAGStatus status = null;
+ Map vertexProgressMap = null;
+
+
+ long monitorStartTime = System.currentTimeMillis();
+ synchronized (shutdownList) {
+ shutdownList.add(dagClient);
+ }
+ perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.TEZ_RUN_DAG);
+ perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.TEZ_SUBMIT_TO_RUNNING);
+ DAGStatus.State lastState = null;
+ String lastReport = null;
+ boolean running = false;
+
+ while (true) {
+
+ try {
+ if (context != null) {
+ context.checkHeartbeaterLockException();
+ }
+
+ status = dagClient.getDAGStatus(new HashSet(), CHECK_INTERVAL);
+ vertexProgressMap = status.getVertexProgress();
+ DAGStatus.State state = status.getState();
+
+ if (state != lastState || state == RUNNING) {
+ lastState = state;
+
+ switch (state) {
+ case SUBMITTED:
+ console.printInfo("Status: Submitted");
+ break;
+ case INITING:
+ console.printInfo("Status: Initializing");
+ this.executionStartTime = System.currentTimeMillis();
+ break;
+ case RUNNING:
+ if (!running) {
+ perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.TEZ_SUBMIT_TO_RUNNING);
+ console.printInfo("Status: Running (" + dagClient.getExecutionContext() + ")\n");
+ this.executionStartTime = System.currentTimeMillis();
+ running = true;
+ }
+ lastReport = updateStatus(status, vertexProgressMap, lastReport);
+ break;
+ case SUCCEEDED:
+ if (!running) {
+ this.executionStartTime = monitorStartTime;
+ }
+ lastReport = updateStatus(status, vertexProgressMap, lastReport);
+ success = true;
+ running = false;
+ done = true;
+ break;
+ case KILLED:
+ if (!running) {
+ this.executionStartTime = monitorStartTime;
+ }
+ lastReport = updateStatus(status, vertexProgressMap, lastReport);
+ console.printInfo("Status: Killed");
+ running = false;
+ done = true;
+ rc = 1;
+ break;
+ case FAILED:
+ case ERROR:
+ if (!running) {
+ this.executionStartTime = monitorStartTime;
+ }
+ lastReport = updateStatus(status, vertexProgressMap, lastReport);
+ console.printError("Status: Failed");
+ running = false;
+ done = true;
+ rc = 2;
+ break;
+ }
+ }
+ } catch (Exception e) {
+ console.printInfo("Exception: " + e.getMessage());
+ boolean isInterrupted = hasInterruptedException(e);
+ if (isInterrupted || (++failedCounter % MAX_RETRY_INTERVAL / CHECK_INTERVAL == 0)) {
+ try {
+ console.printInfo("Killing DAG...");
+ dagClient.tryKillDAG();
+ } catch (IOException | TezException tezException) {
+ // best effort
+ }
+ console
+ .printError("Execution has failed. stack trace: " + ExceptionUtils.getStackTrace(e));
+ rc = 1;
+ done = true;
+ } else {
+ console.printInfo("Retrying...");
+ }
+ } finally {
+ if (done) {
+ if (rc != 0 && status != null) {
+ for (String diag : status.getDiagnostics()) {
+ console.printError(diag);
+ diagnostics.append(diag);
+ }
+ }
+ synchronized (shutdownList) {
+ shutdownList.remove(dagClient);
+ }
+ break;
+ }
+ }
+ }
+
+ perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.TEZ_RUN_DAG);
+ printSummary(success, vertexProgressMap);
+ return rc;
+ }
+
+ private void printSummary(boolean success, Map progressMap) {
+ if (isProfilingEnabled() && success && progressMap != null) {
+
+ double duration = (System.currentTimeMillis() - this.executionStartTime) / 1000.0;
+ console.printInfo("Status: DAG finished successfully in " + String.format("%.2f seconds", duration));
+ console.printInfo("");
+
+ new QueryExecutionBreakdownSummary(perfLogger).print(console);
+ new DAGSummary(progressMap, hiveConf, dagClient, dag, perfLogger).print(console);
+
+ //llap IO summary
+ if (HiveConf.getBoolVar(hiveConf, HiveConf.ConfVars.LLAP_IO_ENABLED, false)) {
+ new LLAPioSummary(progressMap, dagClient).print(console);
+ new FSCountersSummary(progressMap, dagClient).print(console);
+ }
+ console.printInfo("");
+ }
+ }
+
+ private static boolean hasInterruptedException(Throwable e) {
+ // Hadoop IPC wraps InterruptedException. GRRR.
+ while (e != null) {
+ if (e instanceof InterruptedException || e instanceof InterruptedIOException) {
+ return true;
+ }
+ e = e.getCause();
+ }
+ return false;
+ }
+
+ /**
+ * killRunningJobs tries to terminate execution of all
+ * currently running tez queries. No guarantees, best effort only.
+ */
+ private static void killRunningJobs() {
+ synchronized (shutdownList) {
+ for (DAGClient c : shutdownList) {
+ try {
+ System.err.println("Trying to shutdown DAG");
+ c.tryKillDAG();
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ }
+ }
+
+ static long getCounterValueByGroupName(TezCounters vertexCounters, String groupNamePattern,
+ String counterName) {
+ TezCounter tezCounter = vertexCounters.getGroup(groupNamePattern).findCounter(counterName);
+ return (tezCounter == null) ? 0 : tezCounter.getValue();
+ }
+
+ private String updateStatus(DAGStatus status, Map vertexProgressMap,
+ String lastReport) {
+ String report = getReport(vertexProgressMap);
+ if (!report.equals(lastReport) || System.currentTimeMillis() >= lastPrintTime + PRINT_INTERVAL) {
+ updateFunction.update(status, vertexProgressMap, report);
+ lastPrintTime = System.currentTimeMillis();
+ }
+ return report;
+ }
+
+ private String getReport(Map progressMap) {
+ StringBuilder reportBuffer = new StringBuilder();
+
+ SortedSet keys = new TreeSet(progressMap.keySet());
+ for (String s : keys) {
+ Progress progress = progressMap.get(s);
+ final int complete = progress.getSucceededTaskCount();
+ final int total = progress.getTotalTaskCount();
+ final int running = progress.getRunningTaskCount();
+ final int failed = progress.getFailedTaskAttemptCount();
+ if (total <= 0) {
+ reportBuffer.append(String.format("%s: -/-\t", s));
+ } else {
+ if (complete == total) {
+ /*
+ * We may have missed the start of the vertex due to the 3 seconds interval
+ */
+ if (!perfLogger.startTimeHasMethod(PerfLogger.TEZ_RUN_VERTEX + s)) {
+ perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.TEZ_RUN_VERTEX + s);
+ }
+
+ perfLogger.PerfLogEnd(CLASS_NAME, PerfLogger.TEZ_RUN_VERTEX + s);
+ }
+ if (complete < total && (complete > 0 || running > 0 || failed > 0)) {
+
+ if (!perfLogger.startTimeHasMethod(PerfLogger.TEZ_RUN_VERTEX + s)) {
+ perfLogger.PerfLogBegin(CLASS_NAME, PerfLogger.TEZ_RUN_VERTEX + s);
+ }
+
+ /* vertex is started, but not complete */
+ if (failed > 0) {
+ reportBuffer.append(String.format("%s: %d(+%d,-%d)/%d\t", s, complete, running, failed, total));
+ } else {
+ reportBuffer.append(String.format("%s: %d(+%d)/%d\t", s, complete, running, total));
+ }
+ } else {
+ /* vertex is waiting for input/slots or complete */
+ if (failed > 0) {
+ /* tasks finished but some failed */
+ reportBuffer.append(String.format("%s: %d(-%d)/%d\t", s, complete, failed, total));
+ } else {
+ reportBuffer.append(String.format("%s: %d/%d\t", s, complete, total));
+ }
+ }
+ }
+ }
+
+ return reportBuffer.toString();
+ }
+
+ public String getDiagnostics() {
+ return diagnostics.toString();
+ }
+
+ private ProgressMonitor progressMonitor(DAGStatus status, Map progressMap) {
+ try {
+ return new TezProgressMonitor(dagClient, status, workMap, progressMap, console,
+ executionStartTime);
+ } catch (IOException | TezException e) {
+ console.printInfo("Getting Progress Information: " + e.getMessage() + " stack trace: " +
+ ExceptionUtils.getStackTrace(e));
+ }
+ return TezProgressMonitor.NULL;
+ }
+}
diff --git ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/TezProgressMonitor.java ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/TezProgressMonitor.java
new file mode 100644
index 0000000..3475fc2
--- /dev/null
+++ ql/src/java/org/apache/hadoop/hive/ql/exec/tez/monitoring/TezProgressMonitor.java
@@ -0,0 +1,313 @@
+package org.apache.hadoop.hive.ql.exec.tez.monitoring;
+
+import org.apache.hadoop.hive.common.log.ProgressMonitor;
+import org.apache.hadoop.hive.ql.plan.BaseWork;
+import org.apache.hadoop.hive.ql.session.SessionState;
+import org.apache.tez.dag.api.TezException;
+import org.apache.tez.dag.api.client.DAGClient;
+import org.apache.tez.dag.api.client.DAGStatus;
+import org.apache.tez.dag.api.client.Progress;
+import org.apache.tez.dag.api.client.VertexStatus;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import static org.apache.tez.dag.api.client.DAGStatus.State.KILLED;
+
+class TezProgressMonitor implements ProgressMonitor {
+ private static final int COLUMN_1_WIDTH = 16;
+ private final Map workMap;
+ private final SessionState.LogHelper console;
+ private final long executionStartTime;
+ private final DAGStatus status;
+ Map vertexStatusMap = new HashMap<>();
+ Map progressCountsMap = new HashMap<>();
+
+ /**
+ * Try to get most the data required from dagClient in the constructor itself so that even after
+ * the tez job has finished this object can be used for later use.s
+ */
+ TezProgressMonitor(DAGClient dagClient, DAGStatus status, Map workMap,
+ Map progressMap, SessionState.LogHelper console, long executionStartTime)
+ throws IOException, TezException {
+ this.status = status;
+ this.workMap = workMap;
+ this.console = console;
+ this.executionStartTime = executionStartTime;
+ for (Map.Entry entry : progressMap.entrySet()) {
+ String vertexName = entry.getKey();
+ progressCountsMap.put(vertexName, new VertexProgress(entry.getValue(), status.getState()));
+ try {
+ vertexStatusMap.put(vertexName, dagClient.getVertexStatus(vertexName, null));
+ } catch (IOException e) {
+ // best attempt, shouldn't really kill DAG for this
+ }
+ }
+ }
+
+ public List headers() {
+ return Arrays.asList(
+ "VERTICES",
+ "MODE",
+ "STATUS",
+ "TOTAL",
+ "COMPLETED",
+ "RUNNING",
+ "PENDING",
+ "FAILED",
+ "KILLED"
+ );
+ }
+
+ public List> rows() {
+ try {
+ List> results = new ArrayList<>();
+ SortedSet keys = new TreeSet<>(progressCountsMap.keySet());
+ for (String s : keys) {
+ VertexProgress progress = progressCountsMap.get(s);
+
+ // Map 1 .......... container SUCCEEDED 7 7 0 0 0 0
+
+ results.add(
+ Arrays.asList(
+ getNameWithProgress(s, progress.succeededTaskCount, progress.totalTaskCount),
+ getMode(s, workMap),
+ progress.vertexStatus(vertexStatusMap.get(s)),
+ progress.total(),
+ progress.completed(),
+ progress.running(),
+ progress.pending(),
+ progress.failed(),
+ progress.killed()
+ )
+ );
+ }
+ return results;
+ } catch (Exception e) {
+ console.printInfo(
+ "Getting Progress Bar table rows failed: " + e.getMessage() + " stack trace: " + Arrays
+ .toString(e.getStackTrace())
+ );
+ }
+ return Collections.emptyList();
+ }
+
+ // -------------------------------------------------------------------------------
+ // VERTICES: 03/04 [=================>>-----] 86% ELAPSED TIME: 1.71 s
+ // -------------------------------------------------------------------------------
+ // contains footerSummary , progressedPercentage, starTime
+
+ @Override
+ public String footerSummary() {
+ return String.format("VERTICES: %02d/%02d", completed(), progressCountsMap.keySet().size());
+ }
+
+ @Override
+ public long startTime() {
+ return executionStartTime;
+ }
+
+ @Override
+ public double progressedPercentage() {
+ int sumTotal = 0, sumComplete = 0;
+ for (String s : progressCountsMap.keySet()) {
+ VertexProgress progress = progressCountsMap.get(s);
+ final int complete = progress.succeededTaskCount;
+ final int total = progress.totalTaskCount;
+ if (total > 0) {
+ sumTotal += total;
+ sumComplete += complete;
+ }
+ }
+ return (sumTotal == 0) ? 0.0f : (float) sumComplete / (float) sumTotal;
+ }
+
+ @Override
+ public String executionStatus() {
+ return this.status.getState().name();
+ }
+
+ private int completed() {
+ Set completed = new HashSet<>();
+ for (String s : progressCountsMap.keySet()) {
+ VertexProgress progress = progressCountsMap.get(s);
+ final int complete = progress.succeededTaskCount;
+ final int total = progress.totalTaskCount;
+ if (total > 0) {
+ if (complete == total) {
+ completed.add(s);
+ }
+ }
+ }
+ return completed.size();
+ }
+
+ // Map 1 ..........
+
+ private String getNameWithProgress(String s, int complete, int total) {
+ String result = "";
+ if (s != null) {
+ float percent = total == 0 ? 0.0f : (float) complete / (float) total;
+ // lets use the remaining space in column 1 as progress bar
+ int spaceRemaining = COLUMN_1_WIDTH - s.length() - 1;
+ String trimmedVName = s;
+
+ // if the vertex name is longer than column 1 width, trim it down
+ // "Tez Merge File Work" will become "Tez Merge File.."
+ if (s.length() > COLUMN_1_WIDTH) {
+ trimmedVName = s.substring(0, COLUMN_1_WIDTH - 1);
+ trimmedVName = trimmedVName + "..";
+ }
+
+ result = trimmedVName + " ";
+ int toFill = (int) (spaceRemaining * percent);
+ for (int i = 0; i < toFill; i++) {
+ result += ".";
+ }
+ }
+ return result;
+ }
+
+ private String getMode(String name, Map workMap) {
+ String mode = "container";
+ BaseWork work = workMap.get(name);
+ if (work != null) {
+ // uber > llap > container
+ if (work.getUberMode()) {
+ mode = "uber";
+ } else if (work.getLlapMode()) {
+ mode = "llap";
+ } else {
+ mode = "container";
+ }
+ }
+ return mode;
+ }
+
+ static class VertexProgress {
+ private final int totalTaskCount;
+ private final int succeededTaskCount;
+ private final int failedTaskAttemptCount;
+ private final long killedTaskAttemptCount;
+ private final int runningTaskCount;
+ private final DAGStatus.State dagState;
+
+ VertexProgress(Progress progress, DAGStatus.State dagState) {
+ this(progress.getTotalTaskCount(), progress.getSucceededTaskCount(),
+ progress.getFailedTaskAttemptCount(), progress.getKilledTaskAttemptCount(),
+ progress.getRunningTaskCount(), dagState);
+ }
+
+ VertexProgress(int totalTaskCount, int succeededTaskCount, int failedTaskAttemptCount,
+ int killedTaskAttemptCount, int runningTaskCount, DAGStatus.State dagState) {
+ this.totalTaskCount = totalTaskCount;
+ this.succeededTaskCount = succeededTaskCount;
+ this.failedTaskAttemptCount = failedTaskAttemptCount;
+ this.killedTaskAttemptCount = killedTaskAttemptCount;
+ this.runningTaskCount = runningTaskCount;
+ this.dagState = dagState;
+ }
+
+ boolean isRunning() {
+ return succeededTaskCount < totalTaskCount && (succeededTaskCount > 0 || runningTaskCount > 0
+ || failedTaskAttemptCount > 0);
+ }
+
+ String vertexStatus(VertexStatus vertexStatus) {
+ // To get vertex status we can use DAGClient.getVertexStatus(), but it will be expensive to
+ // get status from AM for every refresh of the UI. Lets infer the state from task counts.
+ // Only if DAG is FAILED or KILLED the vertex status is fetched from AM.
+ VertexStatus.State vertexState = VertexStatus.State.INITIALIZING;
+ if (totalTaskCount > 0) {
+ vertexState = VertexStatus.State.INITED;
+ }
+
+ // RUNNING state
+ if (isRunning()) {
+ vertexState = VertexStatus.State.RUNNING;
+ }
+
+ // SUCCEEDED state
+ if (succeededTaskCount == totalTaskCount) {
+ vertexState = VertexStatus.State.SUCCEEDED;
+ }
+
+ // DAG might have been killed, lets try to get vertex state from AM before dying
+ // KILLED or FAILED state
+ if (dagState == KILLED) {
+ if (vertexStatus != null) {
+ vertexState = vertexStatus.getState();
+ }
+ }
+ return vertexState.toString();
+ }
+
+ // "TOTAL", "COMPLETED", "RUNNING", "PENDING", "FAILED", "KILLED"
+
+ String total() {
+ return String.valueOf(totalTaskCount);
+ }
+
+ String completed() {
+ return String.valueOf(succeededTaskCount);
+ }
+
+ String running() {
+ return String.valueOf(runningTaskCount);
+ }
+
+ String pending() {
+ return String.valueOf(totalTaskCount - succeededTaskCount - runningTaskCount);
+ }
+
+ String failed() {
+ return String.valueOf(failedTaskAttemptCount);
+ }
+
+ String killed() {
+ return String.valueOf(killedTaskAttemptCount);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o)
+ return true;
+ if (o == null || getClass() != o.getClass())
+ return false;
+
+ VertexProgress that = (VertexProgress) o;
+
+ if (totalTaskCount != that.totalTaskCount)
+ return false;
+ if (succeededTaskCount != that.succeededTaskCount)
+ return false;
+ if (failedTaskAttemptCount != that.failedTaskAttemptCount)
+ return false;
+ if (killedTaskAttemptCount != that.killedTaskAttemptCount)
+ return false;
+ if (runningTaskCount != that.runningTaskCount)
+ return false;
+ return dagState == that.dagState;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = totalTaskCount;
+ result = 31 * result + succeededTaskCount;
+ result = 31 * result + failedTaskAttemptCount;
+ result = 31 * result + (int) (killedTaskAttemptCount ^ (killedTaskAttemptCount >>> 32));
+ result = 31 * result + runningTaskCount;
+ result = 31 * result + dagState.hashCode();
+ return result;
+ }
+ }
+}
diff --git ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
index c5b3517..ed854bf 100644
--- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
+++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
@@ -26,8 +26,7 @@
import static org.apache.hadoop.hive.serde.serdeConstants.MAPKEY_DELIM;
import static org.apache.hadoop.hive.serde.serdeConstants.SERIALIZATION_FORMAT;
import static org.apache.hadoop.hive.serde.serdeConstants.STRING_TYPE_NAME;
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
+
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
@@ -127,11 +126,11 @@
import org.apache.hadoop.hive.ql.exec.FunctionRegistry;
import org.apache.hadoop.hive.ql.exec.FunctionTask;
import org.apache.hadoop.hive.ql.exec.FunctionUtils;
-import org.apache.hadoop.hive.ql.exec.InPlaceUpdates;
import org.apache.hadoop.hive.ql.exec.SerializationUtilities;
import org.apache.hadoop.hive.ql.exec.Utilities;
import org.apache.hadoop.hive.ql.index.HiveIndexHandler;
import org.apache.hadoop.hive.ql.io.AcidUtils;
+import org.apache.hadoop.hive.common.log.InPlaceUpdate;
import org.apache.hadoop.hive.ql.log.PerfLogger;
import org.apache.hadoop.hive.ql.optimizer.listbucketingpruner.ListBucketingPrunerUtils;
import org.apache.hadoop.hive.ql.plan.AddPartitionDesc;
@@ -1898,7 +1897,7 @@ private void constructOneLBLocationMap(FileStatus fSta,
final AtomicInteger partitionsLoaded = new AtomicInteger(0);
final boolean inPlaceEligible = conf.getLong("fs.trash.interval", 0) <= 0
- && InPlaceUpdates.inPlaceEligible(conf);
+ && InPlaceUpdate.canRenderInPlace(conf) && !SessionState.getConsole().getIsSilent();
final PrintStream ps = (inPlaceEligible) ? SessionState.getConsole().getInfoStream() : null;
final SessionState parentSession = SessionState.get();
@@ -1926,9 +1925,9 @@ public Void call() throws Exception {
if (inPlaceEligible) {
synchronized (ps) {
- InPlaceUpdates.rePositionCursor(ps);
+ InPlaceUpdate.rePositionCursor(ps);
partitionsLoaded.incrementAndGet();
- InPlaceUpdates.reprintLine(ps, "Loaded : " + partitionsLoaded.get() + "/"
+ InPlaceUpdate.reprintLine(ps, "Loaded : " + partitionsLoaded.get() + "/"
+ partsToLoad + " partitions.");
}
}
diff --git ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
index 453e0a5..6d64b55 100644
--- ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
+++ ql/src/java/org/apache/hadoop/hive/ql/session/SessionState.java
@@ -69,6 +69,7 @@
import org.apache.hadoop.hive.ql.lockmgr.LockException;
import org.apache.hadoop.hive.ql.lockmgr.TxnManagerFactory;
import org.apache.hadoop.hive.ql.log.PerfLogger;
+import org.apache.hadoop.hive.common.log.ProgressMonitor;
import org.apache.hadoop.hive.ql.metadata.Hive;
import org.apache.hadoop.hive.ql.metadata.HiveException;
import org.apache.hadoop.hive.ql.metadata.HiveUtils;
@@ -185,6 +186,7 @@
private HiveAuthorizationProvider authorizer;
private HiveAuthorizer authorizerV2;
+ private ProgressMonitor progressMonitor;
public enum AuthorizationMode{V1, V2};
@@ -1558,6 +1560,7 @@ public void close() throws IOException {
// removes the threadlocal variables, closes underlying HMS connection
Hive.closeCurrent();
}
+ progressMonitor = null;
}
private void unCacheDataNucleusClassLoaders() {
@@ -1738,6 +1741,15 @@ public void setForwardedAddresses(List forwardedAddresses) {
public String getReloadableAuxJars() {
return StringUtils.join(preReloadableAuxJars, ',');
}
+
+ public void updateProgress(ProgressMonitor progressMonitor) {
+ this.progressMonitor = progressMonitor;
+ }
+
+ public ProgressMonitor progressMonitor() {
+ return progressMonitor;
+ }
+
}
class ResourceMaps {
diff --git ql/src/test/org/apache/hadoop/hive/ql/exec/tez/monitoring/TestTezProgressMonitor.java ql/src/test/org/apache/hadoop/hive/ql/exec/tez/monitoring/TestTezProgressMonitor.java
new file mode 100644
index 0000000..648d625
--- /dev/null
+++ ql/src/test/org/apache/hadoop/hive/ql/exec/tez/monitoring/TestTezProgressMonitor.java
@@ -0,0 +1,101 @@
+package org.apache.hadoop.hive.ql.exec.tez.monitoring;
+
+import org.apache.hadoop.hive.ql.plan.BaseWork;
+import org.apache.hadoop.hive.ql.session.SessionState;
+import org.apache.tez.dag.api.TezException;
+import org.apache.tez.dag.api.client.DAGClient;
+import org.apache.tez.dag.api.client.DAGStatus;
+import org.apache.tez.dag.api.client.Progress;
+import org.apache.tez.dag.api.client.StatusGetOpts;
+import org.apache.tez.dag.api.client.VertexStatus;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Matchers;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.hasItems;
+import static org.hamcrest.CoreMatchers.sameInstance;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+import static org.mockito.Matchers.anySet;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Matchers.isNull;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+import static org.mockito.Mockito.when;
+
+@RunWith(MockitoJUnitRunner.class)
+public class TestTezProgressMonitor {
+
+ private static final String REDUCER = "Reducer";
+ private static final String MAPPER = "Mapper";
+ @Mock
+ private DAGClient dagClient;
+ @Mock
+ private SessionState.LogHelper console;
+ @Mock
+ private DAGStatus dagStatus;
+ @Mock
+ private Progress mapperProgress;
+ @Mock
+ private Progress reducerProgress;
+ @Mock
+ private VertexStatus succeeded;
+ @Mock
+ private VertexStatus running;
+
+ private Map progressMap() {
+ return new HashMap() {{
+ put(MAPPER, setup(mapperProgress, 2, 1, 3, 4, 5));
+ put(REDUCER, setup(reducerProgress, 3, 2, 1, 0, 1));
+ }};
+ }
+
+ private Progress setup(Progress progressMock, int total, int succeeded, int failedAttempt,
+ int killedAttempt, int running) {
+ when(progressMock.getTotalTaskCount()).thenReturn(total);
+ when(progressMock.getSucceededTaskCount()).thenReturn(succeeded);
+ when(progressMock.getFailedTaskAttemptCount()).thenReturn(failedAttempt);
+ when(progressMock.getKilledTaskAttemptCount()).thenReturn(killedAttempt);
+ when(progressMock.getRunningTaskCount()).thenReturn(running);
+ return progressMock;
+ }
+
+ @Test
+ public void setupInternalStateOnObjectCreation() throws IOException, TezException {
+ when(dagStatus.getState()).thenReturn(DAGStatus.State.RUNNING);
+ when(dagClient.getVertexStatus(eq(MAPPER), anySet())).thenReturn(succeeded);
+ when(dagClient.getVertexStatus(eq(REDUCER), anySet())).thenReturn(running);
+
+ TezProgressMonitor monitor =
+ new TezProgressMonitor(dagClient, dagStatus, new HashMap(), progressMap(), console,
+ Long.MAX_VALUE);
+
+ verify(dagClient).getVertexStatus(eq(MAPPER), isNull(Set.class));
+ verify(dagClient).getVertexStatus(eq(REDUCER), isNull(Set.class));
+ verifyNoMoreInteractions(dagClient);
+
+ assertThat(monitor.vertexStatusMap.keySet(), hasItems(MAPPER, REDUCER));
+ assertThat(monitor.vertexStatusMap.get(MAPPER), is(sameInstance(succeeded)));
+ assertThat(monitor.vertexStatusMap.get(REDUCER), is(sameInstance(running)));
+
+ assertThat(monitor.progressCountsMap.keySet(), hasItems(MAPPER, REDUCER));
+ TezProgressMonitor.VertexProgress expectedMapperState =
+ new TezProgressMonitor.VertexProgress(2, 1, 3, 4, 5, DAGStatus.State.RUNNING);
+ assertThat(monitor.progressCountsMap.get(MAPPER), is(equalTo(expectedMapperState)));
+
+ TezProgressMonitor.VertexProgress expectedReducerState =
+ new TezProgressMonitor.VertexProgress(3, 2, 1, 0, 1, DAGStatus.State.RUNNING);
+ assertThat(monitor.progressCountsMap.get(REDUCER), is(equalTo(expectedReducerState)));
+
+
+ }
+
+}
\ No newline at end of file
diff --git service-rpc/if/TCLIService.thrift service-rpc/if/TCLIService.thrift
index a4fa7b0..66a78fb 100644
--- service-rpc/if/TCLIService.thrift
+++ service-rpc/if/TCLIService.thrift
@@ -1202,6 +1202,31 @@ struct TRenewDelegationTokenResp {
1: required TStatus status
}
+struct TProgressUpdateReq {
+ // Operation against which to get the progress bar update
+ 1: required TOperationHandle operationHandle
+}
+
+enum TJobExecutionStatus {
+ SUBMITTED,
+ INITING,
+ RUNNING,
+ SUCCEEDED,
+ KILLED,
+ FAILED,
+ ERROR,
+ NOT_AVAILABLE
+}
+
+struct TProgressUpdateResp {
+ 1: required list headerNames
+ 2: required list> rows
+ 3: required double progressedPercentage
+ 4: required TJobExecutionStatus status
+ 5: required string footerSummary
+ 6: required i64 startTime
+}
+
service TCLIService {
TOpenSessionResp OpenSession(1:TOpenSessionReq req);
@@ -1245,4 +1270,6 @@ service TCLIService {
TCancelDelegationTokenResp CancelDelegationToken(1:TCancelDelegationTokenReq req);
TRenewDelegationTokenResp RenewDelegationToken(1:TRenewDelegationTokenReq req);
+
+ TProgressUpdateResp GetProgressUpdate(1:TProgressUpdateReq req);
}
diff --git service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp
index 3597d44..dfc6e26 100644
--- service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp
+++ service-rpc/src/gen/thrift/gen-cpp/TCLIService.cpp
@@ -3935,6 +3935,193 @@ uint32_t TCLIService_RenewDelegationToken_presult::read(::apache::thrift::protoc
return xfer;
}
+
+TCLIService_GetProgressUpdate_args::~TCLIService_GetProgressUpdate_args() throw() {
+}
+
+
+uint32_t TCLIService_GetProgressUpdate_args::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->req.read(iprot);
+ this->__isset.req = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t TCLIService_GetProgressUpdate_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
+ xfer += oprot->writeStructBegin("TCLIService_GetProgressUpdate_args");
+
+ xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->req.write(oprot);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+
+TCLIService_GetProgressUpdate_pargs::~TCLIService_GetProgressUpdate_pargs() throw() {
+}
+
+
+uint32_t TCLIService_GetProgressUpdate_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
+ xfer += oprot->writeStructBegin("TCLIService_GetProgressUpdate_pargs");
+
+ xfer += oprot->writeFieldBegin("req", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += (*(this->req)).write(oprot);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+
+TCLIService_GetProgressUpdate_result::~TCLIService_GetProgressUpdate_result() throw() {
+}
+
+
+uint32_t TCLIService_GetProgressUpdate_result::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->success.read(iprot);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
+uint32_t TCLIService_GetProgressUpdate_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+ uint32_t xfer = 0;
+
+ xfer += oprot->writeStructBegin("TCLIService_GetProgressUpdate_result");
+
+ if (this->__isset.success) {
+ xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRUCT, 0);
+ xfer += this->success.write(oprot);
+ xfer += oprot->writeFieldEnd();
+ }
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+
+TCLIService_GetProgressUpdate_presult::~TCLIService_GetProgressUpdate_presult() throw() {
+}
+
+
+uint32_t TCLIService_GetProgressUpdate_presult::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 0:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += (*(this->success)).read(iprot);
+ this->__isset.success = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ return xfer;
+}
+
void TCLIServiceClient::OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req)
{
send_OpenSession(req);
@@ -5153,6 +5340,64 @@ void TCLIServiceClient::recv_RenewDelegationToken(TRenewDelegationTokenResp& _re
throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "RenewDelegationToken failed: unknown result");
}
+void TCLIServiceClient::GetProgressUpdate(TProgressUpdateResp& _return, const TProgressUpdateReq& req)
+{
+ send_GetProgressUpdate(req);
+ recv_GetProgressUpdate(_return);
+}
+
+void TCLIServiceClient::send_GetProgressUpdate(const TProgressUpdateReq& req)
+{
+ int32_t cseqid = 0;
+ oprot_->writeMessageBegin("GetProgressUpdate", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ TCLIService_GetProgressUpdate_pargs args;
+ args.req = &req;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+}
+
+void TCLIServiceClient::recv_GetProgressUpdate(TProgressUpdateResp& _return)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("GetProgressUpdate") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ TCLIService_GetProgressUpdate_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ return;
+ }
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetProgressUpdate failed: unknown result");
+}
+
bool TCLIServiceProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) {
ProcessMap::iterator pfn;
pfn = processMap_.find(fname);
@@ -6306,6 +6551,60 @@ void TCLIServiceProcessor::process_RenewDelegationToken(int32_t seqid, ::apache:
}
}
+void TCLIServiceProcessor::process_GetProgressUpdate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+ void* ctx = NULL;
+ if (this->eventHandler_.get() != NULL) {
+ ctx = this->eventHandler_->getContext("TCLIService.GetProgressUpdate", callContext);
+ }
+ ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetProgressUpdate");
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preRead(ctx, "TCLIService.GetProgressUpdate");
+ }
+
+ TCLIService_GetProgressUpdate_args args;
+ args.read(iprot);
+ iprot->readMessageEnd();
+ uint32_t bytes = iprot->getTransport()->readEnd();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postRead(ctx, "TCLIService.GetProgressUpdate", bytes);
+ }
+
+ TCLIService_GetProgressUpdate_result result;
+ try {
+ iface_->GetProgressUpdate(result.success, args.req);
+ result.__isset.success = true;
+ } catch (const std::exception& e) {
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->handlerError(ctx, "TCLIService.GetProgressUpdate");
+ }
+
+ ::apache::thrift::TApplicationException x(e.what());
+ oprot->writeMessageBegin("GetProgressUpdate", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+ x.write(oprot);
+ oprot->writeMessageEnd();
+ oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+ return;
+ }
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->preWrite(ctx, "TCLIService.GetProgressUpdate");
+ }
+
+ oprot->writeMessageBegin("GetProgressUpdate", ::apache::thrift::protocol::T_REPLY, seqid);
+ result.write(oprot);
+ oprot->writeMessageEnd();
+ bytes = oprot->getTransport()->writeEnd();
+ oprot->getTransport()->flush();
+
+ if (this->eventHandler_.get() != NULL) {
+ this->eventHandler_->postWrite(ctx, "TCLIService.GetProgressUpdate", bytes);
+ }
+}
+
::boost::shared_ptr< ::apache::thrift::TProcessor > TCLIServiceProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) {
::apache::thrift::ReleaseHandler< TCLIServiceIfFactory > cleanup(handlerFactory_);
::boost::shared_ptr< TCLIServiceIf > handler(handlerFactory_->getHandler(connInfo), cleanup);
@@ -8077,5 +8376,89 @@ void TCLIServiceConcurrentClient::recv_RenewDelegationToken(TRenewDelegationToke
} // end while(true)
}
+void TCLIServiceConcurrentClient::GetProgressUpdate(TProgressUpdateResp& _return, const TProgressUpdateReq& req)
+{
+ int32_t seqid = send_GetProgressUpdate(req);
+ recv_GetProgressUpdate(_return, seqid);
+}
+
+int32_t TCLIServiceConcurrentClient::send_GetProgressUpdate(const TProgressUpdateReq& req)
+{
+ int32_t cseqid = this->sync_.generateSeqId();
+ ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_);
+ oprot_->writeMessageBegin("GetProgressUpdate", ::apache::thrift::protocol::T_CALL, cseqid);
+
+ TCLIService_GetProgressUpdate_pargs args;
+ args.req = &req;
+ args.write(oprot_);
+
+ oprot_->writeMessageEnd();
+ oprot_->getTransport()->writeEnd();
+ oprot_->getTransport()->flush();
+
+ sentry.commit();
+ return cseqid;
+}
+
+void TCLIServiceConcurrentClient::recv_GetProgressUpdate(TProgressUpdateResp& _return, const int32_t seqid)
+{
+
+ int32_t rseqid = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TMessageType mtype;
+
+ // the read mutex gets dropped and reacquired as part of waitForWork()
+ // The destructor of this sentry wakes up other clients
+ ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid);
+
+ while(true) {
+ if(!this->sync_.getPending(fname, mtype, rseqid)) {
+ iprot_->readMessageBegin(fname, mtype, rseqid);
+ }
+ if(seqid == rseqid) {
+ if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+ ::apache::thrift::TApplicationException x;
+ x.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ sentry.commit();
+ throw x;
+ }
+ if (mtype != ::apache::thrift::protocol::T_REPLY) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+ }
+ if (fname.compare("GetProgressUpdate") != 0) {
+ iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ // in a bad state, don't commit
+ using ::apache::thrift::protocol::TProtocolException;
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ }
+ TCLIService_GetProgressUpdate_presult result;
+ result.success = &_return;
+ result.read(iprot_);
+ iprot_->readMessageEnd();
+ iprot_->getTransport()->readEnd();
+
+ if (result.__isset.success) {
+ // _return pointer has now been filled
+ sentry.commit();
+ return;
+ }
+ // in a bad state, don't commit
+ throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetProgressUpdate failed: unknown result");
+ }
+ // seqid != rseqid
+ this->sync_.updatePending(fname, mtype, rseqid);
+
+ // this will temporarily unlock the readMutex, and let other clients get work done
+ this->sync_.waitForWork(seqid);
+ } // end while(true)
+}
+
}}}}} // namespace
diff --git service-rpc/src/gen/thrift/gen-cpp/TCLIService.h service-rpc/src/gen/thrift/gen-cpp/TCLIService.h
index 5fd423d..77a55a1 100644
--- service-rpc/src/gen/thrift/gen-cpp/TCLIService.h
+++ service-rpc/src/gen/thrift/gen-cpp/TCLIService.h
@@ -42,6 +42,7 @@ class TCLIServiceIf {
virtual void GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req) = 0;
virtual void CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req) = 0;
virtual void RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req) = 0;
+ virtual void GetProgressUpdate(TProgressUpdateResp& _return, const TProgressUpdateReq& req) = 0;
};
class TCLIServiceIfFactory {
@@ -134,6 +135,9 @@ class TCLIServiceNull : virtual public TCLIServiceIf {
void RenewDelegationToken(TRenewDelegationTokenResp& /* _return */, const TRenewDelegationTokenReq& /* req */) {
return;
}
+ void GetProgressUpdate(TProgressUpdateResp& /* _return */, const TProgressUpdateReq& /* req */) {
+ return;
+ }
};
typedef struct _TCLIService_OpenSession_args__isset {
@@ -2320,6 +2324,110 @@ class TCLIService_RenewDelegationToken_presult {
};
+typedef struct _TCLIService_GetProgressUpdate_args__isset {
+ _TCLIService_GetProgressUpdate_args__isset() : req(false) {}
+ bool req :1;
+} _TCLIService_GetProgressUpdate_args__isset;
+
+class TCLIService_GetProgressUpdate_args {
+ public:
+
+ TCLIService_GetProgressUpdate_args(const TCLIService_GetProgressUpdate_args&);
+ TCLIService_GetProgressUpdate_args& operator=(const TCLIService_GetProgressUpdate_args&);
+ TCLIService_GetProgressUpdate_args() {
+ }
+
+ virtual ~TCLIService_GetProgressUpdate_args() throw();
+ TProgressUpdateReq req;
+
+ _TCLIService_GetProgressUpdate_args__isset __isset;
+
+ void __set_req(const TProgressUpdateReq& val);
+
+ bool operator == (const TCLIService_GetProgressUpdate_args & rhs) const
+ {
+ if (!(req == rhs.req))
+ return false;
+ return true;
+ }
+ bool operator != (const TCLIService_GetProgressUpdate_args &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const TCLIService_GetProgressUpdate_args & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+
+class TCLIService_GetProgressUpdate_pargs {
+ public:
+
+
+ virtual ~TCLIService_GetProgressUpdate_pargs() throw();
+ const TProgressUpdateReq* req;
+
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _TCLIService_GetProgressUpdate_result__isset {
+ _TCLIService_GetProgressUpdate_result__isset() : success(false) {}
+ bool success :1;
+} _TCLIService_GetProgressUpdate_result__isset;
+
+class TCLIService_GetProgressUpdate_result {
+ public:
+
+ TCLIService_GetProgressUpdate_result(const TCLIService_GetProgressUpdate_result&);
+ TCLIService_GetProgressUpdate_result& operator=(const TCLIService_GetProgressUpdate_result&);
+ TCLIService_GetProgressUpdate_result() {
+ }
+
+ virtual ~TCLIService_GetProgressUpdate_result() throw();
+ TProgressUpdateResp success;
+
+ _TCLIService_GetProgressUpdate_result__isset __isset;
+
+ void __set_success(const TProgressUpdateResp& val);
+
+ bool operator == (const TCLIService_GetProgressUpdate_result & rhs) const
+ {
+ if (!(success == rhs.success))
+ return false;
+ return true;
+ }
+ bool operator != (const TCLIService_GetProgressUpdate_result &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const TCLIService_GetProgressUpdate_result & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+};
+
+typedef struct _TCLIService_GetProgressUpdate_presult__isset {
+ _TCLIService_GetProgressUpdate_presult__isset() : success(false) {}
+ bool success :1;
+} _TCLIService_GetProgressUpdate_presult__isset;
+
+class TCLIService_GetProgressUpdate_presult {
+ public:
+
+
+ virtual ~TCLIService_GetProgressUpdate_presult() throw();
+ TProgressUpdateResp* success;
+
+ _TCLIService_GetProgressUpdate_presult__isset __isset;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+
+};
+
class TCLIServiceClient : virtual public TCLIServiceIf {
public:
TCLIServiceClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) {
@@ -2408,6 +2516,9 @@ class TCLIServiceClient : virtual public TCLIServiceIf {
void RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req);
void send_RenewDelegationToken(const TRenewDelegationTokenReq& req);
void recv_RenewDelegationToken(TRenewDelegationTokenResp& _return);
+ void GetProgressUpdate(TProgressUpdateResp& _return, const TProgressUpdateReq& req);
+ void send_GetProgressUpdate(const TProgressUpdateReq& req);
+ void recv_GetProgressUpdate(TProgressUpdateResp& _return);
protected:
boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_;
@@ -2444,6 +2555,7 @@ class TCLIServiceProcessor : public ::apache::thrift::TDispatchProcessor {
void process_GetDelegationToken(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
void process_CancelDelegationToken(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
void process_RenewDelegationToken(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
+ void process_GetProgressUpdate(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
public:
TCLIServiceProcessor(boost::shared_ptr iface) :
iface_(iface) {
@@ -2468,6 +2580,7 @@ class TCLIServiceProcessor : public ::apache::thrift::TDispatchProcessor {
processMap_["GetDelegationToken"] = &TCLIServiceProcessor::process_GetDelegationToken;
processMap_["CancelDelegationToken"] = &TCLIServiceProcessor::process_CancelDelegationToken;
processMap_["RenewDelegationToken"] = &TCLIServiceProcessor::process_RenewDelegationToken;
+ processMap_["GetProgressUpdate"] = &TCLIServiceProcessor::process_GetProgressUpdate;
}
virtual ~TCLIServiceProcessor() {}
@@ -2706,6 +2819,16 @@ class TCLIServiceMultiface : virtual public TCLIServiceIf {
return;
}
+ void GetProgressUpdate(TProgressUpdateResp& _return, const TProgressUpdateReq& req) {
+ size_t sz = ifaces_.size();
+ size_t i = 0;
+ for (; i < (sz - 1); ++i) {
+ ifaces_[i]->GetProgressUpdate(_return, req);
+ }
+ ifaces_[i]->GetProgressUpdate(_return, req);
+ return;
+ }
+
};
// The 'concurrent' client is a thread safe client that correctly handles
@@ -2799,6 +2922,9 @@ class TCLIServiceConcurrentClient : virtual public TCLIServiceIf {
void RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req);
int32_t send_RenewDelegationToken(const TRenewDelegationTokenReq& req);
void recv_RenewDelegationToken(TRenewDelegationTokenResp& _return, const int32_t seqid);
+ void GetProgressUpdate(TProgressUpdateResp& _return, const TProgressUpdateReq& req);
+ int32_t send_GetProgressUpdate(const TProgressUpdateReq& req);
+ void recv_GetProgressUpdate(TProgressUpdateResp& _return, const int32_t seqid);
protected:
boost::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_;
boost::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_;
diff --git service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp
index 5d7caf9..743b792 100644
--- service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp
+++ service-rpc/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp
@@ -127,6 +127,11 @@ class TCLIServiceHandler : virtual public TCLIServiceIf {
printf("RenewDelegationToken\n");
}
+ void GetProgressUpdate(TProgressUpdateResp& _return, const TProgressUpdateReq& req) {
+ // Your implementation goes here
+ printf("GetProgressUpdate\n");
+ }
+
};
int main(int argc, char **argv) {
diff --git service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp
index 2f460e8..35ac180 100644
--- service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp
+++ service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.cpp
@@ -269,6 +269,28 @@ const char* _kTFetchOrientationNames[] = {
};
const std::map _TFetchOrientation_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(6, _kTFetchOrientationValues, _kTFetchOrientationNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+int _kTJobExecutionStatusValues[] = {
+ TJobExecutionStatus::SUBMITTED,
+ TJobExecutionStatus::INITING,
+ TJobExecutionStatus::RUNNING,
+ TJobExecutionStatus::SUCCEEDED,
+ TJobExecutionStatus::KILLED,
+ TJobExecutionStatus::FAILED,
+ TJobExecutionStatus::ERROR,
+ TJobExecutionStatus::NOT_AVAILABLE
+};
+const char* _kTJobExecutionStatusNames[] = {
+ "SUBMITTED",
+ "INITING",
+ "RUNNING",
+ "SUCCEEDED",
+ "KILLED",
+ "FAILED",
+ "ERROR",
+ "NOT_AVAILABLE"
+};
+const std::map _TJobExecutionStatus_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(8, _kTJobExecutionStatusValues, _kTJobExecutionStatusNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+
TTypeQualifierValue::~TTypeQualifierValue() throw() {
}
@@ -9984,4 +10006,353 @@ void TRenewDelegationTokenResp::printTo(std::ostream& out) const {
out << ")";
}
+
+TProgressUpdateReq::~TProgressUpdateReq() throw() {
+}
+
+
+void TProgressUpdateReq::__set_operationHandle(const TOperationHandle& val) {
+ this->operationHandle = val;
+}
+
+uint32_t TProgressUpdateReq::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_operationHandle = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_STRUCT) {
+ xfer += this->operationHandle.read(iprot);
+ isset_operationHandle = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_operationHandle)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t TProgressUpdateReq::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
+ xfer += oprot->writeStructBegin("TProgressUpdateReq");
+
+ xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1);
+ xfer += this->operationHandle.write(oprot);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(TProgressUpdateReq &a, TProgressUpdateReq &b) {
+ using ::std::swap;
+ swap(a.operationHandle, b.operationHandle);
+}
+
+TProgressUpdateReq::TProgressUpdateReq(const TProgressUpdateReq& other302) {
+ operationHandle = other302.operationHandle;
+}
+TProgressUpdateReq& TProgressUpdateReq::operator=(const TProgressUpdateReq& other303) {
+ operationHandle = other303.operationHandle;
+ return *this;
+}
+void TProgressUpdateReq::printTo(std::ostream& out) const {
+ using ::apache::thrift::to_string;
+ out << "TProgressUpdateReq(";
+ out << "operationHandle=" << to_string(operationHandle);
+ out << ")";
+}
+
+
+TProgressUpdateResp::~TProgressUpdateResp() throw() {
+}
+
+
+void TProgressUpdateResp::__set_headerNames(const std::vector & val) {
+ this->headerNames = val;
+}
+
+void TProgressUpdateResp::__set_rows(const std::vector > & val) {
+ this->rows = val;
+}
+
+void TProgressUpdateResp::__set_progressedPercentage(const double val) {
+ this->progressedPercentage = val;
+}
+
+void TProgressUpdateResp::__set_status(const TJobExecutionStatus::type val) {
+ this->status = val;
+}
+
+void TProgressUpdateResp::__set_footerSummary(const std::string& val) {
+ this->footerSummary = val;
+}
+
+void TProgressUpdateResp::__set_startTime(const int64_t val) {
+ this->startTime = val;
+}
+
+uint32_t TProgressUpdateResp::read(::apache::thrift::protocol::TProtocol* iprot) {
+
+ apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
+ uint32_t xfer = 0;
+ std::string fname;
+ ::apache::thrift::protocol::TType ftype;
+ int16_t fid;
+
+ xfer += iprot->readStructBegin(fname);
+
+ using ::apache::thrift::protocol::TProtocolException;
+
+ bool isset_headerNames = false;
+ bool isset_rows = false;
+ bool isset_progressedPercentage = false;
+ bool isset_status = false;
+ bool isset_footerSummary = false;
+ bool isset_startTime = false;
+
+ while (true)
+ {
+ xfer += iprot->readFieldBegin(fname, ftype, fid);
+ if (ftype == ::apache::thrift::protocol::T_STOP) {
+ break;
+ }
+ switch (fid)
+ {
+ case 1:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->headerNames.clear();
+ uint32_t _size304;
+ ::apache::thrift::protocol::TType _etype307;
+ xfer += iprot->readListBegin(_etype307, _size304);
+ this->headerNames.resize(_size304);
+ uint32_t _i308;
+ for (_i308 = 0; _i308 < _size304; ++_i308)
+ {
+ xfer += iprot->readString(this->headerNames[_i308]);
+ }
+ xfer += iprot->readListEnd();
+ }
+ isset_headerNames = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 2:
+ if (ftype == ::apache::thrift::protocol::T_LIST) {
+ {
+ this->rows.clear();
+ uint32_t _size309;
+ ::apache::thrift::protocol::TType _etype312;
+ xfer += iprot->readListBegin(_etype312, _size309);
+ this->rows.resize(_size309);
+ uint32_t _i313;
+ for (_i313 = 0; _i313 < _size309; ++_i313)
+ {
+ {
+ this->rows[_i313].clear();
+ uint32_t _size314;
+ ::apache::thrift::protocol::TType _etype317;
+ xfer += iprot->readListBegin(_etype317, _size314);
+ this->rows[_i313].resize(_size314);
+ uint32_t _i318;
+ for (_i318 = 0; _i318 < _size314; ++_i318)
+ {
+ xfer += iprot->readString(this->rows[_i313][_i318]);
+ }
+ xfer += iprot->readListEnd();
+ }
+ }
+ xfer += iprot->readListEnd();
+ }
+ isset_rows = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 3:
+ if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
+ xfer += iprot->readDouble(this->progressedPercentage);
+ isset_progressedPercentage = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 4:
+ if (ftype == ::apache::thrift::protocol::T_I32) {
+ int32_t ecast319;
+ xfer += iprot->readI32(ecast319);
+ this->status = (TJobExecutionStatus::type)ecast319;
+ isset_status = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 5:
+ if (ftype == ::apache::thrift::protocol::T_STRING) {
+ xfer += iprot->readString(this->footerSummary);
+ isset_footerSummary = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ case 6:
+ if (ftype == ::apache::thrift::protocol::T_I64) {
+ xfer += iprot->readI64(this->startTime);
+ isset_startTime = true;
+ } else {
+ xfer += iprot->skip(ftype);
+ }
+ break;
+ default:
+ xfer += iprot->skip(ftype);
+ break;
+ }
+ xfer += iprot->readFieldEnd();
+ }
+
+ xfer += iprot->readStructEnd();
+
+ if (!isset_headerNames)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_rows)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_progressedPercentage)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_status)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_footerSummary)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ if (!isset_startTime)
+ throw TProtocolException(TProtocolException::INVALID_DATA);
+ return xfer;
+}
+
+uint32_t TProgressUpdateResp::write(::apache::thrift::protocol::TProtocol* oprot) const {
+ uint32_t xfer = 0;
+ apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
+ xfer += oprot->writeStructBegin("TProgressUpdateResp");
+
+ xfer += oprot->writeFieldBegin("headerNames", ::apache::thrift::protocol::T_LIST, 1);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->headerNames.size()));
+ std::vector ::const_iterator _iter320;
+ for (_iter320 = this->headerNames.begin(); _iter320 != this->headerNames.end(); ++_iter320)
+ {
+ xfer += oprot->writeString((*_iter320));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("rows", ::apache::thrift::protocol::T_LIST, 2);
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_LIST, static_cast(this->rows.size()));
+ std::vector > ::const_iterator _iter321;
+ for (_iter321 = this->rows.begin(); _iter321 != this->rows.end(); ++_iter321)
+ {
+ {
+ xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*_iter321).size()));
+ std::vector ::const_iterator _iter322;
+ for (_iter322 = (*_iter321).begin(); _iter322 != (*_iter321).end(); ++_iter322)
+ {
+ xfer += oprot->writeString((*_iter322));
+ }
+ xfer += oprot->writeListEnd();
+ }
+ }
+ xfer += oprot->writeListEnd();
+ }
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("progressedPercentage", ::apache::thrift::protocol::T_DOUBLE, 3);
+ xfer += oprot->writeDouble(this->progressedPercentage);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_I32, 4);
+ xfer += oprot->writeI32((int32_t)this->status);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("footerSummary", ::apache::thrift::protocol::T_STRING, 5);
+ xfer += oprot->writeString(this->footerSummary);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldBegin("startTime", ::apache::thrift::protocol::T_I64, 6);
+ xfer += oprot->writeI64(this->startTime);
+ xfer += oprot->writeFieldEnd();
+
+ xfer += oprot->writeFieldStop();
+ xfer += oprot->writeStructEnd();
+ return xfer;
+}
+
+void swap(TProgressUpdateResp &a, TProgressUpdateResp &b) {
+ using ::std::swap;
+ swap(a.headerNames, b.headerNames);
+ swap(a.rows, b.rows);
+ swap(a.progressedPercentage, b.progressedPercentage);
+ swap(a.status, b.status);
+ swap(a.footerSummary, b.footerSummary);
+ swap(a.startTime, b.startTime);
+}
+
+TProgressUpdateResp::TProgressUpdateResp(const TProgressUpdateResp& other323) {
+ headerNames = other323.headerNames;
+ rows = other323.rows;
+ progressedPercentage = other323.progressedPercentage;
+ status = other323.status;
+ footerSummary = other323.footerSummary;
+ startTime = other323.startTime;
+}
+TProgressUpdateResp& TProgressUpdateResp::operator=(const TProgressUpdateResp& other324) {
+ headerNames = other324.headerNames;
+ rows = other324.rows;
+ progressedPercentage = other324.progressedPercentage;
+ status = other324.status;
+ footerSummary = other324.footerSummary;
+ startTime = other324.startTime;
+ return *this;
+}
+void TProgressUpdateResp::printTo(std::ostream& out) const {
+ using ::apache::thrift::to_string;
+ out << "TProgressUpdateResp(";
+ out << "headerNames=" << to_string(headerNames);
+ out << ", " << "rows=" << to_string(rows);
+ out << ", " << "progressedPercentage=" << to_string(progressedPercentage);
+ out << ", " << "status=" << to_string(status);
+ out << ", " << "footerSummary=" << to_string(footerSummary);
+ out << ", " << "startTime=" << to_string(startTime);
+ out << ")";
+}
+
}}}}} // namespace
diff --git service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h
index b249544..94adda3 100644
--- service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h
+++ service-rpc/src/gen/thrift/gen-cpp/TCLIService_types.h
@@ -175,6 +175,21 @@ struct TFetchOrientation {
extern const std::map _TFetchOrientation_VALUES_TO_NAMES;
+struct TJobExecutionStatus {
+ enum type {
+ SUBMITTED = 0,
+ INITING = 1,
+ RUNNING = 2,
+ SUCCEEDED = 3,
+ KILLED = 4,
+ FAILED = 5,
+ ERROR = 6,
+ NOT_AVAILABLE = 7
+ };
+};
+
+extern const std::map _TJobExecutionStatus_VALUES_TO_NAMES;
+
typedef int32_t TTypeEntryPtr;
typedef std::string TIdentifier;
@@ -339,6 +354,10 @@ class TRenewDelegationTokenReq;
class TRenewDelegationTokenResp;
+class TProgressUpdateReq;
+
+class TProgressUpdateResp;
+
typedef struct _TTypeQualifierValue__isset {
_TTypeQualifierValue__isset() : i32Value(false), stringValue(false) {}
bool i32Value :1;
@@ -4470,6 +4489,111 @@ inline std::ostream& operator<<(std::ostream& out, const TRenewDelegationTokenRe
return out;
}
+
+class TProgressUpdateReq {
+ public:
+
+ TProgressUpdateReq(const TProgressUpdateReq&);
+ TProgressUpdateReq& operator=(const TProgressUpdateReq&);
+ TProgressUpdateReq() {
+ }
+
+ virtual ~TProgressUpdateReq() throw();
+ TOperationHandle operationHandle;
+
+ void __set_operationHandle(const TOperationHandle& val);
+
+ bool operator == (const TProgressUpdateReq & rhs) const
+ {
+ if (!(operationHandle == rhs.operationHandle))
+ return false;
+ return true;
+ }
+ bool operator != (const TProgressUpdateReq &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const TProgressUpdateReq & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+ virtual void printTo(std::ostream& out) const;
+};
+
+void swap(TProgressUpdateReq &a, TProgressUpdateReq &b);
+
+inline std::ostream& operator<<(std::ostream& out, const TProgressUpdateReq& obj)
+{
+ obj.printTo(out);
+ return out;
+}
+
+
+class TProgressUpdateResp {
+ public:
+
+ TProgressUpdateResp(const TProgressUpdateResp&);
+ TProgressUpdateResp& operator=(const TProgressUpdateResp&);
+ TProgressUpdateResp() : progressedPercentage(0), status((TJobExecutionStatus::type)0), footerSummary(), startTime(0) {
+ }
+
+ virtual ~TProgressUpdateResp() throw();
+ std::vector headerNames;
+ std::vector > rows;
+ double progressedPercentage;
+ TJobExecutionStatus::type status;
+ std::string footerSummary;
+ int64_t startTime;
+
+ void __set_headerNames(const std::vector & val);
+
+ void __set_rows(const std::vector > & val);
+
+ void __set_progressedPercentage(const double val);
+
+ void __set_status(const TJobExecutionStatus::type val);
+
+ void __set_footerSummary(const std::string& val);
+
+ void __set_startTime(const int64_t val);
+
+ bool operator == (const TProgressUpdateResp & rhs) const
+ {
+ if (!(headerNames == rhs.headerNames))
+ return false;
+ if (!(rows == rhs.rows))
+ return false;
+ if (!(progressedPercentage == rhs.progressedPercentage))
+ return false;
+ if (!(status == rhs.status))
+ return false;
+ if (!(footerSummary == rhs.footerSummary))
+ return false;
+ if (!(startTime == rhs.startTime))
+ return false;
+ return true;
+ }
+ bool operator != (const TProgressUpdateResp &rhs) const {
+ return !(*this == rhs);
+ }
+
+ bool operator < (const TProgressUpdateResp & ) const;
+
+ uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
+ uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
+
+ virtual void printTo(std::ostream& out) const;
+};
+
+void swap(TProgressUpdateResp &a, TProgressUpdateResp &b);
+
+inline std::ostream& operator<<(std::ostream& out, const TProgressUpdateResp& obj)
+{
+ obj.printTo(out);
+ return out;
+}
+
}}}}} // namespace
#endif
diff --git service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java
index 6dba051..c144d5b 100644
--- service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java
+++ service-rpc/src/gen/thrift/gen-javabean/org/apache/hive/service/rpc/thrift/TCLIService.java
@@ -6,33 +6,20 @@
*/
package org.apache.hive.service.rpc.thrift;
+import org.apache.thrift.TException;
+import org.apache.thrift.async.AsyncMethodCallback;
+import org.apache.thrift.protocol.TTupleProtocol;
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.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import javax.annotation.Generated;
+import java.util.*;
+
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)")
public class TCLIService {
@@ -81,6 +68,8 @@
public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException;
+ public TProgressUpdateResp GetProgressUpdate(TProgressUpdateReq req) throws org.apache.thrift.TException;
+
}
public interface AsyncIface {
@@ -127,6 +116,8 @@
public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void GetProgressUpdate(TProgressUpdateReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
}
public static class Client extends org.apache.thrift.TServiceClient implements Iface {
@@ -632,6 +623,29 @@ public TRenewDelegationTokenResp recv_RenewDelegationToken() throws org.apache.t
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "RenewDelegationToken failed: unknown result");
}
+ public TProgressUpdateResp GetProgressUpdate(TProgressUpdateReq req) throws org.apache.thrift.TException
+ {
+ send_GetProgressUpdate(req);
+ return recv_GetProgressUpdate();
+ }
+
+ public void send_GetProgressUpdate(TProgressUpdateReq req) throws org.apache.thrift.TException
+ {
+ GetProgressUpdate_args args = new GetProgressUpdate_args();
+ args.setReq(req);
+ sendBase("GetProgressUpdate", args);
+ }
+
+ public TProgressUpdateResp recv_GetProgressUpdate() throws org.apache.thrift.TException
+ {
+ GetProgressUpdate_result result = new GetProgressUpdate_result();
+ receiveBase(result, "GetProgressUpdate");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetProgressUpdate failed: unknown result");
+ }
+
}
public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory {
@@ -1322,6 +1336,38 @@ public TRenewDelegationTokenResp getResult() throws org.apache.thrift.TException
}
}
+ public void GetProgressUpdate(TProgressUpdateReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ GetProgressUpdate_call method_call = new GetProgressUpdate_call(req, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class GetProgressUpdate_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private TProgressUpdateReq req;
+ public GetProgressUpdate_call(TProgressUpdateReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+ super(client, protocolFactory, transport, resultHandler, false);
+ this.req = req;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetProgressUpdate", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ GetProgressUpdate_args args = new GetProgressUpdate_args();
+ args.setReq(req);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public TProgressUpdateResp getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_GetProgressUpdate();
+ }
+ }
+
}
public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor {
@@ -1356,6 +1402,7 @@ protected Processor(I iface, Map extends org.apache.thrift.ProcessFunction {
+ public GetProgressUpdate() {
+ super("GetProgressUpdate");
+ }
+
+ public GetProgressUpdate_args getEmptyArgsInstance() {
+ return new GetProgressUpdate_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public GetProgressUpdate_result getResult(I iface, GetProgressUpdate_args args) throws org.apache.thrift.TException {
+ GetProgressUpdate_result result = new GetProgressUpdate_result();
+ result.success = iface.GetProgressUpdate(args.req);
+ return result;
+ }
+ }
+
}
public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor {
@@ -1813,6 +1880,7 @@ protected AsyncProcessor(I iface, Map extends org.apache.thrift.AsyncProcessFunction {
+ public GetProgressUpdate() {
+ super("GetProgressUpdate");
+ }
+
+ public GetProgressUpdate_args getEmptyArgsInstance() {
+ return new GetProgressUpdate_args();
+ }
+
+ public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback() {
+ public void onComplete(TProgressUpdateResp o) {
+ GetProgressUpdate_result result = new GetProgressUpdate_result();
+ result.success = o;
+ try {
+ fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
+ return;
+ } catch (Exception e) {
+ LOGGER.error("Exception writing to internal frame buffer", e);
+ }
+ fb.close();
+ }
+ public void onError(Exception e) {
+ byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
+ org.apache.thrift.TBase msg;
+ GetProgressUpdate_result result = new GetProgressUpdate_result();
+ {
+ msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
+ msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
+ }
+ try {
+ fcall.sendResponse(fb,msg,msgType,seqid);
+ return;
+ } catch (Exception ex) {
+ LOGGER.error("Exception writing to internal frame buffer", ex);
+ }
+ fb.close();
+ }
+ };
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public void start(I iface, GetProgressUpdate_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
+ iface.GetProgressUpdate(args.req,resultHandler);
+ }
+ }
+
}
public static class OpenSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
@@ -18135,4 +18254,730 @@ public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken
}
+ public static class GetProgressUpdate_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetProgressUpdate_args");
+
+ private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1);
+
+ private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new GetProgressUpdate_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new GetProgressUpdate_argsTupleSchemeFactory());
+ }
+
+ private TProgressUpdateReq req; // 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 {
+ REQ((short)1, "req");
+
+ private static final Map byName = new HashMap();
+
+ 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: // REQ
+ return REQ;
+ 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
+ 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.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TProgressUpdateReq.class)));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetProgressUpdate_args.class, metaDataMap);
+ }
+
+ public GetProgressUpdate_args() {
+ }
+
+ public GetProgressUpdate_args(
+ TProgressUpdateReq req)
+ {
+ this();
+ this.req = req;
+ }
+
+ /**
+ * Performs a deep copy on other.
+ */
+ public GetProgressUpdate_args(GetProgressUpdate_args other) {
+ if (other.isSetReq()) {
+ this.req = new TProgressUpdateReq(other.req);
+ }
+ }
+
+ public GetProgressUpdate_args deepCopy() {
+ return new GetProgressUpdate_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.req = null;
+ }
+
+ public TProgressUpdateReq getReq() {
+ return this.req;
+ }
+
+ public void setReq(TProgressUpdateReq req) {
+ this.req = req;
+ }
+
+ public void unsetReq() {
+ this.req = null;
+ }
+
+ /** Returns true if field req is set (has been assigned a value) and false otherwise */
+ public boolean isSetReq() {
+ return this.req != null;
+ }
+
+ public void setReqIsSet(boolean value) {
+ if (!value) {
+ this.req = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case REQ:
+ if (value == null) {
+ unsetReq();
+ } else {
+ setReq((TProgressUpdateReq)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case REQ:
+ return getReq();
+
+ }
+ 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 REQ:
+ return isSetReq();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof GetProgressUpdate_args)
+ return this.equals((GetProgressUpdate_args)that);
+ return false;
+ }
+
+ public boolean equals(GetProgressUpdate_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 int hashCode() {
+ List