/** * Unlike other operator interfaces which are called from map or reduce task, * jobClose is called from the jobclient side once the job has completed. * * @param conf * Configuration with with which job was submitted * @param success * whether the job was completed successfully or not */ public void jobClose(Configuration conf, boolean success) throws HiveException { // JobClose has already been performed on this operator if (jobCloseDone) { return; } jobCloseOp(conf, success); jobCloseDone = true; if (childOperators != null) { for (Operator<? extends OperatorDesc> op : childOperators) { op.jobClose(conf, success); } } }
@Test public void testClose() throws HiveException { task.close(work, 0, null); verify(op, times(4)).jobClose(any(Configuration.class), eq(true)); }
@VisibleForTesting int close(TezWork work, int rc, DAGClient dagClient) { try { List<BaseWork> ws = work.getAllWork(); for (BaseWork w: ws) { if (w instanceof MergeJoinWork) { w = ((MergeJoinWork) w).getMainWork(); } for (Operator<?> op: w.getAllOperators()) { op.jobClose(conf, rc == 0); } } } catch (Exception e) { // jobClose needs to execute successfully otherwise fail task if (rc == 0) { rc = 3; String mesg = "Job Commit failed with exception '" + Utilities.getNameMessage(e) + "'"; console.printError(mesg, "\n" + StringUtils.stringifyException(e)); } } if (dagClient != null) { // null in tests closeDagClientWithoutEx(dagClient); } return rc; }
/** * Unlike other operator interfaces which are called from map or reduce task, * jobClose is called from the jobclient side once the job has completed. * * @param conf * Configuration with with which job was submitted * @param success * whether the job was completed successfully or not */ public void jobClose(Configuration conf, boolean success) throws HiveException { // JobClose has already been performed on this operator if (jobCloseDone) { return; } jobCloseOp(conf, success); jobCloseDone = true; if (CollectionUtils.isNotEmpty(this.childOperators)) { for (Operator<? extends OperatorDesc> op : this.childOperators) { op.jobClose(conf, success); } } }
/** * Close will move the temp files into the right place for the fetch * task. If the job has failed it will clean up the files. */ private int close(int rc) { try { List<BaseWork> ws = work.getAllWork(); for (BaseWork w: ws) { for (Operator<?> op: w.getAllOperators()) { op.jobClose(conf, rc == 0); } } } catch (Exception e) { // jobClose needs to execute successfully otherwise fail task if (rc == 0) { rc = 3; String mesg = "Job Commit failed with exception '" + Utilities.getNameMessage(e) + "'"; console.printError(mesg, "\n" + StringUtils.stringifyException(e)); setException(e); } } return rc; }
/** * Unlike other operator interfaces which are called from map or reduce task, * jobClose is called from the jobclient side once the job has completed. * * @param conf * Configuration with with which job was submitted * @param success * whether the job was completed successfully or not */ public void jobClose(Configuration conf, boolean success) throws HiveException { // JobClose has already been performed on this operator if (jobCloseDone) { return; } jobCloseOp(conf, success); jobCloseDone = true; if (childOperators != null) { for (Operator<? extends OperatorDesc> op : childOperators) { op.jobClose(conf, success); } } }
/** * Close will move the temp files into the right place for the fetch * task. If the job has failed it will clean up the files. */ private int close(int rc) { try { List<BaseWork> ws = work.getAllWork(); for (BaseWork w: ws) { for (Operator<?> op: w.getAllOperators()) { op.jobClose(conf, rc == 0); } } } catch (Exception e) { // jobClose needs to execute successfully otherwise fail task if (rc == 0) { rc = 3; String mesg = "Job Commit failed with exception '" + Utilities.getNameMessage(e) + "'"; console.printError(mesg, "\n" + StringUtils.stringifyException(e)); setException(e); } } return rc; }
int close(TezWork work, int rc) { try { List<BaseWork> ws = work.getAllWork(); for (BaseWork w: ws) { if (w instanceof MergeJoinWork) { w = ((MergeJoinWork) w).getMainWork(); } for (Operator<?> op: w.getAllOperators()) { op.jobClose(conf, rc == 0); } } } catch (Exception e) { // jobClose needs to execute successfully otherwise fail task if (rc == 0) { rc = 3; String mesg = "Job Commit failed with exception '" + Utilities.getNameMessage(e) + "'"; console.printError(mesg, "\n" + StringUtils.stringifyException(e)); } } closeDagClientWithoutEx(); return rc; }
for (Operator<? extends OperatorDesc> op : work.getAliasToWork() .values()) { op.jobClose(job, success);
for (Operator<? extends OperatorDesc> op : work.getAliasToWork() .values()) { op.jobClose(job, success);
/** * Unlike other operator interfaces which are called from map or reduce task, * jobClose is called from the jobclient side once the job has completed. * * @param conf * Configuration with with which job was submitted * @param success * whether the job was completed successfully or not */ public void jobClose(Configuration conf, boolean success, JobCloseFeedBack feedBack) throws HiveException { if (childOperators == null) { return; } for (Operator<? extends Serializable> op : childOperators) { op.jobClose(conf, success, feedBack); } }
/** * Close will move the temp files into the right place for the fetch * task. If the job has failed it will clean up the files. */ private int close(int rc) { try { List<BaseWork> ws = work.getAllWork(); for (BaseWork w: ws) { for (Operator<?> op: w.getAllOperators()) { op.jobClose(conf, rc == 0); } } } catch (Exception e) { // jobClose needs to execute successfully otherwise fail task if (rc == 0) { rc = 3; String mesg = "Job Commit failed with exception '" + Utilities.getNameMessage(e) + "'"; console.printError(mesg, "\n" + StringUtils.stringifyException(e)); } } return rc; }
int close(TezWork work, int rc) { try { List<BaseWork> ws = work.getAllWork(); for (BaseWork w: ws) { if (w instanceof MergeJoinWork) { w = ((MergeJoinWork) w).getMainWork(); } for (Operator<?> op: w.getAllOperators()) { op.jobClose(conf, rc == 0); } } } catch (Exception e) { // jobClose needs to execute successfully otherwise fail task if (rc == 0) { rc = 3; String mesg = "Job Commit failed with exception '" + Utilities.getNameMessage(e) + "'"; console.printError(mesg, "\n" + StringUtils.stringifyException(e)); } } return rc; }
for (Operator<? extends OperatorDesc> op : work.getAliasToWork() .values()) { op.jobClose(job, success);