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

Uwe Schindler commented on SOLR-6519:
-------------------------------------

Hi,
I know why this happens:
In the new impl (after removing the hacky) injectLockFactory, I only added the 
"useful" ones to each DirectoryFactory:
- HDFS only supports "none" or "hdfs"
- StandardDirectoryFactory only supports "simple", "native", "none"
- RAMDirectoryFactory only supports "single"
- MockDirectoryFactory ignores the factory completely, it uses what test 
framework chooses

I did not know that there was some additional randomization! For me the tests 
passed - strange. We have 2 opinions:
- Add back "single" to StandardDirectoryFactory (which is a bit strange), but 
Hoss mentioned on IRC, if somebody has a separate directory for every solr 
instance. It is still risky!
- Change the randomization

> In trunk change Solr's DirectoryFactory.create method to take LockFactory
> -------------------------------------------------------------------------
>
>                 Key: SOLR-6519
>                 URL: https://issues.apache.org/jira/browse/SOLR-6519
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Uwe Schindler
>            Assignee: Uwe Schindler
>             Fix For: 5.0
>
>         Attachments: SOLR-6519.patch, SOLR-6519.patch
>
>
> Because of NIO2 changes and the corresponding workaround, it is impossible 
> now to create a Directory and "hope" that the lock factory directory is not 
> created. Especially if you want some non-standard lock factory, this blows up.
> The problem is: The lock dir is now created in ctor. As workaround I made all 
> factories set NoLockFactory initially through ctor (see SOLR-6518), but this 
> is just a workaround for incorrect API design.
> In fact the main problem is just stupid: Why does protected 
> CachingDirectoryFactory.create() not take the lock factory? I think its 
> because of backwards compatibility, but with Solr 5.0 we can change this.
> In future we want to make the lock factory non-mutable in Directory, so this 
> is an important change. In addition, injectLockFactory looks horrible, this 
> code is a häckidy-hick-hack!



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to