aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/test/java/com/yahoo
diff options
context:
space:
mode:
authorGeir Storli <geirst@yahooinc.com>2022-08-24 15:17:08 +0000
committerGeir Storli <geirst@yahooinc.com>2022-08-24 15:17:08 +0000
commitd546929a5e4dabaac53717d45dd2bb5c818429a4 (patch)
tree125dc5075f93399b6b46560834d6b7c9745d4095 /config-model/src/test/java/com/yahoo
parent26d0b997cc573bac2a1d7eda7a2494449452e121 (diff)
Add 'paged' support for reference attribute fields.
The memory usage of a reference attribute can be calculated as follows: num_child_docs * 8 + num_parent_docs * 24 + num_child_docs_where_parent_reference_is_set * 4. When using 'paged' the btrees used in the reverse mapping from parent lid to child lids are still memory allocated. This is the num_child_docs_where_parent_reference_is_set part of the equation above.
Diffstat (limited to 'config-model/src/test/java/com/yahoo')
-rw-r--r--config-model/src/test/java/com/yahoo/schema/processing/PagedAttributeValidatorTestCase.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/config-model/src/test/java/com/yahoo/schema/processing/PagedAttributeValidatorTestCase.java b/config-model/src/test/java/com/yahoo/schema/processing/PagedAttributeValidatorTestCase.java
index 2a3a3ff93e9..719db2ffdcc 100644
--- a/config-model/src/test/java/com/yahoo/schema/processing/PagedAttributeValidatorTestCase.java
+++ b/config-model/src/test/java/com/yahoo/schema/processing/PagedAttributeValidatorTestCase.java
@@ -59,8 +59,14 @@ public class PagedAttributeValidatorTestCase {
}
private void assertPagedSupported(String fieldType) throws ParseException {
- var appBuilder = createFromString(getSd(fieldType));
- var attribute = appBuilder.getSchema().getAttribute("foo");
+ assertPagedSupported(fieldType, Optional.empty());
+ }
+
+ private void assertPagedSupported(String fieldType, Optional<String> parentSd) throws ParseException {
+ var appBuilder = parentSd.isPresent() ?
+ createFromStrings(new BaseDeployLogger(), parentSd.get(), getSd(fieldType)) :
+ createFromString(getSd(fieldType));
+ var attribute = appBuilder.getSchema("test").getAttribute("foo");
assertTrue(attribute.isPaged());
}
@@ -75,8 +81,8 @@ public class PagedAttributeValidatorTestCase {
}
@Test
- void reference_attribute_does_not_support_paged_setting() throws ParseException {
- assertPagedSettingNotSupported("reference<parent>", Optional.of(getSd("parent", "int")));
+ void reference_attribute_support_paged_setting() throws ParseException {
+ assertPagedSupported("reference<parent>", Optional.of(getSd("parent", "int")));
}
private void assertPagedSettingNotSupported(String fieldType) throws ParseException {