Details
-
Improvement
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
-
None
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.
Attachments
Issue Links
- is a child of
-
SOLR-15051 Shared storage -- BlobDirectory (de-duping)
- Resolved
- links to