Permalink
Browse files

fix for NUTCH-870 Injector should add the metadata before calling inj…

…ectedScore.

git-svn-id: https://svn.apache.org/repos/asf/nutch/branches/nutchbase@983315 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 945b1ff commit fc6a7f5eaeec70967b5845ee0079b660c3a0de8f @chrismattmann chrismattmann committed Aug 7, 2010
Showing with 13 additions and 7 deletions.
  1. +2 −0 CHANGES.txt
  2. +11 −7 src/java/org/apache/nutch/crawl/InjectorJob.java
View
@@ -2,6 +2,8 @@ Nutch Change Log
Release 2.0 - Current Development
+* NUTCH-870 Injector should add the metadata before calling injectedScore (jnioche via mattmann)
+
* NUTCH-867 Port Nutch benchmark to Nutchbase (ab)
* NUTCH-869 Add parse-html back (jnioche)
@@ -143,6 +143,16 @@ protected void map(LongWritable key, Text value, Context context)
WebPage row = new WebPage();
row.setFetchTime(curTime);
row.setFetchInterval(customInterval);
+
+ // now add the metadata
+ Iterator<String> keysIter = metadata.keySet().iterator();
+ while (keysIter.hasNext()) {
+ String keymd = keysIter.next();
+ String valuemd = metadata.get(keymd);
+ row.putToMetadata(new Utf8(keymd), ByteBuffer.wrap(valuemd.getBytes()));
+ }
+
+
if (customScore != -1)
row.setScore(customScore);
else {
@@ -157,13 +167,7 @@ protected void map(LongWritable key, Text value, Context context)
row.setScore(scoreInjected);
}
}
- // now add the metadata
- Iterator<String> keysIter = metadata.keySet().iterator();
- while (keysIter.hasNext()) {
- String keymd = keysIter.next();
- String valuemd = metadata.get(keymd);
- row.putToMetadata(new Utf8(keymd), ByteBuffer.wrap(valuemd.getBytes()));
- }
+
Mark.INJECT_MARK.putMark(row, YES_STRING);
context.write(reversedUrl, row);
}

0 comments on commit fc6a7f5

Please sign in to comment.