@Override public String getJobName() { return delegate.getJobName(); }
private void doAbortTask(TaskAttemptContext context, OutputCommitter committer) { try { committer.abortTask(context); } catch (IOException e) { LOG.error(MessageFormat.format( "error occurred while aborting task: {0} ({1})", context.getTaskAttemptID(), context.getJobName()), e); } }
@Override public void abortTask(TaskAttemptContext taskContext) throws IOException { if (outputMap.isEmpty()) { return; } if (LOG.isDebugEnabled()) { LOG.debug(MessageFormat.format( "Start Direct I/O output task abort: {1} ({0})", //$NON-NLS-1$ taskContext.getJobName(), taskContext.getTaskAttemptID())); } long t0 = System.currentTimeMillis(); doCleanupTask(taskContext); if (LOG.isInfoEnabled()) { long t1 = System.currentTimeMillis(); LOG.info(MessageFormat.format( "aborted Direct I/O output task: task={1} ({0}), elapsed={2}ms", taskContext.getJobName(), taskContext.getTaskAttemptID(), t1 - t0)); } }
"Start directio task cleanup for datasource: datasource={0} ({2} ({1}))", //$NON-NLS-1$ id, taskContext.getJobName(), taskContext.getTaskAttemptID())); "Failed directio task cleanup: datasource={0} ({2} ({1}))", id, taskContext.getJobName(), taskContext.getTaskAttemptID()), e); throw e;
LOG.debug(MessageFormat.format( "start Direct I/O output task commit: {1} ({0})", //$NON-NLS-1$ taskContext.getJobName(), taskContext.getTaskAttemptID())); + "datasource={0} ({2} ({1}))", //$NON-NLS-1$ id, taskContext.getJobName(), taskContext.getTaskAttemptID())); "Failed Direct I/O output task commit: datasource={0} ({2} ({1}))", id, taskContext.getJobName(), taskContext.getTaskAttemptID()), e); throw e; LOG.info(MessageFormat.format( "staged Direct I/O output task: task={1} ({0}), elapsed={2}ms", taskContext.getJobName(), taskContext.getTaskAttemptID(), t1 - t0));
LOG.debug(MessageFormat.format( "start Direct I/O output task: {1} ({0})", //$NON-NLS-1$ taskContext.getJobName(), taskContext.getTaskAttemptID())); + "datasource={0} ({2} ({1}))", //$NON-NLS-1$ id, taskContext.getJobName(), taskContext.getTaskAttemptID())); "Failed Direct I/O output task setup: datasource={0} ({2} ({1}))", id, taskContext.getJobName(), taskContext.getTaskAttemptID()), e); throw e; LOG.debug(MessageFormat.format( "finish Direct I/O output task setup: task={1} ({0}), elapsed={2}ms", //$NON-NLS-1$ taskContext.getJobName(), taskContext.getTaskAttemptID(), t1 - t0));
public SolrRecordWriter(TaskAttemptContext context, Path outputShardDir, int batchSize) { this.batchSize = batchSize; this.batch = new ArrayList<>(batchSize); Configuration conf = context.getConfiguration(); // setLogLevel("org.apache.solr.core", "WARN"); // setLogLevel("org.apache.solr.update", "WARN"); heartBeater = new HeartBeater(context); try { heartBeater.needHeartBeat(); Path solrHomeDir = SolrRecordWriter.findSolrConfig(conf); FileSystem fs = outputShardDir.getFileSystem(conf); EmbeddedSolrServer solr = createEmbeddedSolrServer(solrHomeDir, fs, outputShardDir); batchWriter = new BatchWriter(solr, batchSize, context.getTaskAttemptID().getTaskID(), SolrOutputFormat.getSolrWriterThreadCount(conf), SolrOutputFormat.getSolrWriterQueueSize(conf)); } catch (Exception e) { throw new IllegalStateException(String.format(Locale.ENGLISH, "Failed to initialize record writer for %s, %s", context.getJobName(), conf .get("mapred.task.id")), e); } finally { heartBeater.cancelHeartBeat(); } }
LOG.error(e); throw new IllegalStateException(String.format("Failed to initialize record writer for %s, %s", context.getJobName(), conf.get("mapred.task.id")), e); } finally { heartBeater.cancelHeartBeat();
LOG.error(e); throw new IllegalStateException(String.format("Failed to initialize record writer for %s, %s", context.getJobName(), conf.get("mapred.task.id")), e); } finally { heartBeater.cancelHeartBeat();
public SolrRecordWriter(TaskAttemptContext context, Path outputShardDir, int batchSize) { this.batchSize = batchSize; this.batch = new ArrayList<>(batchSize); Configuration conf = context.getConfiguration(); // setLogLevel("org.apache.solr.core", "WARN"); // setLogLevel("org.apache.solr.update", "WARN"); heartBeater = new HeartBeater(context); try { heartBeater.needHeartBeat(); Path solrHomeDir = SolrRecordWriter.findSolrConfig(conf); FileSystem fs = outputShardDir.getFileSystem(conf); EmbeddedSolrServer solr = createEmbeddedSolrServer(solrHomeDir, fs, outputShardDir); batchWriter = new BatchWriter(solr, batchSize, context.getTaskAttemptID().getTaskID(), SolrOutputFormat.getSolrWriterThreadCount(conf), SolrOutputFormat.getSolrWriterQueueSize(conf)); } catch (Exception e) { throw new IllegalStateException(String.format(Locale.ENGLISH, "Failed to initialize record writer for %s, %s", context.getJobName(), conf .get("mapred.task.id")), e); } finally { heartBeater.cancelHeartBeat(); } }
public SolrRecordWriter(TaskAttemptContext context, Path outputShardDir, int batchSize) { this.batchSize = batchSize; this.batch = new ArrayList<>(batchSize); Configuration conf = context.getConfiguration(); // setLogLevel("org.apache.solr.core", "WARN"); // setLogLevel("org.apache.solr.update", "WARN"); heartBeater = new HeartBeater(context); try { heartBeater.needHeartBeat(); Path solrHomeDir = SolrRecordWriter.findSolrConfig(conf); FileSystem fs = outputShardDir.getFileSystem(conf); EmbeddedSolrServer solr = createEmbeddedSolrServer(solrHomeDir, fs, outputShardDir); batchWriter = new BatchWriter(solr, batchSize, context.getTaskAttemptID().getTaskID(), SolrOutputFormat.getSolrWriterThreadCount(conf), SolrOutputFormat.getSolrWriterQueueSize(conf)); } catch (Exception e) { throw new IllegalStateException(String.format(Locale.ENGLISH, "Failed to initialize record writer for %s, %s", context.getJobName(), conf .get("mapred.task.id")), e); } finally { heartBeater.cancelHeartBeat(); } }
public SolrRecordWriter(TaskAttemptContext context, Path outputShardDir, int batchSize) { this.batchSize = batchSize; this.batch = new ArrayList(batchSize); Configuration conf = context.getConfiguration(); // setLogLevel("org.apache.solr.core", "WARN"); // setLogLevel("org.apache.solr.update", "WARN"); heartBeater = new HeartBeater(context); try { heartBeater.needHeartBeat(); Path solrHomeDir = SolrRecordWriter.findSolrConfig(conf); FileSystem fs = outputShardDir.getFileSystem(conf); EmbeddedSolrServer solr = createEmbeddedSolrServer(solrHomeDir, fs, outputShardDir); batchWriter = new BatchWriter(solr, batchSize, context.getTaskAttemptID().getTaskID(), SolrOutputFormat.getSolrWriterThreadCount(conf), SolrOutputFormat.getSolrWriterQueueSize(conf)); } catch (Exception e) { throw new IllegalStateException(String.format( "Failed to initialize record writer for %s, %s", context.getJobName(), conf .get("mapred.task.id")), e); } finally { heartBeater.cancelHeartBeat(); } }