@ Override public void configure ( Configuration parameters ) { super . configure ( parameters ) ; // the if() clauses are to prevent the configure() method from // overwriting the values set by the setters if ( Arrays . equals ( delimiter , new byte [ ] { ' ' } ) ) { String delimString = parameters . getString ( RECORD_DELIMITER , null ) ; if ( delimString != null ) { setDelimiter ( delimString ) ; } } // set the number of samples if ( numLineSamples == NUM_SAMPLES_UNDEFINED ) { String samplesString = parameters . getString ( NUM_STATISTICS_SAMPLES , null ) ; if ( samplesString != null ) { try { setNumLineSamples ( Integer . parseInt ( samplesString ) ) ; } catch ( NumberFormatException e ) { if ( LOG . isWarnEnabled ( ) ) { LOG . warn ( "Invalid value for number of samples to take: " + samplesString + ". Skipping sampling." ) ; } setNumLineSamples ( 0 ) ; } } } }
Configures this input format by reading the path to the file from the configuration and the string that defines the record delimiter .