void repair ( boolean ignoreFailure ) throws IOException { if ( errors . size ( ) == 0 ) { log . info ( "No errors found." ) ; return ; } int notRepairable = 0 ; for ( Iterator < ConsistencyCheckError > it = errors . iterator ( ) ; it . hasNext ( ) ; ) { final ConsistencyCheckError error = it . next ( ) ; try { if ( error . repairable ( ) ) { // running in privileged mode error . repair ( ) ; } else { log . warn ( "Not repairable: " + error ) ; notRepairable ++ ; } } catch ( IOException e ) { if ( ignoreFailure ) { log . warn ( "Exception while reparing: " + e ) ; } else { throw e ; } } catch ( Exception e ) { if ( ignoreFailure ) { log . warn ( "Exception while reparing: " + e ) ; } else { throw new IOException ( e . getMessage ( ) , e ) ; } } } log . info ( "Repaired " + ( errors . size ( ) - notRepairable ) + " errors." ) ; if ( notRepairable > 0 ) { log . warn ( "" + notRepairable + " error(s) not repairable." ) ; } }
Repairs detected errors during the consistency check .