private void mapJournalsAndReportErrors ( JournalClosure closure , String status ) throws IOException { List < JournalAndStream > badJAS = null ; for ( JournalAndStream jas : journals ) { try { closure . apply ( jas ) ; } catch ( Throwable t ) { if ( badJAS == null ) badJAS = new LinkedList < JournalAndStream > ( ) ; LOG . error ( "Error: " + status + " failed for (journal " + jas + ")" , t ) ; badJAS . add ( jas ) ; } } disableAndReportErrorOnJournals ( badJAS , status ) ; }
Apply the given operation across all of the journal managers disabling any for which the closure throws an IOException .