MCPcopy Create free account
hub / github.com/apache/nutch / inject

Method inject

src/java/org/apache/nutch/host/HostInjectorJob.java:142–156  ·  view source on GitHub ↗
(Path hostDir)

Source from the content-addressed store, hash-verified

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 {

Callers 1

runMethod · 0.95

Calls 5

getInstanceMethod · 0.95
getConfMethod · 0.95
createWebStoreMethod · 0.95
waitForCompletionMethod · 0.80
getConfigurationMethod · 0.45

Tested by

no test coverage detected