| 156 | } |
| 157 | |
| 158 | @Override |
| 159 | public int run(String[] args) throws Exception { |
| 160 | if (args.length < 1) { |
| 161 | System.err.println("Usage: HostInjectorJob <host_dir>"); |
| 162 | return -1; |
| 163 | } |
| 164 | try { |
| 165 | boolean success = inject(new Path(args[0])); |
| 166 | if (!success) { |
| 167 | LOG.error("HostInjectorJob: failed "); |
| 168 | return -1; |
| 169 | } |
| 170 | LOG.info("HostInjectorJob: finished"); |
| 171 | return -0; |
| 172 | } catch (Exception e) { |
| 173 | LOG.error("HostInjectorJob: " + StringUtils.stringifyException(e)); |
| 174 | return -1; |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | public static void main(String[] args) throws Exception { |
| 179 | int res = ToolRunner.run(NutchConfiguration.create(), |