You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2016/02/04 18:17:34 UTC
[05/12] lucene-solr git commit: ensureCanWrite is not necessary since
we pass TRUNCATE_EXISTING
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/lucene-6835
Commit: 72b79308cbce0ab31948df1efeb0cdd5e9eb027f
Parents: 2c0a66b
Author: Mike McCandless <mi...@apache.org>
Authored: Wed Feb 3 05:35:32 2016 -0500
Committer: Mike McCandless <mi...@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);
}
}