Update of /cvsroot/nutch/nutch/src/java/net/nutch/indexer
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24692/src/java/net/nutch/indexer

Modified Files:
        IndexSegment.java 
Log Message:
Make things more tolerant of crashed fetcher output files.

Index: IndexSegment.java
===================================================================
RCS file: /cvsroot/nutch/nutch/src/java/net/nutch/indexer/IndexSegment.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** IndexSegment.java   16 Oct 2003 17:20:32 -0000      1.8
--- IndexSegment.java   1 Feb 2004 17:33:48 -0000       1.9
***************
*** 50,60 ****
      writer.setSimilarity(new NutchSimilarity());
  
!     ArrayFile.Reader fetcher =
!       new ArrayFile.Reader(new File(directory, FetcherOutput.DIR_NAME).toString());
!     ArrayFile.Reader text =
!       new ArrayFile.Reader(new File(directory,FetcherText.DIR_NAME).toString());
  
      int count = 0;
      try {
        String segmentName = directory.getCanonicalFile().getName();
        FetcherOutput fetcherOutput = new FetcherOutput();
--- 50,61 ----
      writer.setSimilarity(new NutchSimilarity());
  
!     ArrayFile.Reader fetcher = null;
!     ArrayFile.Reader text = null;
  
      int count = 0;
      try {
+       fetcher = new ArrayFile.Reader(new File(directory, 
FetcherOutput.DIR_NAME).toString());
+       text = new ArrayFile.Reader(new 
File(directory,FetcherText.DIR_NAME).toString());
+ 
        String segmentName = directory.getCanonicalFile().getName();
        FetcherOutput fetcherOutput = new FetcherOutput();
***************
*** 75,80 ****
                    " at entry #" + count + ".  Ignoring.");
      } finally {
!       fetcher.close();
!       text.close();
      }
      System.out.println("Optimizing index...");
--- 76,83 ----
                    " at entry #" + count + ".  Ignoring.");
      } finally {
!       if (fetcher != null)
!         fetcher.close();
!       if (text != null)
!         text.close();
      }
      System.out.println("Optimizing index...");



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Nutch-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nutch-cvs

Reply via email to