diff options
author | Arne Juul <arnej@yahooinc.com> | 2023-02-02 15:02:17 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahooinc.com> | 2023-02-02 15:02:17 +0000 |
commit | a57d9c0a3149cbeb8680065ee143e605f5af0744 (patch) | |
tree | 485a2fb54450c9e8c19fa04ec4a34177fb096504 | |
parent | 3cfb3337ba83d4cf69df70dd219c2268a95f852d (diff) |
container-phase -> global-phase
3 files changed, 28 insertions, 28 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/parser/ParsedRankProfile.java b/config-model/src/main/java/com/yahoo/schema/parser/ParsedRankProfile.java index 2de7fab09f4..2809ee0c633 100644 --- a/config-model/src/main/java/com/yahoo/schema/parser/ParsedRankProfile.java +++ b/config-model/src/main/java/com/yahoo/schema/parser/ParsedRankProfile.java @@ -53,8 +53,8 @@ class ParsedRankProfile extends ParsedBlock { private final Map<Reference, RankProfile.Constant> constants = new LinkedHashMap<>(); private final Map<Reference, RankProfile.Input> inputs = new LinkedHashMap<>(); private final List<OnnxModel> onnxModels = new ArrayList<>(); - private Integer containerPhaseRerankCount = null; - private String containerPhaseExpression = null; + private Integer globalPhaseRerankCount = null; + private String globalPhaseExpression = null; ParsedRankProfile(String name) { super(name, "rank-profile"); @@ -79,8 +79,8 @@ class ParsedRankProfile extends ParsedBlock { List<ParsedRankFunction> getFunctions() { return List.copyOf(functions.values()); } List<MutateOperation> getMutateOperations() { return List.copyOf(mutateOperations); } List<String> getInherited() { return List.copyOf(inherited); } - Optional<Integer> getContainerPhaseRerankCount() { return Optional.ofNullable(this.containerPhaseRerankCount); } - Optional<String> getContainerPhaseExpression() { return Optional.ofNullable(this.containerPhaseExpression); } + Optional<Integer> getGlobalPhaseRerankCount() { return Optional.ofNullable(this.globalPhaseRerankCount); } + Optional<String> getGlobalPhaseExpression() { return Optional.ofNullable(this.globalPhaseExpression); } Map<String, Boolean> getFieldsWithRankFilter() { return Collections.unmodifiableMap(fieldsRankFilter); } Map<String, Integer> getFieldsWithRankWeight() { return Collections.unmodifiableMap(fieldsRankWeight); } @@ -201,14 +201,14 @@ class ParsedRankProfile extends ParsedBlock { this.secondPhaseExpression = expression; } - void setContainerPhaseExpression(String expression) { - verifyThat(containerPhaseExpression == null, "already has container-phase expression"); - this.containerPhaseExpression = expression; + void setGlobalPhaseExpression(String expression) { + verifyThat(globalPhaseExpression == null, "already has global-phase expression"); + this.globalPhaseExpression = expression; } - void setContainerPhaseRerankCount(int count) { - verifyThat(containerPhaseRerankCount == null, "already has container-phase rerank-count"); - this.containerPhaseRerankCount = count; + void setGlobalPhaseRerankCount(int count) { + verifyThat(globalPhaseRerankCount == null, "already has global-phase rerank-count"); + this.globalPhaseRerankCount = count; } void setStrict(boolean strict) { diff --git a/config-model/src/main/javacc/SchemaParser.jj b/config-model/src/main/javacc/SchemaParser.jj index 888e5ffb665..fa9d34139ea 100644 --- a/config-model/src/main/javacc/SchemaParser.jj +++ b/config-model/src/main/javacc/SchemaParser.jj @@ -279,7 +279,7 @@ TOKEN : | < MAXHITS: "max-hits" > | < FIRSTPHASE: "first-phase" > | < SECONDPHASE: "second-phase" > -| < CONTAINERPHASE: "container-phase" > +| < GLOBALPHASE: "global-phase" > | < MACRO: "macro" > | < INLINE: "inline" > | < ARITY: "arity" > @@ -1707,7 +1707,7 @@ void rankProfileItem(ParsedSchema schema, ParsedRankProfile profile) : { } | rankFeatures(profile) | rankProperties(profile) | secondPhase(profile) - | containerPhase(profile) + | globalPhase(profile) | inputs(profile) | constants(schema, profile) | matchFeatures(profile) @@ -1926,28 +1926,28 @@ void secondPhaseItem(ParsedRankProfile profile) : } /** - * Consumes the container-phase block of a rank profile. + * Consumes the global-phase block of a rank profile. * * @param profile The rank profile to modify. */ -void containerPhase(ParsedRankProfile profile) : { } +void globalPhase(ParsedRankProfile profile) : { } { - <CONTAINERPHASE> lbrace() (containerPhaseItem(profile) (<NL>)*)* <RBRACE> + <GLOBALPHASE> lbrace() (globalPhaseItem(profile) (<NL>)*)* <RBRACE> } /** - * Consumes a statement for a container-phase block. + * Consumes a statement for a global-phase block. * * @param profile The rank profile to modify. */ -void containerPhaseItem(ParsedRankProfile profile) : +void globalPhaseItem(ParsedRankProfile profile) : { String expression; int rerankCount; } { - ( expression = expression() { profile.setContainerPhaseExpression(expression); } - | (<RERANKCOUNT> <COLON> rerankCount = integer()) { profile.setContainerPhaseRerankCount(rerankCount); } + ( expression = expression() { profile.setGlobalPhaseExpression(expression); } + | (<RERANKCOUNT> <COLON> rerankCount = integer()) { profile.setGlobalPhaseRerankCount(rerankCount); } ) } @@ -2585,7 +2585,7 @@ String identifier() : { } | <CONSTANT> | <CONSTANTS> | <CONTEXT> - | <CONTAINERPHASE> + | <GLOBALPHASE> | <CREATEIFNONEXISTENT> | <DENSEPOSTINGLISTTHRESHOLD> | <DESCENDING> diff --git a/config-model/src/test/java/com/yahoo/schema/parser/SchemaParserTestCase.java b/config-model/src/test/java/com/yahoo/schema/parser/SchemaParserTestCase.java index d08c2266370..e69f26a31c9 100644 --- a/config-model/src/test/java/com/yahoo/schema/parser/SchemaParserTestCase.java +++ b/config-model/src/test/java/com/yahoo/schema/parser/SchemaParserTestCase.java @@ -84,7 +84,7 @@ public class SchemaParserTestCase { } @Test - void container_phase_can_be_parsed() throws Exception { + void global_phase_can_be_parsed() throws Exception { String input = """ schema foo { rank-profile normal { @@ -95,7 +95,7 @@ public class SchemaParserTestCase { } } rank-profile bar { - container-phase { + global-phase { expression: onnx(mymodel) rerank-count: 79 } @@ -108,16 +108,16 @@ public class SchemaParserTestCase { assertEquals(2, rplist.size()); var rp0 = rplist.get(0); assertEquals("normal", rp0.name()); - assertFalse(rp0.getContainerPhaseRerankCount().isPresent()); - assertFalse(rp0.getContainerPhaseExpression().isPresent()); + assertFalse(rp0.getGlobalPhaseRerankCount().isPresent()); + assertFalse(rp0.getGlobalPhaseExpression().isPresent()); assertTrue(rp0.getFirstPhaseExpression().isPresent()); assertEquals("rankingExpression(1.0)", rp0.getFirstPhaseExpression().get()); var rp1 = rplist.get(1); assertEquals("bar", rp1.name()); - assertTrue(rp1.getContainerPhaseRerankCount().isPresent()); - assertTrue(rp1.getContainerPhaseExpression().isPresent()); - assertEquals(79, rp1.getContainerPhaseRerankCount().get()); - assertEquals("onnx(mymodel)", rp1.getContainerPhaseExpression().get()); + assertTrue(rp1.getGlobalPhaseRerankCount().isPresent()); + assertTrue(rp1.getGlobalPhaseExpression().isPresent()); + assertEquals(79, rp1.getGlobalPhaseRerankCount().get()); + assertEquals("onnx(mymodel)", rp1.getGlobalPhaseExpression().get()); } void checkFileParses(String fileName) throws Exception { |