Worked perfectly. Thanks

-Matt Zytaruk

Andrzej Bialecki wrote:

Hi,

I attached the patch. Please test.

------------------------------------------------------------------------

Index: ParseData.java
===================================================================
--- ParseData.java      (revision 365563)
+++ ParseData.java      (working copy)
@@ -31,7 +31,7 @@
public final class ParseData extends VersionedWritable {
  public static final String DIR_NAME = "parse_data";

-  private final static byte VERSION = 2;
+  private final static byte VERSION = 3;

  private String title;
  private Outlink[] outlinks;
@@ -96,10 +96,15 @@
      Outlink.skip(in);
    }
- int propertyCount = in.readInt(); // read metadata
-    metadata = new ContentProperties();
-    for (int i = 0; i < propertyCount; i++) {
-      metadata.put(UTF8.readString(in), UTF8.readString(in));
+    if (version < 3) {
+      int propertyCount = in.readInt();             // read metadata
+      metadata = new ContentProperties();
+      for (int i = 0; i < propertyCount; i++) {
+        metadata.put(UTF8.readString(in), UTF8.readString(in));
+      }
+    } else {
+      metadata = new ContentProperties();
+      metadata.readFields(in);
    }
}
@@ -113,14 +118,7 @@
    for (int i = 0; i < outlinks.length; i++) {
      outlinks[i].write(out);
    }
-
-    out.writeInt(metadata.size());                // write metadata
-    Iterator i = metadata.entrySet().iterator();
-    while (i.hasNext()) {
-      Map.Entry e = (Map.Entry)i.next();
-      UTF8.writeString(out, (String)e.getKey());
-      UTF8.writeString(out, (String)e.getValue());
-    }
+    metadata.write(out);
  }

  public static ParseData read(DataInput in) throws IOException {



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Nutch-developers mailing list
Nutch-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nutch-developers

Reply via email to