public FileFailureEventReporter(MetricContext context, FileSystem fs, Path failureLogFile) throws IOException { super(OutputStreamEventReporter.forContext(context)); this.fs = fs; this.failureLogFile = failureLogFile; hasSetupOutputStream = false; }
public OutputStreamEventReporter build() throws IOException { return new OutputStreamEventReporter(this); } }
@Override public void addEventToReportingQueue(GobblinTrackingEvent event) { if (FailureEventBuilder.isFailureEvent(event)) { super.addEventToReportingQueue(event); } }
@Override public void reportEventQueue(Queue<GobblinTrackingEvent> queue) { if (queue.size() > 0) { setupOutputStream(); super.reportEventQueue(queue); } }
@Override public void reportEventQueue(Queue<GobblinTrackingEvent> queue) { if(queue.size() <= 0) { return; } this.outputBuffer.reset(); GobblinTrackingEvent nextEvent; final String dateTime = dateFormat.format(new Date()); printWithBanner(dateTime, '='); this.outputBufferPrintStream.println(); printWithBanner("-- Events", '-'); while(null != (nextEvent = queue.poll())) { this.outputBufferPrintStream.println(new String(this.serializer.serializeRecord(nextEvent), Charsets.UTF_8)); } this.outputBufferPrintStream.println(); try { this.outputBuffer.writeTo(this.output); } catch(IOException exception) { LOGGER.warn("Failed to write events to output stream."); } }
@Override public void reportEventQueue(Queue<GobblinTrackingEvent> queue) { if (queue.size() > 0) { setupOutputStream(); super.reportEventQueue(queue); } }
@Override public void reportEventQueue(Queue<GobblinTrackingEvent> queue) { if(queue.size() <= 0) { return; } this.outputBuffer.reset(); GobblinTrackingEvent nextEvent; final String dateTime = dateFormat.format(new Date()); printWithBanner(dateTime, '='); this.outputBufferPrintStream.println(); printWithBanner("-- Events", '-'); while(null != (nextEvent = queue.poll())) { this.outputBufferPrintStream.println(new String(this.serializer.serializeRecord(nextEvent), Charsets.UTF_8)); } this.outputBufferPrintStream.println(); try { this.outputBuffer.writeTo(this.output); } catch(IOException exception) { LOGGER.warn("Failed to write events to output stream."); } }
@Override public ScheduledReporter newScheduledReporter(MetricRegistry registry, Properties properties) throws IOException { try { return OutputStreamEventReporter.forContext(MetricContext.class.cast(registry)).build(); } catch (ClassCastException cce) { throw new IOException(cce); } } }
@Override public void addEventToReportingQueue(GobblinTrackingEvent event) { if (FailureEventBuilder.isFailureEvent(event)) { super.addEventToReportingQueue(event); } }
public OutputStreamEventReporter build() throws IOException { return new OutputStreamEventReporter(this); } }
.register(OutputStreamEventReporter.forContext(RootMetricContext.get()).outputTo(output).build()));
public FileFailureEventReporter(MetricContext context, FileSystem fs, Path failureLogFile) throws IOException { super(OutputStreamEventReporter.forContext(context)); this.fs = fs; this.failureLogFile = failureLogFile; hasSetupOutputStream = false; }
@Override public ScheduledReporter newScheduledReporter(MetricRegistry registry, Properties properties) throws IOException { try { return OutputStreamEventReporter.forContext(MetricContext.class.cast(registry)).build(); } catch (ClassCastException cce) { throw new IOException(cce); } } }
.register(OutputStreamEventReporter.forContext(RootMetricContext.get()).outputTo(output).build()));