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

Uwe Schindler commented on LUCENE-6508:
---------------------------------------

In LockFactory we need the following: BasDirectory.makeLock() currently 
delegates directly to the LockFactory (its a final method). So we should rename 
this method in LockFactory, too and make it return a lock only after aquire. 
Therefore, the LockFactory would do what Robert proposed. Otherwise I like the 
proposal. I will work the next days on it (I already started to rename some 
stuff).

The lock cannot be completely immutable. Because the Closeable interface should 
still be implemented correctly: close() must be idempotent, so we still need 
the state. But it is immutable in that sense that you cannot re-obtain the lock.

> 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
>            Assignee: Uwe Schindler
>
> 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