[
https://issues.apache.org/jira/browse/SOLR-15060?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Bruno Roustant updated SOLR-15060:
----------------------------------
Description:
FilterDirectory already exists to delegate to a Directory, but there is no
delegating DirectoryFactory.
+Use cases:+
A DelegatingDirectoryFactory could be used in SOLR-15051 to make
BlobDirectoryFactory easily delegate to any DirectoryFactory (e.g.
MMapDirectoryFactory). If the DelegatingDirectoryFactory delegation can be
configured in solrconfig.xml then it allows any user to change the delegate
DirectoryFactory without code.
A DelegatingDirectoryFactory could be used by an EncryptingDirectoryFactory
that could encrypt/decrypt any delegate DirectoryFactory. Here again it should
be configurable in solrconfig.xml.
+Problem:+
But currently DirectoryFactory delegation does not work with a delegate
CachingDirectoryFactory because the get() method creates internally a Directory
instance of a type which cannot be controlled by the caller (the
DelegatingDirectoryFactory).
+Proposal:+
So here we propose to change DirectoryFactory.get() method by adding a fourth
parameter Function<Directory, Directory> that allows the caller to wrap the
internal Directory with a custom FilterDirectory when it is created. Hence we
would have a DelegatingDirectoryFactory that could delegate the creation of
some FilterDirectory.
was:
FilterDirectory already exists to delegate to a Directory, but there is no
delegating DirectoryFactory.
+Use cases:+
A DelegatingDirectoryFactory could be used in SOLR-15051 to make
BlobDirectoryFactory easily delegate to any DirectoryFactory (e.g.
MMapDirectoryFactory). If the DelegatingDirectoryFactory delegation can be
configured in solrconfig.xml then it allows any user to change the delegate
DirectoryFactory without code.
A DelegatingDirectoryFactory could be used by an EncryptingDirectoryFactory
that could encrypt/decrypt any delegate DirectoryFactory. Here again it should
be configurable in solrconfig.xml.
+Problem:+
But currently DirectoryFactory delegation does not work with a delegate
CachingDirectoryFactory because the get() method creates internally a Directory
instance of a type which cannot be controlled by the caller (the
DelegatingDirectoryFactory).
+Proposal:+
So here we propose to change DirectoryFactory.get() method by adding a fourth
parameter Function<Directory, Directory> that allows the caller to wrap the
internal Directory with a custom FilterDirectory when it is created.
+Benefit:+
Hence we would have a DelegatingDirectoryFactory that could delegate the
creation of some FilterDirectory.
> Introduce DelegatingDirectoryFactory
> ------------------------------------
>
> Key: SOLR-15060
> URL: https://issues.apache.org/jira/browse/SOLR-15060
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Reporter: Bruno Roustant
> Assignee: Bruno Roustant
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> FilterDirectory already exists to delegate to a Directory, but there is no
> delegating DirectoryFactory.
> +Use cases:+
> A DelegatingDirectoryFactory could be used in SOLR-15051 to make
> BlobDirectoryFactory easily delegate to any DirectoryFactory (e.g.
> MMapDirectoryFactory). If the DelegatingDirectoryFactory delegation can be
> configured in solrconfig.xml then it allows any user to change the delegate
> DirectoryFactory without code.
> A DelegatingDirectoryFactory could be used by an EncryptingDirectoryFactory
> that could encrypt/decrypt any delegate DirectoryFactory. Here again it
> should be configurable in solrconfig.xml.
> +Problem:+
> But currently DirectoryFactory delegation does not work with a delegate
> CachingDirectoryFactory because the get() method creates internally a
> Directory instance of a type which cannot be controlled by the caller (the
> DelegatingDirectoryFactory).
> +Proposal:+
> So here we propose to change DirectoryFactory.get() method by adding a
> fourth parameter Function<Directory, Directory> that allows the caller to
> wrap the internal Directory with a custom FilterDirectory when it is created.
> Hence we would have a DelegatingDirectoryFactory that could delegate the
> creation of some FilterDirectory.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]