Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

DbUpdaterJob returns success status

Julien Niochee0fe29b4aeac
diff --git a/src/java/org/apache/nutch/crawl/DbUpdaterJob.java b/src/java/org/apache/nutch/crawl/DbUpdaterJob.java
index ddc54fb60..9b2cf71f4 100644
--- a/src/java/org/apache/nutch/crawl/DbUpdaterJob.java
+++ b/src/java/org/apache/nutch/crawl/DbUpdaterJob.java
@@ -42,7 +42,7 @@ implements Tool {
FIELDS.add(WebPage.Field.PREV_SIGNATURE);
}
- private void updateTable() throws Exception {
+ private int updateTable() throws Exception {
LOG.info("DbUpdaterJob: starting");
Job job = new NutchJob(getConf(), "update-table");
//job.setBoolean(ALL, updateAll);
@@ -56,13 +56,17 @@ implements Tool {
NutchWritable.class, DbUpdateMapper.class);
StorageUtils.initReducerJob(job, DbUpdateReducer.class);
- job.waitForCompletion(true);
+ boolean success = job.waitForCompletion(true);
+ if (!success){
+ LOG.info("DbUpdaterJob: failed");
+ return -1;
+ }
LOG.info("DbUpdaterJob: done");
+ return 0;
}
public int run(String[] args) throws Exception {
- updateTable();
- return 0;
+ return updateTable();
}
public static void main(String[] args) throws Exception {