You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Rob Audenaerde <ro...@gmail.com> on 2016/06/30 09:59:35 UTC

clone RAMDirectory

Hi all,

For increasing the speed of some of my application tests, I want to
re-use/copy a pre-populated RAMDirectory over and over.

I'm on Lucene 6.0.1

It seems an RAMDirectory can be a copy of a FSDirectory, but not of another
RAMDirectory. Also RAMDirectory is not Clonable.

What would be the 'proper' approach to re-use (fast copy) pre-populated
indices over tests? I know I can create a FSDirectory and copy that, but
then I also need to take into account temporary files etc.

Thanks in advance,

- Rob

Re: clone RAMDirectory

Posted by Rob Audenaerde <ro...@gmail.com>.
Thanks for the quick reply Uwe!

I opened https://issues.apache.org/jira/browse/LUCENE-7366 for this.

-Rob

On Thu, Jun 30, 2016 at 12:06 PM, Uwe Schindler <uw...@thetaphi.de> wrote:

> Hi,
>
> I looked at the code: The FSDirectory passed to RAMDirectory could be
> changed to Directory easily. The additional check for "not is a directory
> inode" is in my opinion lo longer needed, because listFiles should only
> return files.
>
> Can you open an issue about to change the FSDirectory in the RAMDirectory
> ctor to be changed to Directory?
>
> Uwe
>
> -----
> Uwe Schindler
> H.-H.-Meier-Allee 63, D-28213 Bremen
> http://www.thetaphi.de
> eMail: uwe@thetaphi.de
>
> > -----Original Message-----
> > From: Rob Audenaerde [mailto:rob.audenaerde@gmail.com]
> > Sent: Thursday, June 30, 2016 12:00 PM
> > To: java-user@lucene.apache.org
> > Subject: clone RAMDirectory
> >
> > Hi all,
> >
> > For increasing the speed of some of my application tests, I want to
> > re-use/copy a pre-populated RAMDirectory over and over.
> >
> > I'm on Lucene 6.0.1
> >
> > It seems an RAMDirectory can be a copy of a FSDirectory, but not of
> another
> > RAMDirectory. Also RAMDirectory is not Clonable.
> >
> > What would be the 'proper' approach to re-use (fast copy) pre-populated
> > indices over tests? I know I can create a FSDirectory and copy that, but
> > then I also need to take into account temporary files etc.
> >
> > Thanks in advance,
> >
> > - Rob
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

RE: clone RAMDirectory

Posted by Uwe Schindler <uw...@thetaphi.de>.
Hi,

I looked at the code: The FSDirectory passed to RAMDirectory could be changed to Directory easily. The additional check for "not is a directory inode" is in my opinion lo longer needed, because listFiles should only return files.

Can you open an issue about to change the FSDirectory in the RAMDirectory ctor to be changed to Directory?

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: uwe@thetaphi.de

> -----Original Message-----
> From: Rob Audenaerde [mailto:rob.audenaerde@gmail.com]
> Sent: Thursday, June 30, 2016 12:00 PM
> To: java-user@lucene.apache.org
> Subject: clone RAMDirectory
> 
> Hi all,
> 
> For increasing the speed of some of my application tests, I want to
> re-use/copy a pre-populated RAMDirectory over and over.
> 
> I'm on Lucene 6.0.1
> 
> It seems an RAMDirectory can be a copy of a FSDirectory, but not of another
> RAMDirectory. Also RAMDirectory is not Clonable.
> 
> What would be the 'proper' approach to re-use (fast copy) pre-populated
> indices over tests? I know I can create a FSDirectory and copy that, but
> then I also need to take into account temporary files etc.
> 
> Thanks in advance,
> 
> - Rob


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