Re: IndexWriter.isLock()

2012-05-09 Thread Michael McCandless
On Tue, May 8, 2012 at 12:31 AM, S Eslamian wrote: > So if my program interrupts, the lock files in the indexes will be released > in the next run. hoom? If you use NativeFSLockFactory (which is the default for NIOFSDirectory) then, yes, the lock is always released by the OS when the process exi

Re: IndexWriter.isLock()

2012-05-07 Thread S Eslamian
So if my program interrupts, the lock files in the indexes will be released in the next run. hoom? That's so good. Thank you Mr.McCandless for your help. On Mon, May 7, 2012 at 5:04 PM, Michael McCandless < luc...@mikemccandless.com> wrote: > On Mon, May 7, 2012 at 7:19 AM, S Eslamian wrote: >

Re: IndexWriter.isLock()

2012-05-07 Thread Michael McCandless
On Mon, May 7, 2012 at 7:19 AM, S Eslamian wrote: > hmm... , What is a leftover lock file? > > You know I debug my code, befor index folder has lock file, till line 7. > Then I close the program, like in a real run an interrupt has happened. How do you close it? Just kill the process? That is w

Re: IndexWriter.isLock()

2012-05-07 Thread S Eslamian
> You know I debug my code, befor index folder has lock file, till line 7. > > Then I close the program, like in a real run an interrupt has happened. > > Next I debug the program again with that index folder which has the lock > > file and it shouldn't passes the if claus

Re: IndexWriter.isLock()

2012-05-07 Thread Shai Erera
s lock file, till line 7. > Then I close the program, like in a real run an interrupt has happened. > Next I debug the program again with that index folder which has the lock > file and it shouldn't passes the if clause. But it passes. > > This is my sample code: > > 1.try{ >

Re: IndexWriter.isLock()

2012-05-07 Thread S Eslamian
he if clause. But it passes. This is my sample code: 1.try{ 2. if(!(IndexWriter.isLock(NIOFSDirectory.open("dstAddr"{ 3.IndexReader ir = IndexReader.open(NIOFSDirectory.open("srcAddr"),true); 4.IndexWriterConfig iwc = new IndexWriterConfig(Ve

Re: IndexWriter.isLock()

2012-05-07 Thread Michael McCandless
> Yes, I'm sure. I debug the code, and look at the files in the index folder, > it has a write.lock file before this line of code: > if (!(IndexWriter.isLock(NIOFSDirectory.open("fileAddr"{ >  //do something > } > > and after passing this line, index folder do

Re: IndexWriter.isLock()

2012-05-06 Thread S Eslamian
Yes, I'm sure. I debug the code, and look at the files in the index folder, it has a write.lock file before this line of code: if (!(IndexWriter.isLock(NIOFSDirectory.open("fileAddr"{ //do something } and after passing this line, index folder does not contain write.lock fil

Re: IndexWriter.isLock()

2012-05-06 Thread Michael McCandless
wrote: > Hi all > While I am using IndexWriter.isLock(), this method unlocks the index and > returns false. > Can anyone tell me why? - To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional comm

IndexWriter.isLock()

2012-05-06 Thread S Eslamian
Hi all While I am using IndexWriter.isLock(), this method unlocks the index and returns false. Can anyone tell me why?