Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-312. Upgrade to Hadoop 0.4.0.

Douglass Cutting30e4a38d0785
diff --git a/lib/commons-cli-2.0-SNAPSHOT.jar b/lib/commons-cli-2.0-SNAPSHOT.jar
new file mode 100644
index 000000000..f35ecf2de
Binary files /dev/null and b/lib/commons-cli-2.0-SNAPSHOT.jar differ
diff --git a/lib/hadoop-0.3.2.jar b/lib/hadoop-0.3.2.jar
deleted file mode 100644
index 34bb49772..000000000
Binary files a/lib/hadoop-0.3.2.jar and /dev/null differ
diff --git a/lib/hadoop-0.4.0.jar b/lib/hadoop-0.4.0.jar
new file mode 100644
index 000000000..f77c311b5
Binary files /dev/null and b/lib/hadoop-0.4.0.jar differ
diff --git a/src/java/org/apache/nutch/fetcher/FetcherOutputFormat.java b/src/java/org/apache/nutch/fetcher/FetcherOutputFormat.java
index 4bf239bda..7b58533ec 100644
--- a/src/java/org/apache/nutch/fetcher/FetcherOutputFormat.java
+++ b/src/java/org/apache/nutch/fetcher/FetcherOutputFormat.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.mapred.OutputFormat;
import org.apache.hadoop.mapred.RecordWriter;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.Reporter;
+import org.apache.hadoop.util.Progressable;
import org.apache.nutch.parse.ParseOutputFormat;
import org.apache.nutch.protocol.Content;
@@ -45,7 +46,8 @@ public class FetcherOutputFormat implements OutputFormat {
public RecordWriter getRecordWriter(final FileSystem fs,
final JobConf job,
- final String name) throws IOException {
+ final String name,
+ final Progressable progress) throws IOException {
final Path fetch =
new Path(new Path(job.getOutputPath(), CrawlDatum.FETCH_DIR_NAME), name);
@@ -66,7 +68,7 @@ public class FetcherOutputFormat implements OutputFormat {
}
if (Fetcher.isParsing(job)) {
- parseOut = new ParseOutputFormat().getRecordWriter(fs, job, name);
+ parseOut = new ParseOutputFormat().getRecordWriter(fs, job, name, null);
}
}
diff --git a/src/java/org/apache/nutch/indexer/DeleteDuplicates.java b/src/java/org/apache/nutch/indexer/DeleteDuplicates.java
index d4af4cbe4..f22afe273 100644
--- a/src/java/org/apache/nutch/indexer/DeleteDuplicates.java
+++ b/src/java/org/apache/nutch/indexer/DeleteDuplicates.java
@@ -26,6 +26,7 @@ import org.apache.hadoop.io.*;
import org.apache.hadoop.fs.*;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.mapred.*;
+import org.apache.hadoop.util.Progressable;
import org.apache.nutch.util.NutchConfiguration;
import org.apache.nutch.util.NutchJob;
@@ -276,7 +277,8 @@ public class DeleteDuplicates extends Configured
/** Write nothing. */
public RecordWriter getRecordWriter(final FileSystem fs,
final JobConf job,
- final String name) throws IOException {
+ final String name,
+ final Progressable progress) throws IOException {
return new RecordWriter() {
public void write(WritableComparable key, Writable value)
throws IOException {
diff --git a/src/java/org/apache/nutch/indexer/Indexer.java b/src/java/org/apache/nutch/indexer/Indexer.java
index 3b206c565..f2411fa3e 100644
--- a/src/java/org/apache/nutch/indexer/Indexer.java
+++ b/src/java/org/apache/nutch/indexer/Indexer.java
@@ -27,6 +27,7 @@ import org.apache.nutch.fetcher.Fetcher;
import org.apache.hadoop.fs.*;
import org.apache.hadoop.conf.*;
import org.apache.hadoop.mapred.*;
+import org.apache.hadoop.util.Progressable;
import org.apache.nutch.parse.*;
import org.apache.nutch.analysis.*;
@@ -79,7 +80,7 @@ public class Indexer extends Configured implements Reducer {
public static class OutputFormat
extends org.apache.hadoop.mapred.OutputFormatBase {
public RecordWriter getRecordWriter(final FileSystem fs, JobConf job,
- String name) throws IOException {
+ String name, Progressable progress) throws IOException {
final Path perm = new Path(job.getOutputPath(), name);
final Path temp =
job.getLocalPath("index/_"+Integer.toString(new Random().nextInt()));
diff --git a/src/java/org/apache/nutch/parse/ParseOutputFormat.java b/src/java/org/apache/nutch/parse/ParseOutputFormat.java
index d61d7b07a..807087068 100644
--- a/src/java/org/apache/nutch/parse/ParseOutputFormat.java
+++ b/src/java/org/apache/nutch/parse/ParseOutputFormat.java
@@ -31,6 +31,7 @@ import org.apache.nutch.util.StringUtil;
import org.apache.nutch.net.*;
import java.io.*;
+import org.apache.hadoop.util.Progressable;
/* Parse content in a segment. */
public class ParseOutputFormat implements OutputFormat {
@@ -46,7 +47,7 @@ public class ParseOutputFormat implements OutputFormat {
}
public RecordWriter getRecordWriter(FileSystem fs, JobConf job,
- String name) throws IOException {
+ String name, Progressable progress) throws IOException {
this.urlNormalizer = new UrlNormalizerFactory(job).getNormalizer();
this.filters = new URLFilters(job);
diff --git a/src/java/org/apache/nutch/segment/SegmentMerger.java b/src/java/org/apache/nutch/segment/SegmentMerger.java
index fad4b4431..776b3da3e 100644
--- a/src/java/org/apache/nutch/segment/SegmentMerger.java
+++ b/src/java/org/apache/nutch/segment/SegmentMerger.java
@@ -28,6 +28,7 @@ import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.PathFilter;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapred.*;
+import org.apache.hadoop.util.Progressable;
import org.apache.nutch.crawl.CrawlDatum;
import org.apache.nutch.crawl.Generator;
import org.apache.nutch.fetcher.Fetcher;
@@ -168,7 +169,7 @@ public class SegmentMerger extends Configured implements Mapper, Reducer {
public static class SegmentOutputFormat extends org.apache.hadoop.mapred.OutputFormatBase {
private static final String DEFAULT_SLICE = "default";
- public RecordWriter getRecordWriter(final FileSystem fs, final JobConf job, final String name) throws IOException {
+ public RecordWriter getRecordWriter(final FileSystem fs, final JobConf job, final String name, final Progressable progress) throws IOException {
return new RecordWriter() {
MapFile.Writer c_out = null;
MapFile.Writer f_out = null;
diff --git a/src/java/org/apache/nutch/segment/SegmentReader.java b/src/java/org/apache/nutch/segment/SegmentReader.java
index d84838a4e..0997afded 100644
--- a/src/java/org/apache/nutch/segment/SegmentReader.java
+++ b/src/java/org/apache/nutch/segment/SegmentReader.java
@@ -28,6 +28,7 @@ import org.apache.hadoop.conf.Configured;
import org.apache.hadoop.fs.*;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapred.*;
+import org.apache.hadoop.util.Progressable;
import org.apache.nutch.crawl.CrawlDatum;
import org.apache.nutch.parse.ParseData;
import org.apache.nutch.parse.ParseText;
@@ -70,7 +71,7 @@ public class SegmentReader extends Configured implements Reducer {
/** Implements a text output format */
public static class TextOutputFormat extends org.apache.hadoop.mapred.OutputFormatBase {
- public RecordWriter getRecordWriter(final FileSystem fs, JobConf job, String name) throws IOException {
+ public RecordWriter getRecordWriter(final FileSystem fs, JobConf job, String name, Progressable progress) throws IOException {
final Path segmentDumpFile = new Path(job.getOutputPath(), name);