You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by ba ba <so...@gmail.com> on 2009/11/05 20:55:42 UTC

Set MMap in Solr

Hi,

I'm trying to set my default directory to MMap. I saw that this is done by
specifying here

A DirectoryProvider plugin can be configured in solrconfig.xml with the
following XML:
<directoryProvider class="class.name">
<!-- Parameters as required by the implementation -->
</directoryProvider>

in solrconfig.xml.

This did not work for me when I put in the MMapDirectory class name.

I got this information from here
http://issues.apache.org/jira/browse/SOLR-465?focusedCommentId=12715282#action_12715282

I'm using the latest nightly build.

If anyone knows how to configure solr to use MMap, please let me know. I
would greatly appreciate it.

Thanks.

Re: Set MMap in Solr

Posted by Lance Norskog <go...@gmail.com>.
Here is the code for FSDirectory:
  public static FSDirectory open(File path, LockFactory lockFactory)
throws IOException {
    /* For testing:
    MMapDirectory dir=new MMapDirectory(path, lockFactory);
    dir.setUseUnmap(true);
    return dir;
    */

    if (Constants.WINDOWS) {
      return new SimpleFSDirectory(path, lockFactory);
    } else {
      return new NIOFSDirectory(path, lockFactory);
    }
  }

The comments mention some problems with Java and memory-map support.
MMapDirectory has the UseUnmap flag false by default. Does this need
more attention?

On Thu, Nov 5, 2009 at 3:29 PM, ba ba <so...@gmail.com> wrote:
> Thanks for the help.
>
> -Brad Anderson
>
> 2009/11/5 Otis Gospodnetic <ot...@yahoo.com>
>
>> To use MMapDirectory, invoke Java with the System property
>> org.apache.lucene.FSDirectory.class set to
>> org.apache.lucene.store.MMapDirectory. This will cause
>> FSDirectory.getDirectory(File,boolean) to return instances of this class.
>>
>> So, start your servlet container with
>> -Dorg.apache.lucene.FSDirectory.class=org.apache.lucene.store.MMapDirectory
>>
>> Otis
>> --
>> Sematext is hiring -- http://sematext.com/about/jobs.html?mls
>> Lucene, Solr, Nutch, Katta, Hadoop, HBase, UIMA, NLP, NER, IR
>>
>>
>>
>> ----- Original Message ----
>> > From: ba ba <so...@gmail.com>
>> > To: solr-user@lucene.apache.org
>> > Sent: Thu, November 5, 2009 2:55:42 PM
>> > Subject: Set MMap in Solr
>> >
>> > Hi,
>> >
>> > I'm trying to set my default directory to MMap. I saw that this is done
>> by
>> > specifying here
>> >
>> > A DirectoryProvider plugin can be configured in solrconfig.xml with the
>> > following XML:
>> >
>> >
>> >
>> >
>> > in solrconfig.xml.
>> >
>> > This did not work for me when I put in the MMapDirectory class name.
>> >
>> > I got this information from here
>> >
>> http://issues.apache.org/jira/browse/SOLR-465?focusedCommentId=12715282#action_12715282
>> >
>> > I'm using the latest nightly build.
>> >
>> > If anyone knows how to configure solr to use MMap, please let me know. I
>> > would greatly appreciate it.
>> >
>> > Thanks.
>>
>>
>



-- 
Lance Norskog
goksron@gmail.com

Re: Set MMap in Solr

Posted by ba ba <so...@gmail.com>.
Thanks for the help.

-Brad Anderson

2009/11/5 Otis Gospodnetic <ot...@yahoo.com>

> To use MMapDirectory, invoke Java with the System property
> org.apache.lucene.FSDirectory.class set to
> org.apache.lucene.store.MMapDirectory. This will cause
> FSDirectory.getDirectory(File,boolean) to return instances of this class.
>
> So, start your servlet container with
> -Dorg.apache.lucene.FSDirectory.class=org.apache.lucene.store.MMapDirectory
>
> Otis
> --
> Sematext is hiring -- http://sematext.com/about/jobs.html?mls
> Lucene, Solr, Nutch, Katta, Hadoop, HBase, UIMA, NLP, NER, IR
>
>
>
> ----- Original Message ----
> > From: ba ba <so...@gmail.com>
> > To: solr-user@lucene.apache.org
> > Sent: Thu, November 5, 2009 2:55:42 PM
> > Subject: Set MMap in Solr
> >
> > Hi,
> >
> > I'm trying to set my default directory to MMap. I saw that this is done
> by
> > specifying here
> >
> > A DirectoryProvider plugin can be configured in solrconfig.xml with the
> > following XML:
> >
> >
> >
> >
> > in solrconfig.xml.
> >
> > This did not work for me when I put in the MMapDirectory class name.
> >
> > I got this information from here
> >
> http://issues.apache.org/jira/browse/SOLR-465?focusedCommentId=12715282#action_12715282
> >
> > I'm using the latest nightly build.
> >
> > If anyone knows how to configure solr to use MMap, please let me know. I
> > would greatly appreciate it.
> >
> > Thanks.
>
>

Re: Set MMap in Solr

Posted by Otis Gospodnetic <ot...@yahoo.com>.
To use MMapDirectory, invoke Java with the System property org.apache.lucene.FSDirectory.class set to org.apache.lucene.store.MMapDirectory. This will cause FSDirectory.getDirectory(File,boolean) to return instances of this class. 

So, start your servlet container with -Dorg.apache.lucene.FSDirectory.class=org.apache.lucene.store.MMapDirectory

Otis
--
Sematext is hiring -- http://sematext.com/about/jobs.html?mls
Lucene, Solr, Nutch, Katta, Hadoop, HBase, UIMA, NLP, NER, IR



----- Original Message ----
> From: ba ba <so...@gmail.com>
> To: solr-user@lucene.apache.org
> Sent: Thu, November 5, 2009 2:55:42 PM
> Subject: Set MMap in Solr
> 
> Hi,
> 
> I'm trying to set my default directory to MMap. I saw that this is done by
> specifying here
> 
> A DirectoryProvider plugin can be configured in solrconfig.xml with the
> following XML:
> 
> 
> 
> 
> in solrconfig.xml.
> 
> This did not work for me when I put in the MMapDirectory class name.
> 
> I got this information from here
> http://issues.apache.org/jira/browse/SOLR-465?focusedCommentId=12715282#action_12715282
> 
> I'm using the latest nightly build.
> 
> If anyone knows how to configure solr to use MMap, please let me know. I
> would greatly appreciate it.
> 
> Thanks.