public static HashMap < Integer , Integer > readIntIntMap ( Path path , FileSystem fs ) throws IOException { SequenceFile . Reader reader = new SequenceFile . Reader ( fs , path , fs . getConf ( ) ) ; IntWritable topic = new IntWritable ( ) ; IntWritable value = new IntWritable ( ) ; HashMap < Integer , Integer > ret = new HashMap < Integer , Integer > ( ) ; while ( reader . next ( topic ) ) { reader . getCurrentValue ( value ) ; ret . put ( topic . get ( ) , value . get ( ) ) ; } reader . close ( ) ; return ret ; }
Reads maps of integer - > integer