public Stage deepCopy() { return new Stage(this); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof Stage) return this.equals((Stage)that); return false; }
public Object getFieldValue(_Fields field) { switch (field) { case STAGE_ID: return getStageId(); case STAGE_TYPE: return getStageType(); case STAGE_ATTRIBUTES: return getStageAttributes(); case STAGE_COUNTERS: return getStageCounters(); case TASK_LIST: return getTaskList(); case DONE: return isDone(); case STARTED: return isStarted(); } 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 STAGE_ID: return isSetStageId(); case STAGE_TYPE: return isSetStageType(); case STAGE_ATTRIBUTES: return isSetStageAttributes(); case STAGE_COUNTERS: return isSetStageCounters(); case TASK_LIST: return isSetTaskList(); case DONE: return isSetDone(); case STARTED: return isSetStarted(); } throw new IllegalStateException(); }
for (org.apache.hadoop.hive.ql.plan.api.Stage stage : query .getStageList()) { if (stage.getStageId() == null) { continue; stage.setStarted(started.contains(stage.getStageId())); stage.setStageCounters(counters.get(stage.getStageId())); stage.setDone(done.contains(stage.getStageId())); for (org.apache.hadoop.hive.ql.plan.api.Task task : stage.getTaskList()) { task.setTaskCounters(counters.get(task.getTaskId())); if (task.getTaskType() == TaskType.OTHER) { task.setStarted(started.contains(stage.getStageId())); task.setDone(done.contains(stage.getStageId())); } else { task.setStarted(started.contains(task.getTaskId()));
new org.apache.hadoop.hive.ql.plan.api.Stage(); stage.setStageId(task.getId()); stage.setStageType(task.getType()); query.addToStageList(stage); org.apache.hadoop.hive.ql.plan.api.Task mapTask = new org.apache.hadoop.hive.ql.plan.api.Task(); mapTask.setTaskId(stage.getStageId() + "_MAP"); mapTask.setTaskType(TaskType.MAP); stage.addToTaskList(mapTask); populateOperatorGraph(mapTask, mrTask.getWork().getMapWork().getAliasToWork() .values()); org.apache.hadoop.hive.ql.plan.api.Task reduceTask = new org.apache.hadoop.hive.ql.plan.api.Task(); reduceTask.setTaskId(stage.getStageId() + "_REDUCE"); reduceTask.setTaskType(TaskType.REDUCE); stage.addToTaskList(reduceTask); Collection<Operator<? extends OperatorDesc>> reducerTopOps = new ArrayList<Operator<? extends OperatorDesc>>(); org.apache.hadoop.hive.ql.plan.api.Task otherTask = new org.apache.hadoop.hive.ql.plan.api.Task(); otherTask.setTaskId(stage.getStageId() + "_OTHER"); otherTask.setTaskType(TaskType.OTHER); stage.addToTaskList(otherTask);
/** 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 STAGE_ID: return isSetStageId(); case STAGE_TYPE: return isSetStageType(); case STAGE_ATTRIBUTES: return isSetStageAttributes(); case STAGE_COUNTERS: return isSetStageCounters(); case TASK_LIST: return isSetTaskList(); case DONE: return isSetDone(); case STARTED: return isSetStarted(); } throw new IllegalStateException(); }
for (org.apache.hadoop.hive.ql.plan.api.Stage stage : query .getStageList()) { if (stage.getStageId() == null) { continue; stage.setStarted(started.contains(stage.getStageId())); stage.setStageCounters(counters.get(stage.getStageId())); stage.setDone(done.contains(stage.getStageId())); for (org.apache.hadoop.hive.ql.plan.api.Task task : stage.getTaskList()) { task.setTaskCounters(counters.get(task.getTaskId())); if (task.getTaskType() == TaskType.OTHER) { task.setStarted(started.contains(stage.getStageId())); task.setDone(done.contains(stage.getStageId())); } else { task.setStarted(started.contains(task.getTaskId()));
new org.apache.hadoop.hive.ql.plan.api.Stage(); stage.setStageId(task.getId()); stage.setStageType(task.getType()); query.addToStageList(stage); org.apache.hadoop.hive.ql.plan.api.Task mapTask = new org.apache.hadoop.hive.ql.plan.api.Task(); mapTask.setTaskId(stage.getStageId() + "_MAP"); mapTask.setTaskType(TaskType.MAP); stage.addToTaskList(mapTask); populateOperatorGraph(mapTask, mrTask.getWork().getMapWork().getAliasToWork() .values()); org.apache.hadoop.hive.ql.plan.api.Task reduceTask = new org.apache.hadoop.hive.ql.plan.api.Task(); reduceTask.setTaskId(stage.getStageId() + "_REDUCE"); reduceTask.setTaskType(TaskType.REDUCE); stage.addToTaskList(reduceTask); Collection<Operator<? extends OperatorDesc>> reducerTopOps = new ArrayList<Operator<? extends OperatorDesc>>(); org.apache.hadoop.hive.ql.plan.api.Task otherTask = new org.apache.hadoop.hive.ql.plan.api.Task(); otherTask.setTaskId(stage.getStageId() + "_OTHER"); otherTask.setTaskType(TaskType.OTHER); stage.addToTaskList(otherTask);
lastComparison = Boolean.valueOf(isSetStageId()).compareTo(other.isSetStageId()); if (lastComparison != 0) { return lastComparison; if (isSetStageId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stageId, other.stageId); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetStageType()).compareTo(other.isSetStageType()); if (lastComparison != 0) { return lastComparison; if (isSetStageType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stageType, other.stageType); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetStageAttributes()).compareTo(other.isSetStageAttributes()); if (lastComparison != 0) { return lastComparison; if (isSetStageAttributes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stageAttributes, other.stageAttributes); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetStageCounters()).compareTo(other.isSetStageCounters()); if (lastComparison != 0) { return lastComparison; if (isSetStageCounters()) {
public Object getFieldValue(_Fields field) { switch (field) { case STAGE_ID: return getStageId(); case STAGE_TYPE: return getStageType(); case STAGE_ATTRIBUTES: return getStageAttributes(); case STAGE_COUNTERS: return getStageCounters(); case TASK_LIST: return getTaskList(); case DONE: return isDone(); case STARTED: return isStarted(); } throw new IllegalStateException(); }
for (org.apache.hadoop.hive.ql.plan.api.Stage stage : query .getStageList()) { if (stage.getStageId() == null) { continue; stage.setStarted(started.contains(stage.getStageId())); stage.setStageCounters(counters.get(stage.getStageId())); stage.setDone(done.contains(stage.getStageId())); for (org.apache.hadoop.hive.ql.plan.api.Task task : stage.getTaskList()) { task.setTaskCounters(counters.get(task.getTaskId())); if (task.getTaskType() == TaskType.OTHER) { task.setStarted(started.contains(stage.getStageId())); task.setDone(done.contains(stage.getStageId())); } else { task.setStarted(started.contains(task.getTaskId()));
new org.apache.hadoop.hive.ql.plan.api.Stage(); stage.setStageId(task.getId()); stage.setStageType(task.getType()); query.addToStageList(stage); org.apache.hadoop.hive.ql.plan.api.Task mapTask = new org.apache.hadoop.hive.ql.plan.api.Task(); mapTask.setTaskId(stage.getStageId() + "_MAP"); mapTask.setTaskType(TaskType.MAP); stage.addToTaskList(mapTask); populateOperatorGraph(mapTask, mrTask.getWork().getAliasToWork() .values()); org.apache.hadoop.hive.ql.plan.api.Task reduceTask = new org.apache.hadoop.hive.ql.plan.api.Task(); reduceTask.setTaskId(stage.getStageId() + "_REDUCE"); reduceTask.setTaskType(TaskType.REDUCE); stage.addToTaskList(reduceTask); Collection<Operator<? extends Serializable>> reducerTopOps = new ArrayList<Operator<? extends Serializable>>(); org.apache.hadoop.hive.ql.plan.api.Task otherTask = new org.apache.hadoop.hive.ql.plan.api.Task(); otherTask.setTaskId(stage.getStageId() + "_OTHER"); otherTask.setTaskType(TaskType.OTHER); stage.addToTaskList(otherTask);
public Stage deepCopy() { return new Stage(this); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof Stage) return this.equals((Stage)that); return false; }
lastComparison = Boolean.valueOf(isSetStageId()).compareTo(other.isSetStageId()); if (lastComparison != 0) { return lastComparison; if (isSetStageId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stageId, other.stageId); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetStageType()).compareTo(other.isSetStageType()); if (lastComparison != 0) { return lastComparison; if (isSetStageType()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stageType, other.stageType); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetStageAttributes()).compareTo(other.isSetStageAttributes()); if (lastComparison != 0) { return lastComparison; if (isSetStageAttributes()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.stageAttributes, other.stageAttributes); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetStageCounters()).compareTo(other.isSetStageCounters()); if (lastComparison != 0) { return lastComparison; if (isSetStageCounters()) {
private String getJSONStage(org.apache.hadoop.hive.ql.plan.api.Stage stage) { StringBuilder sb = new StringBuilder(); sb.append("{"); sb.append(getJSONKeyValue("stageId", stage.getStageId())); sb.append(getJSONKeyValue("stageType", stage.getStageType())); sb.append(getJSONKeyValue("stageAttributes", getJSONMap(stage.getStageAttributes()))); sb.append(getJSONKeyValue("stageCounters", getJSONMap(stage.getStageCounters()))); List<String> taskList = new ArrayList<String>(); if (stage.getTaskList() != null) { for (org.apache.hadoop.hive.ql.plan.api.Task task : stage.getTaskList()) { taskList.add(getJSONTask(task)); } } sb.append(getJSONKeyValue("taskList", getJSONList(taskList))); sb.append(getJSONKeyValue("done", stage.isDone())); sb.append(getJSONKeyValue("started", stage.isStarted())); sb.deleteCharAt(sb.length() - 1); sb.append("}"); return sb.toString(); }