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

[PATCH] Clonable RAMDirectory

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Not A Problem
    • None
    • None
    • core/store
    • None
    • Operating System: other
      Platform: Other

    • 23774

    Description

      A patch for RAMDirectory that makes it clonable.

      May 22nd, 2003 contribution from "Nick Smith" <nick.smith@techop.ch>

      Original email:
      Hi Lucene Developers,
      Thanks for a great product!

      I need to be able to 'snapshot' our in-memory indices (RAMDirectory
      instances).

      I have been using :

      RAMDirectory activeDir = new RAMDirectory();
      // many inserts, deletes etc
      RAMDirectory cloneDir = new RAMDirectory(activeDir);

      but unfortunately this is rather slow for large indices.

      I have a suggestion - implement java.lang.Cloneable interface
      in RAMDirectory. I.e to be able to call :

      RAMDirectory cloneDir = (RAMDirectory)activeDir.clone();

      This bypasses the input/output stream handling of the
      copy constructor by cloneing the underlying buffers that
      form the directory and is much faster. (Diff attached).

      Any comments?

      Regards,

      Nick

      Attachments

        Activity

          People

            Unassigned Unassigned
            otis@apache.org Otis Gospodnetic
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: