From 2ff9fa27e7c2c610f77d61fba7300ee2d1cb7d42 Mon Sep 17 00:00:00 2001 From: Yonik Seeley Date: Fri, 22 Jul 2011 21:14:24 +0000 Subject: [PATCH] SOLR-2670: add NIOFSDirectoryFactory git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1149740 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 2 ++ .../solr/core/NIOFSDirectoryFactory.java | 36 +++++++++++++++++++ solr/example/solr/conf/solrconfig.xml | 7 +++- 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 solr/core/src/java/org/apache/solr/core/NIOFSDirectoryFactory.java diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index eab05b7b15c..dca1dd264a3 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -320,6 +320,8 @@ New Features * SOLR-2584: add UniqFieldsUpdateProcessor that removes duplicate values in the specified fields. (Elmer Garduno, koji) +* SOLR-2670: Added NIOFSDirectoryFactory (yonik) + Optimizations ---------------------- diff --git a/solr/core/src/java/org/apache/solr/core/NIOFSDirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/NIOFSDirectoryFactory.java new file mode 100644 index 00000000000..ce585e78497 --- /dev/null +++ b/solr/core/src/java/org/apache/solr/core/NIOFSDirectoryFactory.java @@ -0,0 +1,36 @@ +package org.apache.solr.core; +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import org.apache.lucene.store.Directory; +import org.apache.lucene.store.NIOFSDirectory; + +import java.io.File; +import java.io.IOException; + + +/** + * Factory to instantiate {@link org.apache.lucene.store.NIOFSDirectory} + * + **/ +public class NIOFSDirectoryFactory extends DirectoryFactory { + + @Override + public Directory open(String path) throws IOException { + return new NIOFSDirectory(new File(path)); + } +} diff --git a/solr/example/solr/conf/solrconfig.xml b/solr/example/solr/conf/solrconfig.xml index 3a607508948..4c617702c40 100755 --- a/solr/example/solr/conf/solrconfig.xml +++ b/solr/example/solr/conf/solrconfig.xml @@ -87,7 +87,12 @@