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: Refactoring CloneableCollector to be an abstract class instead of an interface.
Date Wed, 15 Apr 2015 01:35:42 GMT
Refactoring CloneableCollector to be an abstract class instead of an interface.


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

Branch: refs/heads/master
Commit: 578130245c58101f5e3b0ddc02acb4cc154bd762
Parents: 25b6999
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Apr 14 21:35:39 2015 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Apr 14 21:35:39 2015 -0400

----------------------------------------------------------------------
 .../blur/lucene/search/BlurFieldCollector.java  | 24 +----------------
 .../lucene/search/BlurScoreDocCollector.java    | 24 +----------------
 .../blur/lucene/search/CloneableCollector.java  | 28 +++++++++++++++++---
 3 files changed, 27 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/57813024/blur-query/src/main/java/org/apache/blur/lucene/search/BlurFieldCollector.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/lucene/search/BlurFieldCollector.java
b/blur-query/src/main/java/org/apache/blur/lucene/search/BlurFieldCollector.java
index c284dad..3e60e63 100644
--- a/blur-query/src/main/java/org/apache/blur/lucene/search/BlurFieldCollector.java
+++ b/blur-query/src/main/java/org/apache/blur/lucene/search/BlurFieldCollector.java
@@ -21,15 +21,13 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.FieldDoc;
-import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.Sort;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.search.TopFieldCollector;
 
-public class BlurFieldCollector extends Collector implements TopDocCollectorInterface, CloneableCollector
{
+public class BlurFieldCollector extends CloneableCollector implements TopDocCollectorInterface
{
 
   public static BlurFieldCollector create(Sort sort, int numHitsToCollect, FieldDoc after,
boolean runSlow,
       AtomicBoolean running) {
@@ -53,26 +51,6 @@ public class BlurFieldCollector extends Collector implements TopDocCollectorInte
   }
 
   @Override
-  public void setScorer(Scorer scorer) throws IOException {
-    throw new RuntimeException("Not implemented.");
-  }
-
-  @Override
-  public void collect(int doc) throws IOException {
-    throw new RuntimeException("Not implemented.");
-  }
-
-  @Override
-  public void setNextReader(AtomicReaderContext context) throws IOException {
-    throw new RuntimeException("Not implemented.");
-  }
-
-  @Override
-  public boolean acceptsDocsOutOfOrder() {
-    throw new RuntimeException("Not implemented.");
-  }
-
-  @Override
   public int getTotalHits() {
     return _hits;
   }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/57813024/blur-query/src/main/java/org/apache/blur/lucene/search/BlurScoreDocCollector.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/lucene/search/BlurScoreDocCollector.java
b/blur-query/src/main/java/org/apache/blur/lucene/search/BlurScoreDocCollector.java
index f7e8450..850c260 100644
--- a/blur-query/src/main/java/org/apache/blur/lucene/search/BlurScoreDocCollector.java
+++ b/blur-query/src/main/java/org/apache/blur/lucene/search/BlurScoreDocCollector.java
@@ -21,14 +21,12 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.search.Collector;
 import org.apache.lucene.search.ScoreDoc;
-import org.apache.lucene.search.Scorer;
 import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.search.TopScoreDocCollector;
 
-public class BlurScoreDocCollector extends Collector implements TopDocCollectorInterface,
CloneableCollector {
+public class BlurScoreDocCollector extends CloneableCollector implements TopDocCollectorInterface
{
 
   public static BlurScoreDocCollector create(int numHitsToCollect, ScoreDoc after, boolean
runSlow,
       AtomicBoolean running) {
@@ -50,26 +48,6 @@ public class BlurScoreDocCollector extends Collector implements TopDocCollectorI
   }
 
   @Override
-  public void setScorer(Scorer scorer) throws IOException {
-    throw new RuntimeException("Not implemented.");
-  }
-
-  @Override
-  public void collect(int doc) throws IOException {
-    throw new RuntimeException("Not implemented.");
-  }
-
-  @Override
-  public void setNextReader(AtomicReaderContext context) throws IOException {
-    throw new RuntimeException("Not implemented.");
-  }
-
-  @Override
-  public boolean acceptsDocsOutOfOrder() {
-    throw new RuntimeException("Not implemented.");
-  }
-
-  @Override
   public int getTotalHits() {
     return _hits;
   }

http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/57813024/blur-query/src/main/java/org/apache/blur/lucene/search/CloneableCollector.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/lucene/search/CloneableCollector.java
b/blur-query/src/main/java/org/apache/blur/lucene/search/CloneableCollector.java
index c6aa726..b4f1e2f 100644
--- a/blur-query/src/main/java/org/apache/blur/lucene/search/CloneableCollector.java
+++ b/blur-query/src/main/java/org/apache/blur/lucene/search/CloneableCollector.java
@@ -18,12 +18,34 @@ package org.apache.blur.lucene.search;
 
 import java.io.IOException;
 
+import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.search.Collector;
+import org.apache.lucene.search.Scorer;
 
-public interface CloneableCollector {
+public abstract class CloneableCollector extends Collector {
 
-  Collector newCollector() throws IOException;
+  public abstract Collector newCollector() throws IOException;
 
-  Collector merge(Collector... merge) throws IOException;
+  public abstract Collector merge(Collector... merge) throws IOException;
+
+  @Override
+  public final void setScorer(Scorer scorer) throws IOException {
+    throw new RuntimeException("Not implemented.");
+  }
+
+  @Override
+  public final void collect(int doc) throws IOException {
+    throw new RuntimeException("Not implemented.");
+  }
+
+  @Override
+  public final void setNextReader(AtomicReaderContext context) throws IOException {
+    throw new RuntimeException("Not implemented.");
+  }
+
+  @Override
+  public final boolean acceptsDocsOutOfOrder() {
+    throw new RuntimeException("Not implemented.");
+  }
 
 }


Mime
View raw message