@Override public synchronized void stop() { counter.stop(); try { // Close the writer and commit the transaction, but don't create a new // writer since we're stopping closeWriter(); commitTransaction(); } catch (EventDeliveryException ex) { rollbackTransaction(); LOG.warn("Closing the writer failed: " + ex.getLocalizedMessage()); LOG.debug("Exception follows.", ex); // We don't propogate the exception as the transaction would have been // rolled back and we can still finish stopping } // signal that this sink has stopped LOG.info("Stopped dataset sink: " + getName()); super.stop(); }
} catch (EventDeliveryException ex) { LOG.warn("Error closing writer there may be temp files that need to" + " be manually recovered: " + ex.getLocalizedMessage()); LOG.debug("Exception follows.", ex);
@Override public void run() { boolean success = false; int count = 0; try { while (!success && count < retries) { count++; try { logger.debug("Reporting a batch of {} events, try {}", events.length, count); createClient().appendBatch(Arrays.asList(events)); success = true; logger.debug("Successfully reported a batch of {} events", events.length); } catch (EventDeliveryException e) { logger.warn(e.getLocalizedMessage(), e); logger.warn("Will retry " + (retries - count) + " times"); } } } finally { if (!success) { logger.error("Could not submit events to Flume"); close(); } } } }
@Override public synchronized void stop() { counter.stop(); try { // Close the writer and commit the transaction, but don't create a new // writer since we're stopping closeWriter(); commitTransaction(); } catch (EventDeliveryException ex) { rollbackTransaction(); LOG.warn("Closing the writer failed: " + ex.getLocalizedMessage()); LOG.debug("Exception follows.", ex); // We don't propogate the exception as the transaction would have been // rolled back and we can still finish stopping } // signal that this sink has stopped LOG.info("Stopped dataset sink: " + getName()); super.stop(); }
client.close(); client = null; LOG.error(e.getLocalizedMessage(), e); return false;
} catch (EventDeliveryException ex) { LOG.warn("Error closing writer there may be temp files that need to" + " be manually recovered: " + ex.getLocalizedMessage()); LOG.debug("Exception follows.", ex);