LUCENE-5730: FSDirectory.open should return mmap for 64-bit OS X

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1599725 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2014-06-03 18:22:22 +00:00
parent 1938b75a57
commit e33d6658c8
2 changed files with 4 additions and 2 deletions

View File

@ -232,6 +232,9 @@ Optimizations
implementations. This improves random access as used by docvalues codecs implementations. This improves random access as used by docvalues codecs
if used with MMapDirectory. (Robert Muir, Uwe Schindler) if used with MMapDirectory. (Robert Muir, Uwe Schindler)
* LUCENE-5730: FSDirectory.open returns MMapDirectory for 64-bit operating
systems, not just Linux and Windows. (Robert Muir)
Bug fixes Bug fixes
* LUCENE-5673: MMapDirectory: Work around a "bug" in the JDK that throws * LUCENE-5673: MMapDirectory: Work around a "bug" in the JDK that throws

View File

@ -167,8 +167,7 @@ public abstract class FSDirectory extends BaseDirectory {
/** Just like {@link #open(File)}, but allows you to /** Just like {@link #open(File)}, but allows you to
* also specify a custom {@link LockFactory}. */ * also specify a custom {@link LockFactory}. */
public static FSDirectory open(File path, LockFactory lockFactory) throws IOException { public static FSDirectory open(File path, LockFactory lockFactory) throws IOException {
if ((Constants.WINDOWS || Constants.SUN_OS || Constants.LINUX) if (Constants.JRE_IS_64BIT && MMapDirectory.UNMAP_SUPPORTED) {
&& Constants.JRE_IS_64BIT && MMapDirectory.UNMAP_SUPPORTED) {
return new MMapDirectory(path, lockFactory); return new MMapDirectory(path, lockFactory);
} else if (Constants.WINDOWS) { } else if (Constants.WINDOWS) {
return new SimpleFSDirectory(path, lockFactory); return new SimpleFSDirectory(path, lockFactory);