You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2014/04/20 13:51:29 UTC

svn commit: r1588740 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/codecs/ lucene/codecs/src/java/org/apache/lucene/codecs/memory/ lucene/core/ lucene/core/src/java/org/apache/lucene/store/ lucene/core/src/test/org/apache/lucene/store/

Author: rmuir
Date: Sun Apr 20 11:51:29 2014
New Revision: 1588740

URL: http://svn.apache.org/r1588740
Log:
LUCENE-5621: remove IndexOutput.flush

Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_4x/lucene/codecs/   (props changed)
    lucene/dev/branches/branch_4x/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
    lucene/dev/branches/branch_4x/lucene/core/   (props changed)
    lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/store/IndexOutput.java
    lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java

Modified: lucene/dev/branches/branch_4x/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/CHANGES.txt?rev=1588740&r1=1588739&r2=1588740&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/CHANGES.txt (original)
+++ lucene/dev/branches/branch_4x/lucene/CHANGES.txt Sun Apr 20 11:51:29 2014
@@ -11,6 +11,9 @@ API Changes
   IndexOutput.getFilePointer instead) and IndexOutput.setLength.
   (Mike McCandless)
 
+* LUCENE-5621: Deprecate IndexOutput.flush: this is not used by Lucene.
+  (Robert Muir)
+
 Optimizations
 
 * LUCENE-5603: hunspell stemmer more efficiently strips prefixes

Modified: lucene/dev/branches/branch_4x/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java?rev=1588740&r1=1588739&r2=1588740&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java (original)
+++ lucene/dev/branches/branch_4x/lucene/codecs/src/java/org/apache/lucene/codecs/memory/DirectPostingsFormat.java Sun Apr 20 11:51:29 2014
@@ -393,7 +393,6 @@ public final class DirectPostingsFormat 
 
           final byte[] payloads;
           if (hasPayloads) {
-            ros.flush();
             payloads = new byte[(int) ros.length()];
             ros.writeTo(payloads, 0);
           } else {

Modified: lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/store/IndexOutput.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/store/IndexOutput.java?rev=1588740&r1=1588739&r2=1588740&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/store/IndexOutput.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/store/IndexOutput.java Sun Apr 20 11:51:29 2014
@@ -31,7 +31,10 @@ import java.io.IOException;
  */
 public abstract class IndexOutput extends DataOutput implements Closeable {
 
-  /** Forces any buffered output to be written. */
+  /** Forces any buffered output to be written. 
+   * @deprecated Lucene never calls this method.
+   */
+  @Deprecated
   public abstract void flush() throws IOException;
 
   /** Closes this stream to further operations. */

Modified: lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java?rev=1588740&r1=1588739&r2=1588740&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java (original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/test/org/apache/lucene/store/TestMockDirectoryWrapper.java Sun Apr 20 11:51:29 2014
@@ -59,9 +59,10 @@ public class TestMockDirectoryWrapper ex
     final byte[] bytes = new byte[] { 1, 2};
     IndexOutput out = dir.createOutput("foo", IOContext.DEFAULT);
     out.writeBytes(bytes, bytes.length); // first write should succeed
-    // flush() to ensure the written bytes are not buffered and counted
+    // close() to ensure the written bytes are not buffered and counted
     // against the directory size
-    out.flush();
+    out.close();
+    out = dir.createOutput("bar", IOContext.DEFAULT);
     try {
       out.writeBytes(bytes, bytes.length);
       fail("should have failed on disk full");
@@ -76,9 +77,10 @@ public class TestMockDirectoryWrapper ex
     dir.setMaxSizeInBytes(3);
     out = dir.createOutput("foo", IOContext.DEFAULT);
     out.copyBytes(new ByteArrayDataInput(bytes), bytes.length); // first copy should succeed
-    // flush() to ensure the written bytes are not buffered and counted
+    // close() to ensure the written bytes are not buffered and counted
     // against the directory size
-    out.flush();
+    out.close();
+    out = dir.createOutput("bar", IOContext.DEFAULT);
     try {
       out.copyBytes(new ByteArrayDataInput(bytes), bytes.length);
       fail("should have failed on disk full");