public long incrementEventReadOrChannelFail(Throwable t) { if (t instanceof ChannelException) { return incrementChannelWriteFail(); } return incrementEventReadFail(); }
@Override public Status process() { Status status = Status.BACKOFF; try { existingInodes.clear(); existingInodes.addAll(reader.updateTailFiles()); for (long inode : existingInodes) { TailFile tf = reader.getTailFiles().get(inode); if (tf.needTail()) { boolean hasMoreLines = tailFileProcess(tf, true); if (hasMoreLines) { status = Status.READY; } } } closeTailFiles(); } catch (Throwable t) { logger.error("Unable to tail files", t); sourceCounter.incrementEventReadFail(); status = Status.BACKOFF; } return status; }
} catch (HTTPBadRequestException ex) { LOG.warn("Received bad request from client. ", ex); sourceCounter.incrementEventReadFail(); response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Bad request from client. " } catch (Exception ex) { LOG.warn("Deserializer threw unexpected exception. ", ex); sourceCounter.incrementEventReadFail(); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Deserializer threw unexpected exception. "
logger.info("Error decoding line with charset (" + decoder.charset() + "). Exception follows.", t); sourceCounter.incrementEventReadFail(); SyslogUtils.SyslogStatus.INVALID.getSyslogStatus()); logger.debug("Error parsing syslog event", ex); sourceCounter.incrementEventReadFail();
@Override public void messageReceived(ChannelHandlerContext ctx, MessageEvent mEvent) { try { syslogUtils.setEventSize(maxsize); Event e = syslogUtils.extractEvent((ChannelBuffer)mEvent.getMessage()); if (e == null) { return; } if (clientIPHeader != null) { e.getHeaders().put(clientIPHeader, SyslogUtils.getIP(mEvent.getRemoteAddress())); } if (clientHostnameHeader != null) { e.getHeaders().put(clientHostnameHeader, SyslogUtils.getHostname(mEvent.getRemoteAddress())); } sourceCounter.incrementEventReceivedCount(); getChannelProcessor().processEvent(e); sourceCounter.incrementEventAcceptedCount(); } catch (ChannelException ex) { logger.error("Error writting to channel", ex); sourceCounter.incrementChannelWriteFail(); return; } catch (RuntimeException ex) { logger.error("Error parsing event from syslog stream, event dropped", ex); sourceCounter.incrementEventReadFail(); return; } } }
if (consumer != null) { logger.warn("Exceeded JMSException threshold, closing consumer"); sourceCounter.incrementEventReadFail(); consumer.rollback(); consumer.close(); sourceCounter.incrementEventReadFail(); if (throwable instanceof Error) { throw (Error) throwable;
"Restart or reconfigure Flume to continue processing.", t); if (readingEvents) { sourceCounter.incrementEventReadFail(); } else { sourceCounter.incrementGenericProcessingFail();
} catch (RuntimeException ex) { logger.error("Error parsing event from syslog stream, event dropped", ex); sourceCounter.incrementEventReadFail(); return;
public long incrementEventReadOrChannelFail(Throwable t) { if (t instanceof ChannelException) { return incrementChannelWriteFail(); } return incrementEventReadFail(); }
@Override public Status process() { Status status = Status.BACKOFF; try { existingInodes.clear(); existingInodes.addAll(reader.updateTailFiles()); for (long inode : existingInodes) { TailFile tf = reader.getTailFiles().get(inode); if (tf.needTail()) { boolean hasMoreLines = tailFileProcess(tf, true); if (hasMoreLines) { status = Status.READY; } } } closeTailFiles(); } catch (Throwable t) { logger.error("Unable to tail files", t); sourceCounter.incrementEventReadFail(); status = Status.BACKOFF; } return status; }
} catch (HTTPBadRequestException ex) { LOG.warn("Received bad request from client. ", ex); sourceCounter.incrementEventReadFail(); response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Bad request from client. " } catch (Exception ex) { LOG.warn("Deserializer threw unexpected exception. ", ex); sourceCounter.incrementEventReadFail(); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Deserializer threw unexpected exception. "
logger.info("Error decoding line with charset (" + decoder.charset() + "). Exception follows.", t); sourceCounter.incrementEventReadFail(); SyslogUtils.SyslogStatus.INVALID.getSyslogStatus()); logger.debug("Error parsing syslog event", ex); sourceCounter.incrementEventReadFail();
if (consumer != null) { logger.warn("Exceeded JMSException threshold, closing consumer"); sourceCounter.incrementEventReadFail(); consumer.rollback(); consumer.close(); sourceCounter.incrementEventReadFail(); if (throwable instanceof Error) { throw (Error) throwable;
"Restart or reconfigure Flume to continue processing.", t); if (readingEvents) { sourceCounter.incrementEventReadFail(); } else { sourceCounter.incrementGenericProcessingFail();
} catch (RuntimeException ex) { logger.error("Error parsing event from syslog stream, event dropped", ex); sourceCounter.incrementEventReadFail(); return;
@Override public void messageReceived(ChannelHandlerContext ctx, MessageEvent mEvent) { try { syslogUtils.setEventSize(maxsize); Event e = syslogUtils.extractEvent((ChannelBuffer)mEvent.getMessage()); if (e == null) { return; } if (clientIPHeader != null) { e.getHeaders().put(clientIPHeader, SyslogUtils.getIP(mEvent.getRemoteAddress())); } if (clientHostnameHeader != null) { e.getHeaders().put(clientHostnameHeader, SyslogUtils.getHostname(mEvent.getRemoteAddress())); } sourceCounter.incrementEventReceivedCount(); getChannelProcessor().processEvent(e); sourceCounter.incrementEventAcceptedCount(); } catch (ChannelException ex) { logger.error("Error writting to channel", ex); sourceCounter.incrementChannelWriteFail(); return; } catch (RuntimeException ex) { logger.error("Error parsing event from syslog stream, event dropped", ex); sourceCounter.incrementEventReadFail(); return; } } }