mirror of https://github.com/apache/lucene.git
ensureCanWrite is not necessary since we pass TRUNCATE_EXISTING
This commit is contained in:
parent
2c0a66bfbc
commit
72b79308cb
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue