diff --git a/CHANGES.txt b/CHANGES.txt index 511233925d4..ee5453b636e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -37,6 +37,9 @@ Bug fixes (Chris Hostetter) 5. Fix to allow MatchAllDocsQuery to be used with RemoteSearcher (Yonik Seeley) + + 6. LUCENE-601: RAMDirectory and RAMFile made Serializable + (Karl Wettin via Otis Gospodnetic) Optimizations diff --git a/src/java/org/apache/lucene/store/RAMDirectory.java b/src/java/org/apache/lucene/store/RAMDirectory.java index c3282f0a079..9b58527daa7 100644 --- a/src/java/org/apache/lucene/store/RAMDirectory.java +++ b/src/java/org/apache/lucene/store/RAMDirectory.java @@ -18,6 +18,7 @@ package org.apache.lucene.store; import java.io.IOException; import java.io.File; +import java.io.Serializable; import java.util.Hashtable; import java.util.Enumeration; @@ -30,7 +31,10 @@ import org.apache.lucene.store.IndexOutput; * * @version $Id$ */ -public final class RAMDirectory extends Directory { +public final class RAMDirectory extends Directory implements Serializable { + + private static final long serialVersionUID = 1l; + Hashtable files = new Hashtable(); /** Constructs an empty {@link Directory}. */ diff --git a/src/java/org/apache/lucene/store/RAMFile.java b/src/java/org/apache/lucene/store/RAMFile.java index 254b6fa75a6..a808fe25233 100644 --- a/src/java/org/apache/lucene/store/RAMFile.java +++ b/src/java/org/apache/lucene/store/RAMFile.java @@ -17,8 +17,12 @@ package org.apache.lucene.store; */ import java.util.Vector; +import java.io.Serializable; + +class RAMFile implements Serializable { + + private static final long serialVersionUID = 1l; -class RAMFile { Vector buffers = new Vector(); long length; long lastModified = System.currentTimeMillis();