lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject cvs commit: jakarta-lucene/src/java/org/apache/lucene/index IndexWriter.java
Date Thu, 25 Mar 2004 19:34:53 GMT
otis        2004/03/25 11:34:53

  Modified:    src/java/org/apache/lucene/index IndexWriter.java
  Log:
  - Changed the code so debug output for each merge is on a single line:
  
  merging segments _b (1 docs) _c (1 docs) into _d (2 docs)
  merging segments _a (10 docs) _d (2 docs) into _e (12 docs)
  
  Revision  Changes    Path
  1.28      +8 -9      jakarta-lucene/src/java/org/apache/lucene/index/IndexWriter.java
  
  Index: IndexWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/IndexWriter.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- IndexWriter.java	25 Mar 2004 18:47:15 -0000	1.27
  +++ IndexWriter.java	25 Mar 2004 19:34:53 -0000	1.28
  @@ -462,30 +462,29 @@
       for (int i = minSegment; i < segmentInfos.size(); i++) {
         SegmentInfo si = segmentInfos.info(i);
         if (infoStream != null)
  -	infoStream.print(" " + si.name + " (" + si.docCount + " docs)");
  +        infoStream.print(" " + si.name + " (" + si.docCount + " docs)");
         IndexReader reader = new SegmentReader(si);
         merger.add(reader);
  -      if ((reader.directory()==this.directory) || // if we own the directory
  -          (reader.directory()==this.ramDirectory))
  -	segmentsToDelete.addElement(reader);	  // queue segment for deletion
  +      if ((reader.directory() == this.directory) || // if we own the directory
  +          (reader.directory() == this.ramDirectory))
  +        segmentsToDelete.addElement(reader);   // queue segment for deletion
       }
   
       int mergedDocCount = merger.merge();
   
       if (infoStream != null) {
  -      infoStream.println();
         infoStream.println(" into "+mergedName+" ("+mergedDocCount+" docs)");
       }
   
  -    segmentInfos.setSize(minSegment);		  // pop old infos & add new
  +    segmentInfos.setSize(minSegment);          // pop old infos & add new
       segmentInfos.addElement(new SegmentInfo(mergedName, mergedDocCount,
                                               directory));
   
  -    synchronized (directory) {			  // in- & inter-process sync
  +    synchronized (directory) {                 // in- & inter-process sync
         new Lock.With(directory.makeLock(IndexWriter.COMMIT_LOCK_NAME), COMMIT_LOCK_TIMEOUT)
{
             public Object doBody() throws IOException {
  -            segmentInfos.write(directory);	  // commit before deleting
  -            deleteSegments(segmentsToDelete);	  // delete now-unused segments
  +            segmentInfos.write(directory);     // commit before deleting
  +            deleteSegments(segmentsToDelete);  // delete now-unused segments
               return null;
             }
           }.run();
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Mime
View raw message