A small piece of code for you:
Configuration conf = new Configuration(); Job job = new Job(conf); job.setMapperClass(MultithreadedMapper.class); conf.set("mapred.map.multithreadedrunner.class", WebGraphMapper.class.getCanonicalName()); conf.set("mapred.map.multithreadedrunner.threads", "8"); job.setJarByClass(WebGraphMapper.class);
I think this is pretty self-evident. You use a multi-threaded cartographer as the main class, and then you configure which class (your real cartographer) it should execute. There are also these handy static methods that make this configuration for you. The call might look like this:
MultithreadedMapper.setMapperClass(job, WebGraphMapper.class); MultithreadedMapper.setNumberOfThreads(job, 8);
source share