DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23774>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23774 [PATCH] Clonable RAMDirectory Summary: [PATCH] Clonable RAMDirectory Product: Lucene Version: unspecified Platform: Other OS/Version: Other Status: NEW Severity: Enhancement Priority: Other Component: Store AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] CC: [EMAIL PROTECTED] A patch for RAMDirectory that makes it clonable. May 22nd, 2003 contribution from "Nick Smith" <[EMAIL PROTECTED]> 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 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]