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 SegmentMerger.java
Date Mon, 13 Oct 2003 14:27:28 GMT
otis        2003/10/13 07:27:28

  Modified:    src/java/org/apache/lucene/index SegmentMerger.java
  Log:
  - Made String COMPOUND_EXTENSIONS[] static and moved the definition higher
    in the code.
  - Cleaned up a bit.
  
  Revision  Changes    Path
  1.4       +11 -15    jakarta-lucene/src/java/org/apache/lucene/index/SegmentMerger.java
  
  Index: SegmentMerger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/SegmentMerger.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SegmentMerger.java	25 Sep 2003 22:01:51 -0000	1.3
  +++ SegmentMerger.java	13 Oct 2003 14:27:28 -0000	1.4
  @@ -71,6 +71,11 @@
   
     private Vector readers = new Vector();
     private FieldInfos fieldInfos;
  +
  +  // File extensions of old-style index files
  +  private static final String COMPOUND_EXTENSIONS[] = new String[] {
  +    "fnm", "frq", "prx", "fdx", "fdt", "tii", "tis"
  +  };
     
     SegmentMerger(Directory dir, String name, boolean compoundFile) {
       directory = dir;
  @@ -103,17 +108,9 @@
           createCompoundFile();
     }
   
  -
  -  // Add the fixed files
  -  private final String COMPOUND_EXTENSIONS[] = new String[] {
  -    "fnm", "frq", "prx", "fdx", "fdt", "tii", "tis"
  -  };
  -
  -
     private final void createCompoundFile() 
  -  throws IOException
  -  {
  -    CompoundFileWriter oneWriter = 
  +  throws IOException {
  +    CompoundFileWriter cfsWriter = 
           new CompoundFileWriter(directory, segment + ".cfs");
       
       ArrayList files = 
  @@ -135,17 +132,16 @@
       // Now merge all added files
       Iterator it = files.iterator();
       while(it.hasNext()) {
  -        oneWriter.addFile((String) it.next());
  +      cfsWriter.addFile((String) it.next());
       }
       
       // Perform the merge
  -    oneWriter.close();
  -    
  -    
  +    cfsWriter.close();
  +        
       // Now delete the source files
       it = files.iterator();
       while(it.hasNext()) {
  -        directory.deleteFile((String) it.next());
  +      directory.deleteFile((String) it.next());
       }
     }
     
  
  
  

---------------------------------------------------------------------
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