Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-7375

Can we allow FSDirectory subclasses to customize whether the ctor does a mkdir?

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • New

    Description

      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 LUCENE-16 (only 2 digits there!!), LUCENE-773 (only 3 digits there!!), LUCENE-1464. 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 https://github.com/elastic/elasticsearch/pull/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?

      Attachments

        Activity

          People

            Unassigned Unassigned
            mikemccand Michael McCandless
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: