diff options
Diffstat (limited to 'config-model/src/main/java/com/yahoo/searchdefinition/RankingConstant.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/searchdefinition/RankingConstant.java | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/config-model/src/main/java/com/yahoo/searchdefinition/RankingConstant.java b/config-model/src/main/java/com/yahoo/searchdefinition/RankingConstant.java deleted file mode 100644 index 7a2765de852..00000000000 --- a/config-model/src/main/java/com/yahoo/searchdefinition/RankingConstant.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.searchdefinition; - -import com.yahoo.tensor.TensorType; - -/** - * A global ranking constant distributed using file distribution. - * Ranking constants must be sent to some services to be useful - this is done - * by calling the sentTo method during the prepare phase of building models. - * - * @author arnej - * @author bratseth - */ -public class RankingConstant extends DistributableResource { - - private TensorType tensorType = null; - - public RankingConstant(String name) { - super(name); - } - - public RankingConstant(String name, TensorType type, String fileName) { - this(name, type, fileName, PathType.FILE); - } - public RankingConstant(String name, TensorType type, String fileName, PathType pathType) { - super(name, fileName, pathType); - this.tensorType = type; - validate(); - } - - public void setType(TensorType type) { - this.tensorType = type; - } - - public TensorType getTensorType() { return tensorType; } - public String getType() { return tensorType.toString(); } - - public void validate() { - super.validate(); - if (tensorType == null) - throw new IllegalArgumentException("Ranking constant '" + getName() + "' must have a type."); - if (tensorType.dimensions().stream().anyMatch(d -> d.isIndexed() && d.size().isEmpty())) - throw new IllegalArgumentException("Illegal type in field " + getName() + " type " + tensorType + - ": Dense tensor dimensions must have a size"); - } - - @Override - public String toString() { - return super.toString() + "' of type '" + tensorType + "'"; - } - -} |