diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-03-02 15:22:19 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2022-03-02 15:22:19 +0100 |
commit | 41d7819853b1951bd8f77f80fe12241cb868a323 (patch) | |
tree | c99d257e086696fb32081bb09b4228650db67667 /searchlib | |
parent | 2090ed6965c0c5b627a656ac272703326a75e1fb (diff) |
No functional changes
Diffstat (limited to 'searchlib')
7 files changed, 73 insertions, 140 deletions
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 5d606493652..5bf161b380f 100644 --- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/FS4Hit.java +++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/FS4Hit.java @@ -18,14 +18,12 @@ public class FS4Hit extends Hit { private GlobalId globalId = new GlobalId(new byte[GlobalId.LENGTH]); private int distributionKey = -1; - /** - * Constructs an empty result node. - */ + /** Constructs an empty result node. */ public FS4Hit() { } /** - * Create a hit with the given path and document id. + * Creates a hit with the given path and document id. * * @param path The mangled search node path. * @param globalId The local document id. @@ -36,7 +34,7 @@ public class FS4Hit extends Hit { } /** - * Create a hit with the given path and document id. + * Creates a hit with the given path and document id. * * @param path The mangled search node path. * @param globalId The local document id. @@ -50,29 +48,17 @@ public class FS4Hit extends Hit { this.distributionKey = distributionKey; } - /** - * Obtain the (mangled) network path back to the search node returning this hit. - * - * @return The mangled search node path. - */ + /** Returns the (mangled) network path back to the search node returning this hit. */ public int getPath() { return path; } - /** - * Obtain the global document id on the search node returning this hit. - * - * @return The global document id. - */ + /** Returns the global document id on the search node returning this hit. */ public GlobalId getGlobalId() { return globalId; } - /** - * Obtain the distribution key for the node producing this hit. - * - * @return distribution key - */ + /** Returns the distribution key for the node producing this hit. */ public int getDistributionKey() { return distributionKey; } diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/ForceLoad.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/ForceLoad.java index 729b070dd57..74d498d33f7 100644 --- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/ForceLoad.java +++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/ForceLoad.java @@ -28,11 +28,11 @@ public class ForceLoad { "hll.SparseSketch", "hll.NormalSketch" }; - com.yahoo.system.ForceLoad.forceLoad(pkg, classes, - ForceLoad.class.getClassLoader()); + com.yahoo.system.ForceLoad.forceLoad(pkg, classes, ForceLoad.class.getClassLoader()); } public static boolean forceLoad() { return true; } + } diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Grouping.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Grouping.java index c88a567c559..dcbedf924b4 100644 --- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Grouping.java +++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Grouping.java @@ -23,10 +23,10 @@ public class Grouping extends Identifiable { // The client id for this grouping request. private int id = 0; - // Whether or not this grouping is valid. + // Whether this grouping is valid. private boolean valid = true; - // Whether or not to group all hits or only those with hits. Only applicable for streaming search. + // Whether to group all hits or only those with hits. Only applicable for streaming search. private boolean all = false; // How many hits to group per backend node. @@ -48,18 +48,15 @@ public class Grouping extends Identifiable { private boolean postMergeCompleted = false; - /** - * <p>Constructs an empty result node. <b>NOTE:</b> This instance is broken until non-optional member data is - * set.</p> - */ + /** Constructs an empty result node. <b>NOTE:</b> This instance is broken until non-optional member data is set. */ public Grouping() { super(); } /** - * <p>Constructs an instance of this class with given client id.</p> + * Constructs an instance of this class with given client id. * - * @param id The client id for this grouping request. + * @param id the client id for this grouping request */ public Grouping(int id) { super(); @@ -67,17 +64,17 @@ public class Grouping extends Identifiable { } /** - * <p>Merges the content of the given grouping <b>into</b> this.</p> + * Merges the content of the given grouping <b>into</b> this. * - * @param rhs The grouping to merge with. + * @param rhs the grouping to merge with */ public void merge(Grouping rhs) { root.merge(firstLevel, 0, rhs.root); } /** - * <p>This method is invoked after merging is done. It is intended used for resolving any dependencies or derivates - * that might have changes due to the merge.</p> + * Invoked after merging is done. It is intended used for resolving any dependencies or derivates + * that might have changes due to the merge. */ public void postMerge() { if (postMergeCompleted) return; @@ -85,82 +82,64 @@ public class Grouping extends Identifiable { postMergeCompleted = true; } - /** - * <p>Returns the client id of this grouping request.</p> - * - * @return The identifier. - */ + /** Returns the client id of this grouping request. */ public int getId() { return id; } /** - * <p>Sets the client id for this grouping request.</p> + * Sets the client id for this grouping request. * - * @param id The identifier to set. - * @return This, to allow chaining. + * @param id the identifier to set + * @return this, to allow chaining */ public Grouping setId(int id) { this.id = id; return this; } - /** - * <p>Returns whether or not this grouping request is valid.</p> - * - * @return True if valid. - */ + /** Returns whether this grouping request is valid. */ public boolean valid() { return valid; } /** - * <p>Returns whether or not to perform grouping on the entire document corpus instead of only those matching the - * search criteria. Please see note on {@link #setAll(boolean)}.</p> - * - * @return True if grouping all documents. + * Returns whether to perform grouping on the entire document corpus instead of only those matching the + * search criteria. Please see note on {@link #setAll(boolean)}. */ public boolean getAll() { return all; } /** - * <p>Sets whether or not to perform grouping on the entire document corpus instead of only those matching the - * search criteria. <b>NOTE:</b> This is only possible with streaming search.</p> + * Sets whether to perform grouping on the entire document corpus instead of only those matching the + * search criteria. <b>NOTE:</b> This is only possible with streaming search. * - * @param all True to group all documents. - * @return This, to allow chaining. + * @param all true to group all documents + * @return this, to allow chaining */ public Grouping setAll(boolean all) { this.all = all; return this; } - /** - * <p>Returns the number of candidate documents to group.</p> - * - * @return The number. - */ + /** Returns the number of candidate documents to group. */ public long getTopN() { return topN; } /** - * <p>Sets the number of candidate documents to group.</p> + * Sets the number of candidate documents to group. * - * @param topN The number to set. - * @return This, to allow chaining. + * @param topN the number to set + * @return this, to allow chaining */ public Grouping setTopN(long topN) { this.topN = topN; return this; } - /** - * <p>Returns the first level to start grouping work. See note on {@link #setFirstLevel(int)}.</p> - * - * @return The first level. - */ + /** Returns the first level to start grouping work. See note on {@link #setFirstLevel(int)}. */ public int getFirstLevel() { return firstLevel; } @@ -195,20 +174,16 @@ public class Grouping extends Identifiable { return this; } - /** - * <p>Returns the list of grouping levels that make up this grouping request.</p> - * - * @return The list. - */ + /** Returns the list of grouping levels that make up this grouping request. */ public List<GroupingLevel> getLevels() { return groupingLevels; } /** - * <p>Appends the given grouping level specification to the list of levels.</p> + * Appends the given grouping level specification to the list of levels. * - * @param level The level to add. - * @return This, to allow chaining. + * @param level the level to add + * @return this, to allow chaining * @throws NullPointerException If <code>level</code> argument is null. */ public Grouping addLevel(GroupingLevel level) { @@ -217,21 +192,17 @@ public class Grouping extends Identifiable { return this; } - /** - * <p>Returns the root group.</p> - * - * @return The root. - */ + /** Returns the root group. */ public Group getRoot() { return root; } /** - * <p>Sets the root group.</p> + * Sets the root group. * - * @param root The group to set as root. - * @return This, to allow chaining. - * @throws NullPointerException If <code>root</code> argument is null. + * @param root the group to set as root + * @return this, to allow chaining + * @throws NullPointerException If <code>root</code> argument is null */ public Grouping setRoot(Group root) { root.getClass(); // throws NullPointerException diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/GroupingLevel.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/GroupingLevel.java index c166aeb173f..0db933966a8 100644 --- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/GroupingLevel.java +++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/GroupingLevel.java @@ -15,7 +15,7 @@ public class GroupingLevel extends Identifiable { // The maximum number of groups allowed at this level. private long maxGroups = -1; - // The precsicion used for estimation. This is number of groups returned up when using orderby that need more info to get it correct. + // The precision used for estimation. This is number of groups returned up when using orderby that need more info to get it correct. private long precision = -1; // The classifier expression; the result of this is the group key. @@ -24,30 +24,17 @@ public class GroupingLevel extends Identifiable { // The prototype of the groups to create for each class. private Group collect = new Group(); - /** - * <p>Returns the presicion (i.e number of groups) returned up from this level.</p> - * - * @return The precision. - */ + /** Returns the precision (i.e number of groups) returned up from this level. */ public long getPrecision() { return precision; } - /** - * <p>Returns the maximum number of groups allowed at this level.</p> - * - * @return The maximum number. - */ + /** Returns the maximum number of groups allowed at this level. */ public long getMaxGroups() { return maxGroups; } - /** - * <p>Sets the maximum number of groups allowed at this level.</p> - * - * @param max The maximum number to set. - * @return This, to allow chaining. - */ + /** Sets the maximum number of groups allowed at this level. */ public GroupingLevel setMaxGroups(long max) { maxGroups = max; if (precision < maxGroups) { @@ -57,31 +44,22 @@ public class GroupingLevel extends Identifiable { } /** - * <p>Sets the presicion (i.e number of groups) returned up from this level.</p> + * Sets the precision (i.e number of groups) returned up from this level. * - * @param precision The precision to set. - * @return This, to allow chaining. + * @param precision the precision to set + * @return this, to allow chaining */ public GroupingLevel setPrecision(long precision) { this.precision = precision; return this; } - /** - * <p>Returns the expression used to classify hits into groups.</p> - * - * @return The classifier expression. - */ + /** Returns the expression used to classify hits into groups. */ public ExpressionNode getExpression() { return classify; } - /** - * <p>Sets the expression used to classify hits into groups.</p> - * - * @param exp The classifier expression to set. - * @return This, to allow chaining. - */ + /** Sets the expression used to classify hits into groups. */ public GroupingLevel setExpression(ExpressionNode exp) { classify = exp; return this; 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 b3c861cc140..ea39dde92e1 100644 --- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java +++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/HitsAggregationResult.java @@ -23,7 +23,7 @@ public class HitsAggregationResult extends AggregationResult { public static final int classId = registerClass(0x4000 + 87, HitsAggregationResult.class); private String summaryClass = "default"; private int maxHits = -1; - private List<Hit> hits = new ArrayList<Hit>(); + private List<Hit> hits = new ArrayList<>(); /** * Constructs an empty result node. diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/RawData.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/RawData.java index 8c830fa4f25..7a343da0165 100755 --- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/RawData.java +++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/RawData.java @@ -7,8 +7,8 @@ import com.yahoo.vespa.objects.Serializer; import java.util.Arrays; /** - * <p>This class encapsulates a byte array into a cloneable and comparable object. It also implements a sane {@link - * #hashCode()} and {@link #toString()}.</p> + * A byte array a a cloneable and comparable object. It also implements a sane {@link + * #hashCode()} and {@link #toString()}. * * @author Simon Thoresen Hult */ @@ -16,26 +16,24 @@ public class RawData implements Cloneable, Comparable<RawData> { private byte[] data; - /** - * <p>Constructs an empty data object.</p> - */ + /** Constructs an empty data object. */ public RawData() { data = new byte[0]; } /** - * <p>Constructs a raw data object that holds the given byte array.</p> + * Constructs a raw data object that holds the given byte array. * - * @param data The rank to set. + * @param data the rank to set */ public RawData(byte[] data) { setData(data); } /** - * <p>Serializes the content of this data into the given byte buffer.</p> + * Serializes the content of this data into the given byte buffer. * - * @param buf The buffer to serialize to. + * @param buf the buffer to serialize to */ public void serialize(Serializer buf) { buf.putInt(null, data.length); @@ -43,9 +41,9 @@ public class RawData implements Cloneable, Comparable<RawData> { } /** - * <p>Deserializes the content for this data from the given byte buffer.</p> + * Deserializes the content for this data from the given byte buffer. * - * @param buf The buffer to deserialize from. + * @param buf the buffer to deserialize from */ public void deserialize(Deserializer buf) { int len = buf.getInt(null); @@ -53,20 +51,20 @@ public class RawData implements Cloneable, Comparable<RawData> { } /** - * <p>Returns the byte array that constitutes this data.</p> + * Returns the byte array that constitutes this data. * - * @return The byte array. + * @return the byte array */ public byte[] getData() { return data; } /** - * <p>Sets the byte array that constitutes this data. This does <b>not</b> copy the given array, it simply assigns - * it to this.</p> + * Sets the byte array that constitutes this data. This does <b>not</b> copy the given array, it simply assigns + * it to this. * - * @param data The data to set. - * @return This, to allow chaining. + * @param data the data to set + * @return this, to allow chaining */ public RawData setData(byte[] data) { if (data == null) { @@ -109,11 +107,11 @@ public class RawData implements Cloneable, Comparable<RawData> { } /** - * <p>Implements comparison of two byte arrays.</p> + * Implements comparison of two byte arrays. * - * @param lhs The left-hand-side of the comparison. - * @param rhs The right-hand-side of the comparison. - * @return The result of comparing the two byte arrays. + * @param lhs the left-hand-side of the comparison + * @param rhs the right-hand-side of the comparison + * @return the result of comparing the two byte arrays */ public static int compare(byte[] lhs, byte[] rhs) { int cmp = 0; @@ -127,4 +125,5 @@ public class RawData implements Cloneable, Comparable<RawData> { } return cmp; } + } diff --git a/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/BooleanValue.java b/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/BooleanValue.java index 07710797ee2..770be98c739 100644 --- a/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/BooleanValue.java +++ b/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/BooleanValue.java @@ -6,11 +6,10 @@ package com.yahoo.searchlib.rankingexpression.evaluation; * In numerical context true is interpreted as 1 and false as 0. * * @author bratseth - * @since 5.1.21 */ public class BooleanValue extends DoubleCompatibleValue { - private boolean value; + private final boolean value; /** * Create a boolean value which is frozen at the outset. |