Skip to content

Can we allow FSDirectory subclasses to customize whether the ctor does a mkdir? [LUCENE-7375] #8428

@asfimport

Description

@asfimport

Today, just instantiating an FSDirectory always brings the directory into existence, even if you will do no writes (createOutput).

We have gone back and forth on this, over the ages. E.g. see #1094 (only 2 digits there!), #1848 (only 3 digits there, #1848 (only 3 digits there)!), #2538. At one point we created the directory lazily, on the first write (createOutput) attempt, but now we always create it when you instantiate FSDirectory.

This causes some hassle for consumers, e.g. in elastic/elasticsearch#19338 ES is forking SimpleFSDirectory in order to have a read-only directory impl.

Maybe we can do the Files.createDirectories in protected method that a subclass could override?


Migrated from LUCENE-7375 by Michael McCandless (@mikemccand)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions