@Override public void run() { if (startTime == -1) { startTime = System.currentTimeMillis(); } long taskStart = System.currentTimeMillis(); NodeMonitorService.Client client = null; try { client = TClients.createBlockingNmClient(NM_HOST, NM_PORT); } catch (IOException e) { LOG.fatal("Error creating NM client", e); } int tasks = numTasks.addAndGet(1); double taskRate = ((double) tasks) * 1000 / (System.currentTimeMillis() - startTime); LOG.debug("Aggregate task rate: " + taskRate); Random r = new Random(); long benchmarkStart = System.currentTimeMillis(); runBenchmark(benchmarkId, benchmarkIterations, r); LOG.debug("Benchmark runtime: " + (System.currentTimeMillis() - benchmarkStart)); // Update bookkeeping for task finish synchronized (resourceUsage) { TResources.subtractFrom(resourceUsage, taskResources); } HashMap<TUserGroupInfo, TResourceVector> out = new HashMap<TUserGroupInfo, TResourceVector>(); // Inform NM of resource usage out.put(user, resourceUsage); try { client.tasksFinished(Lists.newArrayList(taskId)); } catch (TException e) { e.printStackTrace(); } client.getInputProtocol().getTransport().close(); client.getOutputProtocol().getTransport().close(); LOG.debug("Task running for " + (System.currentTimeMillis() - taskStart) + " ms"); }
public synchronized void fatalError(TaskAttemptID taskId, String msg, JvmContext jvmContext) throws IOException { LOG.fatal("Fatal: " + msg + "from task: " + taskId); }
public synchronized void fsError(TaskAttemptID taskId, String message, JvmContext jvmContext) throws IOException { LOG.fatal("FSError: " + message + "from task: " + taskId); }
public void shuffleError(TaskAttemptID taskId, String message, JvmContext jvmContext) throws IOException { LOG.fatal("shuffleError: " + message + "from task: " + taskId); }
@Override public void reportErrorOnFile(File f) { LOG.fatal("Error reported on file " + f + "... exiting", new Exception()); stop(1); }