(Path hostDir)
| 140 | } |
| 141 | |
| 142 | public boolean inject(Path hostDir) throws Exception { |
| 143 | LOG.info("HostInjectorJob: starting"); |
| 144 | LOG.info("HostInjectorJob: hostDir: " + hostDir); |
| 145 | Job job = NutchJob.getInstance(getConf(), "inject-hosts " + hostDir); |
| 146 | FileInputFormat.addInputPath(job, hostDir); |
| 147 | job.setMapperClass(UrlMapper.class); |
| 148 | job.setMapOutputKeyClass(String.class); |
| 149 | job.setMapOutputValueClass(Host.class); |
| 150 | job.setOutputFormatClass(GoraOutputFormat.class); |
| 151 | GoraOutputFormat.setOutput(job, StorageUtils.createWebStore( |
| 152 | job.getConfiguration(), String.class, Host.class), true); |
| 153 | job.setReducerClass(Reducer.class); |
| 154 | job.setNumReduceTasks(0); |
| 155 | return job.waitForCompletion(true); |
| 156 | } |
| 157 | |
| 158 | @Override |
| 159 | public int run(String[] args) throws Exception { |
no test coverage detected