[ 
https://issues.apache.org/jira/browse/SOLR-6519?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Uwe Schindler updated SOLR-6519:
--------------------------------
    Attachment: SOLR-6519.patch

Attached is a patch refactoring DirectoryFactory in Solr 5.0:
- injectLockFactory was removed, it was a very ugly hack
- the abstract create() method now takes a LockFactory instance, that is used 
to pass to ctor. Some directory implementations may ignore it.
- I added createLockFactory(9 protected method, that has a default 
implementation for standard file systems lock factories. It only does not allow 
HdfsLockFactory, instead throws an Exception. HdfsDirectory ofverrides this 
method and allows to create one with correct configuration. RAMDirectoryFactory 
only allows "single" as lock factory, other settings are refused.

Just one Question: If you don't configure a lock type, it currently falls back 
to "simple" as default (for backwards compatibility). For Solr 5, we should 
change this default to "native". Any comments?

[[email protected]]: Can you look at the HDFS stuff, I was not able to 
test this on Windows.

All tests pass.

> 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
>             Fix For: 5.0
>
>         Attachments: 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