lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Messer <bmes...@apache.org>
Subject Re: IndexFileNames
Date Tue, 07 Jun 2005 17:04:39 GMT
Bernhard Messer wrote:

> Doug Cutting wrote:
>
>> bmesser@apache.org wrote:
>>
>>> --- 
>>> lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java 
>>> (original)
>>> +++ 
>>> lucene/java/trunk/src/java/org/apache/lucene/store/FSDirectory.java 
>>> Mon Jun  6 10:52:12 2005
>>> @@ -52,8 +52,8 @@
>>>          if (name.endsWith("."+IndexReader.FILENAME_EXTENSIONS[i]))
>>>            return true;
>>>        }
>>> -      if (name.equals("deletable")) return true;
>>> -      else if (name.equals("segments")) return true;
>>> +      if (name.equals(Constants.INDEX_DELETABLE_FILENAME)) return 
>>> true;
>>> +      else if (name.equals(Constants.INDEX_SEGMENTS_FILENAME)) 
>>> return true;
>>>        else if (name.matches(".+\\.f\\d+")) return true;
>>>        return false;
>>
>>
>>
>> This really belongs in the index package.  That way, when we change 
>> the set of files in an index, the changes will be localized.
>>
>> So this, LuceneFileFilter, Constants.INDEX_* and 
>> IndexReader.FILENAME_EXTENSIONS, should all be moved to a common home 
>> in the index package, like org.apache.lucene.index.IndexFileNames.  
>> Thoughts?
>>
sorry for the confusion. On the first look, i thought the new class 
IndexFileNames, containing the necessary constant values, fits perfect 
into org.apache.lucene.index. After a more detailed look, i get the 
feeling that it would be much better to place the new class into 
org.apache.store. If done, we can avoid all dependencies within 
FSDirectory to org.apache.lucene.index, which is very clean.

Why not creating a new public final class 
org.apache.lucene.store.IndexFileNames and move LuceneFileFilter, 
Constants.INDEX_*, SegmentMerger.COMPOUND_EXTENSIONS, 
SegmentMerger.VECTOR_EXTENSIONS and IndexReader.FILENAME_EXTENSIONS to it.

Does it sound ok ?

Bernhard

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


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


Mime
View raw message