incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [2/2] git commit: Fixed compiler errors.
Date Wed, 17 Oct 2012 01:39:21 GMT
Fixed compiler errors.


Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/6c38c69a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/6c38c69a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/6c38c69a

Branch: refs/heads/lucene-4.0.0
Commit: 6c38c69ac111722c927a1df99554cd83cb8db870
Parents: 989e5f0
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Oct 16 21:07:52 2012 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Oct 16 21:07:52 2012 -0400

----------------------------------------------------------------------
 .../blur/manager/writer/AbstractBlurIndex.java     |   18 ++++++--------
 .../blur/manager/writer/BlurIndexReader.java       |   14 +++++-----
 2 files changed, 15 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/6c38c69a/src/blur-core/src/main/java/org/apache/blur/manager/writer/AbstractBlurIndex.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/writer/AbstractBlurIndex.java
b/src/blur-core/src/main/java/org/apache/blur/manager/writer/AbstractBlurIndex.java
index 5138bd2..b758f11 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/writer/AbstractBlurIndex.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/writer/AbstractBlurIndex.java
@@ -16,7 +16,7 @@ package org.apache.blur.manager.writer;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import static org.apache.blur.lucene.LuceneConstant.LUCENE_VERSION;
+import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
 
 import java.io.IOException;
 import java.util.concurrent.Callable;
@@ -25,12 +25,13 @@ import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicReference;
 
 import org.apache.blur.analysis.BlurAnalyzer;
+import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexDeletionPolicy;
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy;
 import org.apache.lucene.index.TieredMergePolicy;
-import org.apache.lucene.search.Similarity;
+import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.store.Directory;
 
 public abstract class AbstractBlurIndex extends BlurIndex {
@@ -39,7 +40,7 @@ public abstract class AbstractBlurIndex extends BlurIndex {
   private BlurIndexCloser _closer;
   private Directory _directory;
   private IndexDeletionPolicy _indexDeletionPolicy = new KeepOnlyLastCommitDeletionPolicy();
-  private AtomicReference<IndexReader> _indexReaderRef = new AtomicReference<IndexReader>();
+  private AtomicReference<DirectoryReader> _indexReaderRef = new AtomicReference<DirectoryReader>();
   private AtomicBoolean _isClosed = new AtomicBoolean(false);
   private AtomicBoolean _open = new AtomicBoolean();
   private BlurIndexRefresher _refresher;
@@ -58,7 +59,7 @@ public abstract class AbstractBlurIndex extends BlurIndex {
     return conf;
   }
 
-  protected void initIndexReader(IndexReader reader) throws IOException {
+  protected void initIndexReader(DirectoryReader reader) throws IOException {
     _indexReaderRef.set(reader);
     _refresher.register(this);
   }
@@ -68,12 +69,9 @@ public abstract class AbstractBlurIndex extends BlurIndex {
     if (!_open.get()) {
       return;
     }
-    IndexReader oldReader = _indexReaderRef.get();
-    if (oldReader.isCurrent()) {
-      return;
-    }
-    IndexReader reader = IndexReader.openIfChanged(oldReader);
-    if (reader != null && oldReader != reader) {
+    DirectoryReader oldReader = _indexReaderRef.get();
+    DirectoryReader reader = DirectoryReader.openIfChanged(oldReader);
+    if (reader != null) {
       _indexReaderRef.set(reader);
       _closer.close(oldReader);
     }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/6c38c69a/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexReader.java
----------------------------------------------------------------------
diff --git a/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexReader.java
b/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexReader.java
index 48fe298..854490e 100644
--- a/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexReader.java
+++ b/src/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexReader.java
@@ -16,18 +16,18 @@ package org.apache.blur.manager.writer;
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+import static org.apache.blur.lucene.LuceneVersionConstant.LUCENE_VERSION;
+
 import java.io.IOException;
 
 import org.apache.blur.index.IndexWriter;
 import org.apache.blur.log.Log;
 import org.apache.blur.log.LogFactory;
 import org.apache.blur.thrift.generated.Row;
-import org.apache.lucene.analysis.KeywordAnalyzer;
-import org.apache.lucene.index.IndexReader;
+import org.apache.lucene.analysis.core.KeywordAnalyzer;
+import org.apache.lucene.index.DirectoryReader;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.util.Version;
-
 
 public class BlurIndexReader extends AbstractBlurIndex {
 
@@ -36,11 +36,11 @@ public class BlurIndexReader extends AbstractBlurIndex {
   public void init() throws IOException {
     initIndexWriterConfig();
     Directory directory = getDirectory();
-    if (!IndexReader.indexExists(directory)) {
-      IndexWriterConfig conf = new IndexWriterConfig(Version.LUCENE_35, new KeywordAnalyzer());
+    if (!DirectoryReader.indexExists(directory)) {
+      IndexWriterConfig conf = new IndexWriterConfig(LUCENE_VERSION, new KeywordAnalyzer());
       new IndexWriter(directory, conf).close();
     }
-    initIndexReader(IndexReader.open(directory));
+    initIndexReader(DirectoryReader.open(directory));
   }
 
   @Override


Mime
View raw message