From e33d6658c84c926801dfb231adc508e601d96946 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Tue, 3 Jun 2014 18:22:22 +0000 Subject: [PATCH] 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 --- lucene/CHANGES.txt | 3 +++ lucene/core/src/java/org/apache/lucene/store/FSDirectory.java | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 30af545521c..b26e1cb50a7 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -232,6 +232,9 @@ Optimizations implementations. This improves random access as used by docvalues codecs 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 * LUCENE-5673: MMapDirectory: Work around a "bug" in the JDK that throws 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 2cbde59b6da..ed7968ab803 100644 --- a/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java +++ b/lucene/core/src/java/org/apache/lucene/store/FSDirectory.java @@ -167,8 +167,7 @@ public abstract class FSDirectory extends BaseDirectory { /** Just like {@link #open(File)}, but allows you to * also specify a custom {@link LockFactory}. */ public static FSDirectory open(File path, LockFactory lockFactory) throws IOException { - if ((Constants.WINDOWS || Constants.SUN_OS || Constants.LINUX) - && Constants.JRE_IS_64BIT && MMapDirectory.UNMAP_SUPPORTED) { + if (Constants.JRE_IS_64BIT && MMapDirectory.UNMAP_SUPPORTED) { return new MMapDirectory(path, lockFactory); } else if (Constants.WINDOWS) { return new SimpleFSDirectory(path, lockFactory);