Mailing List Archive

cvs commit: jakarta-lucene/src/java/org/apache/lucene/store Directory.java FSDirectory.java RAMDirectory.java
cutting 2002/08/08 10:56:20

Modified: . CHANGES.txt
src/java/org/apache/lucene/index SegmentReader.java
src/java/org/apache/lucene/store Directory.java
FSDirectory.java RAMDirectory.java
Log:
Fixed a bug in IndexReader.lastModified().

Revision Changes Path
1.32 +5 -2 jakarta-lucene/CHANGES.txt

Index: CHANGES.txt
===================================================================
RCS file: /home/cvs/jakarta-lucene/CHANGES.txt,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- CHANGES.txt 7 Aug 2002 16:28:08 -0000 1.31
+++ CHANGES.txt 8 Aug 2002 17:56:19 -0000 1.32
@@ -85,7 +85,10 @@
need to be reconstructed once per day. (cutting)

15. Added a new IndexWriter method, getAnalyzer(). This returns the
- analyzer used when adding documents to this index.
+ analyzer used when adding documents to this index. (cutting)
+
+ 16. Fixed a bug with IndexReader.lastModified(). Before, document
+ deletion did not update this. Now it does. (cutting)


1.2 RC6



1.5 +1 -0 jakarta-lucene/src/java/org/apache/lucene/index/SegmentReader.java

Index: SegmentReader.java
===================================================================
RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/SegmentReader.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SegmentReader.java 8 Feb 2002 19:39:42 -0000 1.4
+++ SegmentReader.java 8 Aug 2002 17:56:19 -0000 1.5
@@ -121,6 +121,7 @@
public Object doBody() throws IOException {
deletedDocs.write(directory, segment + ".tmp");
directory.renameFile(segment + ".tmp", segment + ".del");
+ directory.touchFile("segments");
return null;
}
}.run();



1.4 +4 -0 jakarta-lucene/src/java/org/apache/lucene/store/Directory.java

Index: Directory.java
===================================================================
RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/store/Directory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Directory.java 31 Jul 2002 17:47:14 -0000 1.3
+++ Directory.java 8 Aug 2002 17:56:19 -0000 1.4
@@ -82,6 +82,10 @@
abstract public long fileModified(String name)
throws IOException, SecurityException;

+ /** Set the modified time of an existing file to now. */
+ abstract public void touchFile(String name)
+ throws IOException, SecurityException;
+
/** Removes an existing file in the directory. */
abstract public void deleteFile(String name)
throws IOException, SecurityException;



1.11 +6 -0 jakarta-lucene/src/java/org/apache/lucene/store/FSDirectory.java

Index: FSDirectory.java
===================================================================
RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/store/FSDirectory.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- FSDirectory.java 31 Jul 2002 17:47:14 -0000 1.10
+++ FSDirectory.java 8 Aug 2002 17:56:19 -0000 1.11
@@ -175,6 +175,12 @@
return file.lastModified();
}

+ /** Set the modified time of an existing file to now. */
+ public void touchFile(String name) throws IOException, SecurityException {
+ File file = new File(directory, name);
+ file.setLastModified(System.currentTimeMillis());
+ }
+
/** Returns the length in bytes of a file in the directory. */
public final long fileLength(String name) throws IOException {
File file = new File(directory, name);



1.5 +6 -0 jakarta-lucene/src/java/org/apache/lucene/store/RAMDirectory.java

Index: RAMDirectory.java
===================================================================
RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/store/RAMDirectory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- RAMDirectory.java 31 Jul 2002 17:47:14 -0000 1.4
+++ RAMDirectory.java 8 Aug 2002 17:56:19 -0000 1.5
@@ -93,6 +93,12 @@
return file.lastModified;
}

+ /** Set the modified time of an existing file to now. */
+ public void touchFile(String name) throws IOException, SecurityException {
+ RAMFile file = (RAMFile)files.get(name);
+ file.lastModified = System.currentTimeMillis();
+ }
+
/** Returns the length in bytes of a file in the directory. */
public final long fileLength(String name) {
RAMFile file = (RAMFile)files.get(name);




--
To unsubscribe, e-mail: <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>