DelimitedInputFormat extends FileInputFormat<OT> { @Override public void configure(Configuration parameters) { super.configure(parameters); String delimString = parameters.getString(RECORD_DELIMITER, null); if (delimString != null) { setDelimiter(delimString); } 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); } } } DelimitedInputFormat(); protected  DelimitedInputFormat(Path filePath); byte[] getDelimiter(); void setDelimiter(byte[] delimiter); void setDelimiter(char delimiter); void setDelimiter(String delimiter); int getLineLengthLimit(); void setLineLengthLimit(int lineLengthLimit); int getBufferSize(); void setBufferSize(int bufferSize); int getNumLineSamples(); void setNumLineSamples(int numLineSamples); abstract OT readRecord(OT reuse, byte[] bytes, int offset, int numBytes); @Override void configure(Configuration parameters); @Override FileBaseStatistics getStatistics(BaseStatistics cachedStats); @Override void open(FileInputSplit split); @Override boolean reachedEnd(); @Override OT nextRecord(OT record); @Override void close();  }
@Test public void testConfigure() { Configuration cfg = new Configuration(); cfg.setString("delimited-format.delimiter", "\n"); format.configure(cfg); assertEquals("\n", new String(format.getDelimiter())); cfg.setString("delimited-format.delimiter", "&-&"); format.configure(cfg); assertEquals("&-&", new String(format.getDelimiter())); }