Code example for Splitter

Methods: split

0
        joiner = Joiner.on(separator);
    } 
 
    @Override 
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        Iterable<String> values = splitter.split(value.toString());
        joinKey.set(Iterables.get(values,keyIndex));
        if(keyIndex != 0){
            value.set(reorderValue(values,keyIndex));
        } 
 
        context.write(joinKey,value); 
    } 
 
 
    private String reorderValue(Iterable<String> value, int index){
        List<String> temp = Lists.newArrayList(value);
        String originalFirst = temp.get(0);
        String newFirst = temp.get(index);
        temp.set(0,newFirst);
Stop searching for code, let great code find you!  Add Codota to your java IDE