summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@verizonmedia.com>2019-09-24 19:35:35 +0200
committerJon Bratseth <bratseth@verizonmedia.com>2019-09-24 19:35:35 +0200
commit77ab955c266375ec90551857e5fbd8af894f50c6 (patch)
treed4ab582bacd255cf5587a456fbe03f07792d61ba /searchlib
parent11ab4237312e3f52fac8f5f82553ee2598ac5eed (diff)
Nonfunctional changes only
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/main/java/com/yahoo/searchlib/aggregation/AggregationResult.java14
-rw-r--r--searchlib/src/main/java/com/yahoo/searchlib/aggregation/FS4Hit.java5
-rw-r--r--searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java52
-rw-r--r--searchlib/src/main/java/com/yahoo/searchlib/aggregation/Hit.java3
-rw-r--r--searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java10
-rw-r--r--searchlib/src/test/java/com/yahoo/searchlib/aggregation/GroupingTestCase.java1
6 files changed, 39 insertions, 46 deletions
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/AggregationResult.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/AggregationResult.java
index 264a9d4d4e9..c3ad7cbe879 100644
--- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/AggregationResult.java
+++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/AggregationResult.java
@@ -8,7 +8,7 @@ import com.yahoo.vespa.objects.ObjectVisitor;
import com.yahoo.vespa.objects.Serializer;
/**
- * <p>This is the aggregation super-class from which all types of aggregation inherits.</p>
+ * The result of some aggregation
*
* @author baldersheim
* @author Simon Thoresen Hult
@@ -20,7 +20,7 @@ public abstract class AggregationResult extends ExpressionNode {
private int tag = -1;
/**
- * <p>Returns the tag of this aggregation result. This is useful for uniquely identifying a result.</p>
+ * Returns the tag of this aggregation result. This is useful for uniquely identifying a result.
*
* @return The numerical tag.
*/
@@ -50,8 +50,8 @@ public abstract class AggregationResult extends ExpressionNode {
}
/**
- * <p>This method is called when all aggregation results have been merged. This method can be overloaded by
- * subclasses that need special behaviour to occur after merge.</p>
+ * This method is called when all aggregation results have been merged. This method can be overloaded by
+ * subclasses that need special behaviour to occur after merge.
*/
public void postMerge() {
// empty
@@ -85,10 +85,10 @@ public abstract class AggregationResult extends ExpressionNode {
}
/**
- * <p>This method must be implemented by subclasses to support merge. It is called as the {@link
- * #merge(AggregationResult)} method is invoked.</p>
+ * This method must be implemented by subclasses to support merge. It is called as the {@link
+ * #merge(AggregationResult)} method is invoked.
*
- * @param result The result to merge with.
+ * @param result the result to merge with
*/
protected abstract void onMerge(AggregationResult result);
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/FS4Hit.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/FS4Hit.java
index 399ffd3128f..07de8bbdc55 100644
--- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/FS4Hit.java
+++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/FS4Hit.java
@@ -7,7 +7,7 @@ import com.yahoo.vespa.objects.ObjectVisitor;
import com.yahoo.vespa.objects.Serializer;
/**
- * This class represents a single hit from the fastserver4 backend
+ * A single hit from a Vespa content cluster
*
* @author havardpe
*/
@@ -103,7 +103,7 @@ public class FS4Hit extends Hit {
return super.hashCode() + path + globalId.hashCode() + distributionKey;
}
- @SuppressWarnings({ "EqualsWhichDoesntCheckParameterClass", "RedundantIfStatement" })
+ @SuppressWarnings("RedundantIfStatement")
@Override
public boolean equals(Object obj) {
if (!super.equals(obj)) {
@@ -129,4 +129,5 @@ public class FS4Hit extends Hit {
visitor.visit("globalId", globalId.toString());
visitor.visit("distributionKey", distributionKey);
}
+
}
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java
index 73171f4dd00..126bdd474a9 100644
--- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java
+++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java
@@ -12,28 +12,28 @@ public class Group extends Identifiable {
public static final int classId = registerClass(0x4000 + 90, Group.class);
private static final ObjectPredicate REF_LOCATOR = new RefLocator();
- private List<Integer> orderByIdx = new ArrayList<Integer>();
- private List<ExpressionNode> orderByExp = new ArrayList<ExpressionNode>();
- private List<AggregationResult> aggregationResults = new ArrayList<AggregationResult>();
- private List<Group> children = new ArrayList<Group>();
+ private List<Integer> orderByIdx = new ArrayList<>();
+ private List<ExpressionNode> orderByExp = new ArrayList<>();
+ private List<AggregationResult> aggregationResults = new ArrayList<>();
+ private List<Group> children = new ArrayList<>();
private ResultNode id = null;
private double rank;
private int tag = -1;
private SortType sortType = SortType.UNSORTED;
/**
- * <p>This tells you if the children are ranked by the pure relevance or by a more complex expression. That
- * indicates if the rank score from the child can be used for ordering.</p>
+ * This tells you if the children are ranked by the pure relevance or by a more complex expression.
+ * That indicates if the rank score from the child can be used for ordering.
*
- * @return True if it ranked by pure relevance.
+ * @return true if it ranked by pure relevance.
*/
public boolean isRankedByRelevance() {
return orderByIdx.isEmpty();
}
/**
- * <p>Merges the content of the given group <b>into</b> this. When this function returns, make sure to call {@link
- * #postMerge(java.util.List, int, int)}.</p>
+ * Merges the content of the given group <b>into</b> this. When this function returns, make sure to call
+ * {@link #postMerge(java.util.List, int, int)}.
*
* @param firstLevel The first level to merge.
* @param currentLevel The current level.
@@ -49,7 +49,7 @@ public class Group extends Identifiable {
}
}
- ArrayList<Group> merged = new ArrayList<Group>();
+ ArrayList<Group> merged = new ArrayList<>();
Iterator<Group> lhsChild = children.iterator(), rhsChild = rhs.children.iterator();
if (lhsChild.hasNext() && rhsChild.hasNext()) {
Group lhsGroup = lhsChild.next();
@@ -93,8 +93,8 @@ public class Group extends Identifiable {
}
/**
- * <p>After merging, this method will prune all levels so that they do not exceed the configured maximum number of
- * groups per level.</p>
+ * After merging, this method will prune all levels so that they do not exceed the configured maximum number of
+ * groups per level.
*
* @param levels The specs of all grouping levels.
* @param firstLevel The first level to merge.
@@ -127,9 +127,7 @@ public class Group extends Identifiable {
}
- /**
- * <p>Will sort the children by their id, if they are not sorted already.</p>
- */
+ /** Sorts the children by their id, if they are not sorted already. */
public void sortChildrenById() {
if (sortType == SortType.BYID) {
return;
@@ -142,9 +140,7 @@ public class Group extends Identifiable {
sortType = SortType.BYID;
}
- /**
- * <p>Will sort the children by their rank, if they are not sorted already.</p>
- */
+ /** Sorts the children by their rank, if they are not sorted already. */
public void sortChildrenByRank() {
if (sortType == SortType.BYRANK) {
return;
@@ -158,18 +154,16 @@ public class Group extends Identifiable {
}
/**
- * <p>Returns the label to use for this group. See comment on {@link #setId(com.yahoo.searchlib.expression.ResultNode)}
- * on the rationale of this being a {@link ResultNode}.</p>
- *
- * @return The label.
+ * Returns the label to use for this group. See comment on {@link #setId(com.yahoo.searchlib.expression.ResultNode)}
+ * on the rationale of this being a {@link ResultNode}.
*/
public ResultNode getId() {
return id;
}
/**
- * <p>Sets the label to use for this group. This is a {@link ResultNode} so that a group can be labeled with
- * whatever value the classifier expression returns.</p>
+ * Sets the label to use for this group. This is a {@link ResultNode} so that a group can be labeled with
+ * whatever value the classifier expression returns.
*
* @param id The label to set.
* @return This, to allow chaining.
@@ -180,7 +174,7 @@ public class Group extends Identifiable {
}
/**
- * <p>Sets the relevancy to use for this group.</p>
+ * Sets the relevancy to use for this group.
*
* @param rank The rank to set.
* @return This, to allow chaining.
@@ -190,17 +184,13 @@ public class Group extends Identifiable {
return this;
}
- /**
- * <p>Return the relevancy of this group.</p>
- *
- * @return Relevance.
- */
+ /** Return the rank score of this group. */
public double getRank() {
return rank;
}
/**
- * <p>Adds a child group to this.</p>
+ * Adds a child group to this.
*
* @param child The group to add.
* @return This, to allow chaining.
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Hit.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Hit.java
index 6b2ce5c3b72..cbbecbdfa22 100644
--- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Hit.java
+++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Hit.java
@@ -79,7 +79,7 @@ public abstract class Hit extends Identifiable {
return super.hashCode() + (int)rank;
}
- @SuppressWarnings({ "RedundantIfStatement", "EqualsWhichDoesntCheckParameterClass" })
+ @SuppressWarnings({ "RedundantIfStatement" })
@Override
public boolean equals(Object obj) {
if (!super.equals(obj)) {
@@ -101,4 +101,5 @@ public abstract class Hit extends Identifiable {
visitor.visit("rank", rank);
visitor.visit("context", context);
}
+
}
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java
index 275f38f7350..c7ecdbd798d 100644
--- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java
+++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java
@@ -73,8 +73,8 @@ public class HitsAggregationResult extends AggregationResult {
/**
* Sets the summary class of hits to collect.
*
- * @param summaryClass The summary class to collect.
- * @return This, to allow chaining.
+ * @param summaryClass the summary class to collect.
+ * @return this, to allow chaining.
*/
public HitsAggregationResult setSummaryClass(String summaryClass) {
this.summaryClass = summaryClass;
@@ -84,8 +84,8 @@ public class HitsAggregationResult extends AggregationResult {
/**
* Sets the maximum number of hits to collect.
*
- * @param maxHits The number of hits to collect.
- * @return This, to allow chaining.
+ * @param maxHits the number of hits to collect.
+ * @return this, to allow chaining.
*/
public HitsAggregationResult setMaxHits(int maxHits) {
this.maxHits = maxHits;
@@ -102,7 +102,7 @@ public class HitsAggregationResult extends AggregationResult {
}
/**
- * Add a hit to this aggregation result
+ * Adds a hit to this aggregation result
*
* @param h the hit
* @return this object
diff --git a/searchlib/src/test/java/com/yahoo/searchlib/aggregation/GroupingTestCase.java b/searchlib/src/test/java/com/yahoo/searchlib/aggregation/GroupingTestCase.java
index fe5405ecb6a..ec379e5f8af 100644
--- a/searchlib/src/test/java/com/yahoo/searchlib/aggregation/GroupingTestCase.java
+++ b/searchlib/src/test/java/com/yahoo/searchlib/aggregation/GroupingTestCase.java
@@ -223,5 +223,6 @@ public class GroupingTestCase {
Grouping other = (Grouping)Grouping.create(buf);
assertEquals(grouping, other);
}
+
}