@Test public void tryOne() throws IOException, InterruptedException { Text inKey=new Text("zr PallaPalla"); Text inValue=new Text("75312"); mapper.map(inKey,inValue,context); verify(context).write(new Text("zr"),new VIntWritable(75312)); }
@Override protected void map(Text key, Text value, Context context) throws IOException, InterruptedException { String keyString=key.toString(); try { Iterator<String> parts=SPACE_SPLITTER.split(keyString).iterator(); String siteId=parts.next(); String uri=parts.next(); int count=Integer.parseInt(value.toString()); context.write(new Text(siteId),new VIntWritable(count)); } catch(NoSuchElementException | NumberFormatException ex) { LOG.warn("Couldn't parse line ["+keyString+"]"); } }
NormalizeMonthliesMapper extends Mapper<Text,Text,Text,VIntWritable> { @Override protected void map(Text key, Text value, Context context) throws IOException, InterruptedException { String keyString=key.toString(); try { Iterator<String> parts=SPACE_SPLITTER.split(keyString).iterator(); String siteId=parts.next(); String uri=parts.next(); int count=Integer.parseInt(value.toString()); context.write(new Text(siteId),new VIntWritable(count)); } catch(NoSuchElementException | NumberFormatException ex) { LOG.warn("Couldn't parse line ["+keyString+"]"); } } }
NormalizeMonthliesMapper extends Mapper<Text,Text,Text,VIntWritable> { @Override protected void map(Text key, Text value, Context context) throws IOException, InterruptedException { String keyString=key.toString(); try { Iterator<String> parts=SPACE_SPLITTER.split(keyString).iterator(); String siteId=parts.next(); String uri=parts.next(); int count=Integer.parseInt(value.toString()); context.write(new Text(siteId),new VIntWritable(count)); } catch(NoSuchElementException | NumberFormatException ex) { LOG.warn("Couldn't parse line ["+keyString+"]"); } }  }
NormalizeMonthliesMapper extends Mapper<Text,Text,Text,VIntWritable> { @Override protected void map(Text key, Text value, Context context) throws IOException, InterruptedException { String keyString=key.toString(); try { Iterator<String> parts=SPACE_SPLITTER.split(keyString).iterator(); String siteId=parts.next(); String uri=parts.next(); int count=Integer.parseInt(value.toString()); context.write(new Text(siteId),new VIntWritable(count)); } catch(NoSuchElementException | NumberFormatException ex) { LOG.warn("Couldn't parse line ["+keyString+"]"); } }   }
NormalizeMonthliesMapper extends Mapper<Text,Text,Text,VIntWritable> { @Override protected void map(Text key, Text value, Context context) throws IOException, InterruptedException { String keyString=key.toString(); try { Iterator<String> parts=SPACE_SPLITTER.split(keyString).iterator(); String siteId=parts.next(); String uri=parts.next(); int count=Integer.parseInt(value.toString()); context.write(new Text(siteId),new VIntWritable(count)); } catch(NoSuchElementException | NumberFormatException ex) { LOG.warn("Couldn't parse line ["+keyString+"]"); } }    }