[ 
https://issues.apache.org/jira/browse/LUCENE-6508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14563326#comment-14563326
 ] 

Robert Muir commented on LUCENE-6508:
-------------------------------------

Random ideas to make this better:
* remove timeouts
* remove Lock.isLocked(), Lock.obtain(), IndexWriter.isLocked(Dir), etc
* just have Directory.obtain() which either succeeds and gives you Closeable or 
gives IOException
* obtain() should return an immutable thing, that will simplify a lot here.
* maybe Directory should "know" of the lock and check on each createOutput, 
delete, rename, etc. This would give more safety.
* maybe add method Lock.isValid(). For network filesystems, things like 
disconnected nodes can cause locks to be "lost". look into things like 
FileLock.isValid and see if they are useful. (SimpleFS can implement with 
Files.exists). 


> Simplify Directory/lock api
> ---------------------------
>
>                 Key: LUCENE-6508
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6508
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>
> See LUCENE-6507 for some background. In general it would be great if you can 
> just acquire an immutable lock (or you get a failure) and then you close that 
> to release it.
> Today the API might be too much for what is needed by IW.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to