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 Rui Wang <rw...@ebi.ac.uk> on 2011/12/12 11:09:44 UTC

How to detect index in use

Hi All,

I am just wondering given a existing index folder, is there a way of detecting whether this index is in use? 

Either by IndexReader or IndexWriter, What about on NFS file system? Is there any difference?  

Thank you for the help in advance,
Rui Wang
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: How to detect index in use

Posted by Ian Lea <ia...@gmail.com>.
If another process has an index open for updates it will be locked and
you can test that with IndexWriter.isLocked(directory), but that's
about it.  An OS command like lsof on unix could be used to see if any
processes on the same server have index files open but if you're using
NFS that won't detect processes on other servers.  Lucene and NFS
don't always work well together - generally better to use local files
if you can.


--
Ian.


On Mon, Dec 12, 2011 at 10:09 AM, Rui Wang <rw...@ebi.ac.uk> wrote:
> Hi All,
>
> I am just wondering given a existing index folder, is there a way of detecting whether this index is in use?
>
> Either by IndexReader or IndexWriter, What about on NFS file system? Is there any difference?
>
> Thank you for the help in advance,
> Rui Wang
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>

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