lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Falca (JIRA)" <j...@apache.org>
Subject [jira] Created: (LUCENE-1192) FileNotFound exception on adding a RAMDirectory to an IndexWriter
Date Tue, 26 Feb 2008 11:03:51 GMT
FileNotFound exception on adding a RAMDirectory to an IndexWriter
-----------------------------------------------------------------

                 Key: LUCENE-1192
                 URL: https://issues.apache.org/jira/browse/LUCENE-1192
             Project: Lucene - Java
          Issue Type: Bug
    Affects Versions: 2.3.1
            Reporter: Alex Falca


Hi,

I'm getting FileNotFoundException on adding RAMDirectory to an IndexWriter with following
stack trace:
{noformat}
java.io.FileNotFoundException: _8.fnm
        at org.apache.lucene.store.RAMDirectory.openInput(RAMDirectory.java:234)
        at org.apache.lucene.index.FieldInfos.<init>(FieldInfos.java:57)
        at org.apache.lucene.index.SegmentReader.initialize(SegmentReader.java:298)
        at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:262)
        at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:221)
        at org.apache.lucene.index.IndexWriter.mergeMiddle(IndexWriter.java:3099)
        at org.apache.lucene.index.IndexWriter.merge(IndexWriter.java:2834)
        at org.apache.lucene.index.IndexWriter.copyExternalSegments(IndexWriter.java:2263)
        at org.apache.lucene.index.IndexWriter.addIndexesNoOptimize(IndexWriter.java:2238)
{noformat}

Same code works fine with Lucene 2.2.0. Basically I'm trying to index a huge number of documents
(~21mln) having following workflow:
1. First documents are added to and index which use a RAMDirectory as a storage
2. Once a given condition occurs RAM based index writer is flushed and his directory is being
added to another index writer, which use a FSDirectory as a storage. 

Sample code:
{code}
IndexWriter mainIndexWriter = new IndexWriter(indexDir, new JapaneseAnalyzer(), true);
IndexWriter ramIndexWriter = new IndexWriter(new RAMDirectory(), new JapaneseAnalyzer(), true);
mainIndexWriter.setMergeFactor(10);
mainIndexWriter.setUseCompoundFile(false);
ramIndexWriter.setUseCompoundFile(false);

// Here some code for adding documents to RAM index writer
...................................................................................................................
// method where I'm flushing from memory to disk and getting exception
ramIndexWriter.flush();
mainIndexWriter.addIndexesNoOptimize(new Directory[] {ramIndexWriter.getDirectory()});
ramIndexWriter.close();
ramIndexWriter = new IndexWriter(new RAMDirectory(), new JapaneseAnalyzer(), true);
ramIndexWriter.setUseCompoundFile(false);
System.gc();
{code}

I understand that I should be using new features of IndexWriter like flushing by RAM Usage,
but wanna see if there any bugs in my case. Possible I'm facing issue described in LUCENE-1175,
but need a confirmation on that. 

If you need details on environment(i.e. Java version, settings, hardware details etc.) - please
let me know.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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