lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject lucene-solr git commit: ensureCanWrite is not necessary since we pass TRUNCATE_EXISTING
Date Wed, 03 Feb 2016 10:35:14 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master 2c0a66bfb -> 72b79308c


ensureCanWrite is not necessary since we pass TRUNCATE_EXISTING


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/72b79308
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/72b79308
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/72b79308

Branch: refs/heads/master
Commit: 72b79308cbce0ab31948df1efeb0cdd5e9eb027f
Parents: 2c0a66b
Author: Mike McCandless <mikemccand@apache.org>
Authored: Wed Feb 3 05:35:32 2016 -0500
Committer: Mike McCandless <mikemccand@apache.org>
Committed: Wed Feb 3 05:35:32 2016 -0500

----------------------------------------------------------------------
 lucene/core/src/java/org/apache/lucene/store/FSDirectory.java   | 5 -----
 .../src/java/org/apache/lucene/store/NativeUnixDirectory.java   | 1 -
 2 files changed, 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/72b79308/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
index d02c126..400ad5d 100644
--- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
+++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java
@@ -228,7 +228,6 @@ public abstract class FSDirectory extends BaseDirectory {
   @Override
   public IndexOutput createOutput(String name, IOContext context) throws IOException {
     ensureOpen();
-    ensureCanWrite(name);
     return new FSIndexOutput(name);
   }
 
@@ -246,10 +245,6 @@ public abstract class FSDirectory extends BaseDirectory {
     }
   }
 
-  protected void ensureCanWrite(String name) throws IOException {
-    Files.deleteIfExists(directory.resolve(name)); // delete existing, if any
-  }
-
   @Override
   public void sync(Collection<String> names) throws IOException {
     ensureOpen();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/72b79308/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java b/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java
index 43763e2..51d7e92 100644
--- a/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java
+++ b/lucene/misc/src/java/org/apache/lucene/store/NativeUnixDirectory.java
@@ -148,7 +148,6 @@ public class NativeUnixDirectory extends FSDirectory {
     if (context.context != Context.MERGE || context.mergeInfo.estimatedMergeBytes < minBytesDirect)
{
       return delegate.createOutput(name, context);
     } else {
-      ensureCanWrite(name);
       return new NativeUnixIndexOutput(getDirectory().resolve(name), name, mergeBufferSize);
     }
   }


Mime
View raw message