6、.hadooppublic class HadoopGrep{ public static class RegMapper extends MapReduceBase implements Mapper{ private Patternpattern; public void configure(JobConfjob){ pattern = Pattern.compile(job.get("mapred.mapper.regex")); } public void map(WritableCompara
7、blekey,Writablevalue,OutputCollectoroutput,Reporterreporter) throws IOException{ Stringtext = ((Text)value).toString(); Matchermatcher = pattern.matcher(text); if (matcher.find()){ output.collect(key,value); } }} private HadoopGrep(){} // singleton public