Skip to content

armgit / nutch

Public Imported from GitHub
0

Apache Nutch is an extensible and scalable web crawler

NUTCH-405

Sami Siren67b298064cde
diff --git a/CHANGES.txt b/CHANGES.txt
index 542c3ea2d..be1be2b75 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -80,6 +80,9 @@ Unreleased changes (0.9-dev)
26. NUTCH-403 - Make URL filtering optional in Generator (siren)
+27. NUTCH-405 - Content object is not properly initialized in map method
+ of ParseSegment (siren)
+
Release 0.8 - 2006-07-25
0. Totally new architecture, based on hadoop
diff --git a/src/java/org/apache/nutch/parse/ParseSegment.java b/src/java/org/apache/nutch/parse/ParseSegment.java
index 9a5569f15..e68d34958 100644
--- a/src/java/org/apache/nutch/parse/ParseSegment.java
+++ b/src/java/org/apache/nutch/parse/ParseSegment.java
@@ -66,7 +66,8 @@ public class ParseSegment extends Configured implements Mapper, Reducer {
newKey.set(key.toString());
key = newKey;
}
- Content content = (Content)value;
+ Content content = (Content) value;
+ content.forceInflate();
Parse parse = null;
ParseStatus status;
diff --git a/src/java/org/apache/nutch/protocol/Content.java b/src/java/org/apache/nutch/protocol/Content.java
index a3fa78f44..0ba8e5a03 100755
--- a/src/java/org/apache/nutch/protocol/Content.java
+++ b/src/java/org/apache/nutch/protocol/Content.java
@@ -298,4 +298,12 @@ public final class Content extends CompressedWritable {
return typeName;
}
+ /**
+ * By calling this method caller forces the next access to any property (via
+ * getters and setters) to check if decompressing of data is really required.
+ */
+ public void forceInflate() {
+ inflated = false;
+ }
+
}