Author: mattmann
Date: Sat Aug 7 21:57:21 2010
New Revision: 983315
URL: http://svn.apache.org/viewvc?rev=983315&view=rev
Log:
fix for NUTCH-870 Injector should add the metadata before calling injectedScore.
Modified:
nutch/branches/nutchbase/CHANGES.txt
nutch/branches/nutchbase/src/java/org/apache/nutch/crawl/InjectorJob.java
Modified: nutch/branches/nutchbase/CHANGES.txt
URL:
http://svn.apache.org/viewvc/nutch/branches/nutchbase/CHANGES.txt?rev=983315&r1=983314&r2=983315&view=diff
==============================================================================
--- nutch/branches/nutchbase/CHANGES.txt (original)
+++ nutch/branches/nutchbase/CHANGES.txt Sat Aug 7 21:57:21 2010
@@ -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)
Modified:
nutch/branches/nutchbase/src/java/org/apache/nutch/crawl/InjectorJob.java
URL:
http://svn.apache.org/viewvc/nutch/branches/nutchbase/src/java/org/apache/nutch/crawl/InjectorJob.java?rev=983315&r1=983314&r2=983315&view=diff
==============================================================================
--- nutch/branches/nutchbase/src/java/org/apache/nutch/crawl/InjectorJob.java
(original)
+++ nutch/branches/nutchbase/src/java/org/apache/nutch/crawl/InjectorJob.java
Sat Aug 7 21:57:21 2010
@@ -143,6 +143,16 @@ public class InjectorJob extends GoraMap
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 @@ public class InjectorJob extends GoraMap
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);
}