Code example for LinkedHashMap

Methods: put

0
    public static class JsonMapper extends Mapper { 
 
        @Override 
        protected void map(Object key, Object value, Context context) throws IOException, InterruptedException {
            StringTokenizer st = new StringTokenizer(value.toString(), "\t");
            Map<String, String> entry = new LinkedHashMap<String, String>();
 
            entry.put("number", st.nextToken());
            entry.put("name", st.nextToken());
            entry.put("url", st.nextToken());
            if (st.hasMoreTokens()) {
                entry.put("picture", st.nextToken());
            } 
            context.write(key, WritableUtils.toWritable(entry));
        } 
    } 
 
    @Test 
    public void testBasicSave() throws Exception { 
        Configuration conf = createConf();
        conf.set(ConfigurationOptions.ES_RESOURCE, "mrnewapi/save");