summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/js/app/index.html8
-rw-r--r--client/js/app/package.json1
-rw-r--r--client/js/app/src/app/app.jsx16
-rw-r--r--client/js/app/src/app/assets/favicon.svg15
-rw-r--r--client/js/app/src/app/assets/img/favicon.svg33
-rw-r--r--client/js/app/src/app/assets/img/vespa-icon.svg33
-rw-r--r--client/js/app/src/app/assets/img/vespa-logo.svg235
-rw-r--r--client/js/app/src/app/assets/index.js2
-rw-r--r--client/js/app/src/app/assets/logo.svg7
-rw-r--r--client/js/app/src/app/components/App.jsx45
-rw-r--r--client/js/app/src/app/components/index.js2
-rw-r--r--client/js/app/src/app/components/layout/error.jsx25
-rw-r--r--client/js/app/src/app/components/layout/header-logo.jsx7
-rw-r--r--client/js/app/src/app/components/layout/header.jsx11
-rw-r--r--client/js/app/src/app/components/layout/layout.jsx11
-rw-r--r--client/js/app/src/app/libs/app-router.jsx42
-rw-r--r--client/js/app/src/app/main.jsx (renamed from client/js/app/src/app/pages/main.jsx)3
-rw-r--r--client/js/app/src/app/pages/home/home.jsx5
-rw-r--r--client/js/app/src/app/pages/querybuilder/query-builder.jsx5
-rw-r--r--client/js/app/src/app/styles/App.css42
-rw-r--r--client/js/app/src/app/styles/index.css13
-rw-r--r--client/js/app/yarn.lock43
-rw-r--r--container-dependencies-enforcer/pom.xml9
-rw-r--r--container-dev/pom.xml17
-rw-r--r--container-spifly/src/main/javadoc/README1
-rw-r--r--container-test/pom.xml22
-rw-r--r--container/pom.xml4
-rw-r--r--document/src/tests/serialization/vespadocumentserializer_test.cpp2
-rw-r--r--document/src/vespa/document/base/field.h2
-rw-r--r--jdisc-security-filters/pom.xml6
-rwxr-xr-xscrewdriver/release-java-artifacts.sh4
-rwxr-xr-xscrewdriver/release-rpms.sh6
-rw-r--r--searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp2
-rw-r--r--searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp4
-rw-r--r--searchcore/src/tests/proton/matching/match_loop_communicator/match_loop_communicator_test.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/matcher.cpp6
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/partial_result.cpp12
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp10
-rw-r--r--searchlib/src/tests/attribute/attribute_test.cpp18
-rw-r--r--searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp2
-rw-r--r--searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp7
-rw-r--r--searchlib/src/tests/attribute/posting_store/posting_store_test.cpp4
-rw-r--r--searchlib/src/tests/attribute/postinglist/postinglist.cpp8
-rw-r--r--searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp10
-rw-r--r--searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp3
-rw-r--r--searchlib/src/vespa/searchlib/attribute/attribute_operation.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/loadedenumvalue.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/loadednumericvalue.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/attribute/multinumericattribute.h2
-rw-r--r--searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp40
-rw-r--r--searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/bitcompression/compression.h47
-rw-r--r--searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp10
-rw-r--r--searchlib/src/vespa/searchlib/common/geo_location.cpp10
-rw-r--r--searchlib/src/vespa/searchlib/common/geo_location_parser.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/common/resultset.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/common/resultset.h2
-rw-r--r--searchlib/src/vespa/searchlib/common/sortresults.cpp14
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/docidmapper.h4
-rw-r--r--searchlib/src/vespa/searchlib/engine/proto_converter.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/queryeval/hitcollector.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/tensor/streamed_value_store.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/test/imported_attribute_fixture.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/util/comprfile.cpp13
-rw-r--r--searchlib/src/vespa/searchlib/util/comprfile.h2
-rw-r--r--vdslib/src/tests/distribution/distributiontest.cpp2
-rw-r--r--vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/DefaultZmsClient.java8
-rw-r--r--vespajlib/src/main/java/com/yahoo/config/ini/Ini.java172
-rw-r--r--vespajlib/src/test/java/com/yahoo/config/ini/IniTest.java101
-rw-r--r--vespalib/src/vespa/vespalib/stllike/asciistream.cpp22
-rw-r--r--vespalib/src/vespa/vespalib/util/shared_string_repo.h5
71 files changed, 939 insertions, 311 deletions
diff --git a/client/js/app/index.html b/client/js/app/index.html
index f6304d618e5..d245c706374 100644
--- a/client/js/app/index.html
+++ b/client/js/app/index.html
@@ -2,12 +2,16 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
- <link rel="icon" type="image/svg+xml" href="/src/app/assets/favicon.svg" />
+ <link
+ rel="icon"
+ type="image/svg+xml"
+ href="/src/app/assets/img/favicon.svg"
+ />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="root"></div>
- <script type="module" src="/src/app/pages/main.jsx"></script>
+ <script type="module" src="/src/app/main.jsx"></script>
</body>
</html>
diff --git a/client/js/app/package.json b/client/js/app/package.json
index 74a0347da1c..5459608197c 100644
--- a/client/js/app/package.json
+++ b/client/js/app/package.json
@@ -16,6 +16,7 @@
"devDependencies": {
"@mantine/core": "^4",
"@mantine/hooks": "^4",
+ "@reach/router": "^1",
"@types/react": "^18",
"@types/react-dom": "^18",
"@vitejs/plugin-react": "^1",
diff --git a/client/js/app/src/app/app.jsx b/client/js/app/src/app/app.jsx
new file mode 100644
index 00000000000..57eba3ea95d
--- /dev/null
+++ b/client/js/app/src/app/app.jsx
@@ -0,0 +1,16 @@
+import React from 'react';
+import { Layout } from 'app/components';
+import { AppRouter } from 'app/libs/app-router';
+import { Home } from 'app/pages/home/home';
+import { QueryBuilder } from 'app/pages/querybuilder/query-builder';
+
+export function App() {
+ return (
+ <Layout>
+ <AppRouter>
+ <Home path="/" />
+ <QueryBuilder path="querybuilder" />
+ </AppRouter>
+ </Layout>
+ );
+}
diff --git a/client/js/app/src/app/assets/favicon.svg b/client/js/app/src/app/assets/favicon.svg
deleted file mode 100644
index de4aeddc12b..00000000000
--- a/client/js/app/src/app/assets/favicon.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-<svg width="410" height="404" viewBox="0 0 410 404" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M399.641 59.5246L215.643 388.545C211.844 395.338 202.084 395.378 198.228 388.618L10.5817 59.5563C6.38087 52.1896 12.6802 43.2665 21.0281 44.7586L205.223 77.6824C206.398 77.8924 207.601 77.8904 208.776 77.6763L389.119 44.8058C397.439 43.2894 403.768 52.1434 399.641 59.5246Z" fill="url(#paint0_linear)"/>
-<path d="M292.965 1.5744L156.801 28.2552C154.563 28.6937 152.906 30.5903 152.771 32.8664L144.395 174.33C144.198 177.662 147.258 180.248 150.51 179.498L188.42 170.749C191.967 169.931 195.172 173.055 194.443 176.622L183.18 231.775C182.422 235.487 185.907 238.661 189.532 237.56L212.947 230.446C216.577 229.344 220.065 232.527 219.297 236.242L201.398 322.875C200.278 328.294 207.486 331.249 210.492 326.603L212.5 323.5L323.454 102.072C325.312 98.3645 322.108 94.137 318.036 94.9228L279.014 102.454C275.347 103.161 272.227 99.746 273.262 96.1583L298.731 7.86689C299.767 4.27314 296.636 0.855181 292.965 1.5744Z" fill="url(#paint1_linear)"/>
-<defs>
-<linearGradient id="paint0_linear" x1="6.00017" y1="32.9999" x2="235" y2="344" gradientUnits="userSpaceOnUse">
-<stop stop-color="#41D1FF"/>
-<stop offset="1" stop-color="#BD34FE"/>
-</linearGradient>
-<linearGradient id="paint1_linear" x1="194.651" y1="8.81818" x2="236.076" y2="292.989" gradientUnits="userSpaceOnUse">
-<stop stop-color="#FFEA83"/>
-<stop offset="0.0833333" stop-color="#FFDD35"/>
-<stop offset="1" stop-color="#FFA800"/>
-</linearGradient>
-</defs>
-</svg>
diff --git a/client/js/app/src/app/assets/img/favicon.svg b/client/js/app/src/app/assets/img/favicon.svg
new file mode 100644
index 00000000000..f5c574a20c5
--- /dev/null
+++ b/client/js/app/src/app/assets/img/favicon.svg
@@ -0,0 +1,33 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 150 150">
+ <defs>
+ <style>
+ .cls-1 {
+ fill: #ff9d4b;
+ }
+ .cls-2 {
+ fill: url(#linear-gradient);
+ }
+ .cls-3 {
+ fill: #1a7db6;
+ }
+ .cls-4 {
+ fill: url(#linear-gradient-2);
+ }
+ </style>
+ <linearGradient id="linear-gradient" x1="-2012.74" y1="44.83" x2="-2057.81" y2="73.4"
+ gradientTransform="matrix(-1, 0, 0, 1, -1921.57, 0)" gradientUnits="userSpaceOnUse">
+ <stop offset="0.01" stop-color="#c6783e" />
+ <stop offset="0.54" stop-color="#ff9750" />
+ </linearGradient>
+ <linearGradient id="linear-gradient-2" x1="60.71" y1="104.56" x2="-15.54" y2="63" gradientUnits="userSpaceOnUse">
+ <stop offset="0" stop-color="#005a8e" />
+ <stop offset="0.54" stop-color="#1a7db6" />
+ </linearGradient>
+ </defs>
+ <polygon class="cls-1" points="84.84 10 34.1 44.46 34.1 103.78 84.84 68.02 135.57 103.78 135.57 44.46 84.84 10" />
+ <polygon class="cls-2" points="84.84 68.02 84.84 10 135.57 44.46 135.57 103.78 84.84 68.02" />
+ <polygon class="cls-3"
+ points="65.07 81.99 14.34 46.22 14.34 105.54 65.07 140 115.81 105.54 115.81 46.22 65.07 81.99" />
+ <polygon class="cls-4" points="65.07 81.99 65.07 140 14.34 105.54 14.34 46.22 65.07 81.99" />
+</svg>
diff --git a/client/js/app/src/app/assets/img/vespa-icon.svg b/client/js/app/src/app/assets/img/vespa-icon.svg
new file mode 100644
index 00000000000..f5c574a20c5
--- /dev/null
+++ b/client/js/app/src/app/assets/img/vespa-icon.svg
@@ -0,0 +1,33 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 150 150">
+ <defs>
+ <style>
+ .cls-1 {
+ fill: #ff9d4b;
+ }
+ .cls-2 {
+ fill: url(#linear-gradient);
+ }
+ .cls-3 {
+ fill: #1a7db6;
+ }
+ .cls-4 {
+ fill: url(#linear-gradient-2);
+ }
+ </style>
+ <linearGradient id="linear-gradient" x1="-2012.74" y1="44.83" x2="-2057.81" y2="73.4"
+ gradientTransform="matrix(-1, 0, 0, 1, -1921.57, 0)" gradientUnits="userSpaceOnUse">
+ <stop offset="0.01" stop-color="#c6783e" />
+ <stop offset="0.54" stop-color="#ff9750" />
+ </linearGradient>
+ <linearGradient id="linear-gradient-2" x1="60.71" y1="104.56" x2="-15.54" y2="63" gradientUnits="userSpaceOnUse">
+ <stop offset="0" stop-color="#005a8e" />
+ <stop offset="0.54" stop-color="#1a7db6" />
+ </linearGradient>
+ </defs>
+ <polygon class="cls-1" points="84.84 10 34.1 44.46 34.1 103.78 84.84 68.02 135.57 103.78 135.57 44.46 84.84 10" />
+ <polygon class="cls-2" points="84.84 68.02 84.84 10 135.57 44.46 135.57 103.78 84.84 68.02" />
+ <polygon class="cls-3"
+ points="65.07 81.99 14.34 46.22 14.34 105.54 65.07 140 115.81 105.54 115.81 46.22 65.07 81.99" />
+ <polygon class="cls-4" points="65.07 81.99 65.07 140 14.34 105.54 14.34 46.22 65.07 81.99" />
+</svg>
diff --git a/client/js/app/src/app/assets/img/vespa-logo.svg b/client/js/app/src/app/assets/img/vespa-logo.svg
new file mode 100644
index 00000000000..239a2a0fc13
--- /dev/null
+++ b/client/js/app/src/app/assets/img/vespa-logo.svg
@@ -0,0 +1,235 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 426.73 157">
+ <defs>
+ <style>
+ .cls-1 {
+ fill: none;
+ clip-rule: evenodd;
+ }
+ .cls-2 {
+ clip-path: url(#clip-path);
+ }
+ .cls-3 {
+ clip-path: url(#clip-path-2);
+ }
+ .cls-4 {
+ clip-path: url(#clip-path-3);
+ }
+ .cls-5 {
+ clip-path: url(#clip-path-4);
+ }
+ .cls-6 {
+ clip-path: url(#clip-path-5);
+ }
+ .cls-7 {
+ clip-path: url(#clip-path-6);
+ }
+ .cls-8 {
+ clip-path: url(#clip-path-7);
+ }
+ .cls-9 {
+ clip-path: url(#clip-path-8);
+ }
+ .cls-10 {
+ clip-path: url(#clip-path-9);
+ }
+ .cls-11 {
+ clip-path: url(#clip-path-10);
+ }
+ .cls-12 {
+ clip-path: url(#clip-path-11);
+ }
+ .cls-13 {
+ clip-path: url(#clip-path-12);
+ }
+ .cls-14 {
+ clip-path: url(#clip-path-13);
+ }
+ .cls-15 {
+ clip-path: url(#clip-path-14);
+ }
+ .cls-16 {
+ clip-path: url(#clip-path-15);
+ }
+ .cls-17 {
+ clip-path: url(#clip-path-16);
+ }
+ .cls-18 {
+ clip-path: url(#clip-path-17);
+ }
+ .cls-19 {
+ clip-path: url(#clip-path-18);
+ }
+ .cls-20 {
+ clip-path: url(#clip-path-19);
+ }
+ .cls-21 {
+ clip-path: url(#clip-path-20);
+ }
+ .cls-22 {
+ clip-path: url(#clip-path-21);
+ }
+ .cls-23 {
+ clip-path: url(#clip-path-22);
+ }
+ .cls-24 {
+ clip-path: url(#clip-path-23);
+ }
+ .cls-25 {
+ clip-path: url(#clip-path-24);
+ }
+ .cls-26 {
+ clip-path: url(#clip-path-25);
+ }
+ .cls-27 {
+ fill: #ff9d4b;
+ }
+ .cls-28 {
+ fill: url(#linear-gradient);
+ }
+ .cls-29 {
+ fill: #1a7db6;
+ }
+ .cls-30 {
+ fill: url(#linear-gradient-2);
+ }
+ .cls-31 {
+ fill: #fff;
+ }
+ </style>
+ <clipPath id="clip-path">
+ <polygon class="cls-1"
+ points="-126.52 -1487.49 133.48 -1388.16 133.48 -1648.82 -126.52 -1748.16 -126.52 -1487.49" />
+ </clipPath>
+ <clipPath id="clip-path-2">
+ <path class="cls-1"
+ d="M-1.82-1672.51a6.31,6.31,0,0,1-6.3-6.32,6.31,6.31,0,0,1,6.3-6.33,6.31,6.31,0,0,1,6.3,6.33,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-3">
+ <path class="cls-1"
+ d="M-1.82-1616a6.31,6.31,0,0,1-6.3-6.33,6.3,6.3,0,0,1,6.3-6.31,6.3,6.3,0,0,1,6.3,6.31,6.31,6.31,0,0,1-6.3,6.33" />
+ </clipPath>
+ <clipPath id="clip-path-4">
+ <path class="cls-1"
+ d="M-1.82-1559.57a6.31,6.31,0,0,1-6.3-6.32,6.3,6.3,0,0,1,6.3-6.32,6.3,6.3,0,0,1,6.3,6.32,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-5">
+ <path class="cls-1"
+ d="M-1.82-1504.78a6.32,6.32,0,0,1-6.3-6.33,6.31,6.31,0,0,1,6.3-6.32,6.31,6.31,0,0,1,6.3,6.32,6.32,6.32,0,0,1-6.3,6.33" />
+ </clipPath>
+ <clipPath id="clip-path-6">
+ <path class="cls-1"
+ d="M-1.82-1446.63a6.31,6.31,0,0,1-6.3-6.32,6.31,6.31,0,0,1,6.3-6.32,6.31,6.31,0,0,1,6.3,6.32,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-7">
+ <path class="cls-1"
+ d="M-1.82-1390.16a6.31,6.31,0,0,1-6.3-6.32,6.31,6.31,0,0,1,6.3-6.32,6.31,6.31,0,0,1,6.3,6.32,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-8">
+ <path class="cls-1"
+ d="M-55.58-1672.51a6.31,6.31,0,0,1-6.3-6.32,6.31,6.31,0,0,1,6.3-6.33,6.31,6.31,0,0,1,6.3,6.33,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-9">
+ <path class="cls-1"
+ d="M-55.58-1616a6.31,6.31,0,0,1-6.3-6.33,6.3,6.3,0,0,1,6.3-6.31,6.3,6.3,0,0,1,6.3,6.31,6.31,6.31,0,0,1-6.3,6.33" />
+ </clipPath>
+ <clipPath id="clip-path-10">
+ <path class="cls-1"
+ d="M-55.58-1559.57a6.31,6.31,0,0,1-6.3-6.32,6.3,6.3,0,0,1,6.3-6.32,6.3,6.3,0,0,1,6.3,6.32,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-11">
+ <path class="cls-1"
+ d="M-55.58-1504.78a6.32,6.32,0,0,1-6.3-6.33,6.31,6.31,0,0,1,6.3-6.32,6.31,6.31,0,0,1,6.3,6.32,6.32,6.32,0,0,1-6.3,6.33" />
+ </clipPath>
+ <clipPath id="clip-path-12">
+ <path class="cls-1"
+ d="M-55.58-1446.63a6.31,6.31,0,0,1-6.3-6.32,6.31,6.31,0,0,1,6.3-6.32,6.31,6.31,0,0,1,6.3,6.32,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-13">
+ <path class="cls-1"
+ d="M-55.58-1390.16a6.31,6.31,0,0,1-6.3-6.32,6.31,6.31,0,0,1,6.3-6.32,6.31,6.31,0,0,1,6.3,6.32,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-14">
+ <path class="cls-1"
+ d="M-106-1672.51a6.31,6.31,0,0,1-6.3-6.32,6.31,6.31,0,0,1,6.3-6.33,6.31,6.31,0,0,1,6.3,6.33,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-15">
+ <path class="cls-1"
+ d="M-106-1616a6.31,6.31,0,0,1-6.3-6.33,6.3,6.3,0,0,1,6.3-6.31,6.3,6.3,0,0,1,6.3,6.31A6.31,6.31,0,0,1-106-1616" />
+ </clipPath>
+ <clipPath id="clip-path-16">
+ <path class="cls-1"
+ d="M-106-1559.57a6.31,6.31,0,0,1-6.3-6.32,6.3,6.3,0,0,1,6.3-6.32,6.3,6.3,0,0,1,6.3,6.32,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-17">
+ <path class="cls-1"
+ d="M-106-1504.78a6.32,6.32,0,0,1-6.3-6.33,6.31,6.31,0,0,1,6.3-6.32,6.31,6.31,0,0,1,6.3,6.32,6.32,6.32,0,0,1-6.3,6.33" />
+ </clipPath>
+ <clipPath id="clip-path-18">
+ <path class="cls-1"
+ d="M-106-1446.63a6.31,6.31,0,0,1-6.3-6.32,6.31,6.31,0,0,1,6.3-6.32,6.31,6.31,0,0,1,6.3,6.32,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-19">
+ <path class="cls-1"
+ d="M-106-1390.16a6.31,6.31,0,0,1-6.3-6.32,6.31,6.31,0,0,1,6.3-6.32,6.31,6.31,0,0,1,6.3,6.32,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-20">
+ <path class="cls-1"
+ d="M-157.22-1672.51a6.31,6.31,0,0,1-6.3-6.32,6.31,6.31,0,0,1,6.3-6.33,6.31,6.31,0,0,1,6.3,6.33,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-21">
+ <path class="cls-1"
+ d="M-157.22-1616a6.31,6.31,0,0,1-6.3-6.33,6.3,6.3,0,0,1,6.3-6.31,6.3,6.3,0,0,1,6.3,6.31,6.31,6.31,0,0,1-6.3,6.33" />
+ </clipPath>
+ <clipPath id="clip-path-22">
+ <path class="cls-1"
+ d="M-157.22-1559.57a6.31,6.31,0,0,1-6.3-6.32,6.3,6.3,0,0,1,6.3-6.32,6.3,6.3,0,0,1,6.3,6.32,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-23">
+ <path class="cls-1"
+ d="M-157.22-1504.78a6.32,6.32,0,0,1-6.3-6.33,6.31,6.31,0,0,1,6.3-6.32,6.31,6.31,0,0,1,6.3,6.32,6.32,6.32,0,0,1-6.3,6.33" />
+ </clipPath>
+ <clipPath id="clip-path-24">
+ <path class="cls-1"
+ d="M-157.22-1446.63a6.31,6.31,0,0,1-6.3-6.32,6.31,6.31,0,0,1,6.3-6.32,6.31,6.31,0,0,1,6.3,6.32,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <clipPath id="clip-path-25">
+ <path class="cls-1"
+ d="M-157.22-1390.16a6.31,6.31,0,0,1-6.3-6.32,6.31,6.31,0,0,1,6.3-6.32,6.31,6.31,0,0,1,6.3,6.32,6.31,6.31,0,0,1-6.3,6.32" />
+ </clipPath>
+ <linearGradient id="linear-gradient" x1="838.35" y1="43.03" x2="793.28" y2="71.6"
+ gradientTransform="matrix(-1, 0, 0, 1, 920.21, 0)" gradientUnits="userSpaceOnUse">
+ <stop offset="0.01" stop-color="#c6783e" />
+ <stop offset="0.54" stop-color="#ff9750" />
+ </linearGradient>
+ <linearGradient id="linear-gradient-2" x1="51.41" y1="102.76" x2="-24.85" y2="61.2" gradientUnits="userSpaceOnUse">
+ <stop offset="0" stop-color="#005a8e" />
+ <stop offset="0.54" stop-color="#1a7db6" />
+ </linearGradient>
+ </defs>
+ <polygon class="cls-27"
+ points="75.53 8.2 24.79 42.66 24.79 101.98 75.53 66.22 126.27 101.98 126.27 42.66 75.53 8.2" />
+ <polygon class="cls-28" points="75.53 66.22 75.53 8.2 126.27 42.66 126.27 101.98 75.53 66.22" />
+ <polygon class="cls-29"
+ points="55.77 80.19 5.03 44.42 5.03 103.74 55.77 138.2 106.51 103.74 106.51 44.42 55.77 80.19" />
+ <polygon class="cls-30" points="55.77 80.19 55.77 138.2 5.03 103.74 5.03 44.42 55.77 80.19" />
+ <path class="cls-31"
+ d="M186.09,100.33H171a.91.91,0,0,1-.85-.61L151.62,46.43a.9.9,0,0,1,.85-1.2h7.89a8.49,8.49,0,0,1,8.19,6.22l10,35.82h.3l9.93-35.81A8.5,8.5,0,0,1,197,45.23h7.54a.9.9,0,0,1,.85,1.2L187,99.72A.92.92,0,0,1,186.09,100.33Z" />
+ <path class="cls-31"
+ d="M283.73,44.28c13.18,0,22.09,6.53,22.82,16.49a.91.91,0,0,1-.9,1H293.88A.89.89,0,0,1,293,61c-.65-3.92-4.2-6.36-9.47-6.36s-8.76,2.35-8.76,5.9c0,2.76,2.4,4.61,7.35,5.76l10.36,2.25c11.06,2.5,15.46,6.76,15.46,15,0,10.71-9.85,17.77-24.26,17.77-14.05,0-23-6.56-24.28-16.6a.92.92,0,0,1,.9-1h12.52a.91.91,0,0,1,.88.69c.95,4.22,4.63,6.57,10.38,6.57s9.35-2.25,9.35-5.86c0-2.85-1.9-4.35-6.9-5.55l-10.16-2.3C266,74.86,260.66,69.5,260.66,61.44,260.66,51.09,269.76,44.28,283.73,44.28Z" />
+ <path class="cls-31"
+ d="M367.47,72.75c0,17.52-8.6,28.23-22.41,28.23-8,0-14.11-3.66-17.12-9.91h-.3v18.77a8.49,8.49,0,0,1-8.5,8.5h-5.21a.9.9,0,0,1-.9-.9V46.13a.9.9,0,0,1,.9-.9h12.61a.9.9,0,0,1,.9.9v8.51h.3c2.9-6.21,9.36-10.06,17.12-10.06C358.82,44.58,367.47,55.24,367.47,72.75Zm-15,0c0-9.9-4.95-16.36-12.51-16.36S327.59,63,327.59,72.8s5,16.37,12.41,16.37S352.51,82.76,352.51,72.75Z" />
+ <path class="cls-31"
+ d="M371.86,84.46c0-10,7.66-15.66,21.72-16.51l12.91-.8a.9.9,0,0,0,.85-.9v-2.8c0-5.31-3.65-8.21-9.66-8.21-5,0-8.59,2.5-9.56,6.15a.94.94,0,0,1-.9.66H375.58a.89.89,0,0,1-.9-1c.92-10,10.26-16.8,23.6-16.8,14.16,0,23.42,7.26,23.42,18.27V99.43a.9.9,0,0,1-.9.9h-4.7a8.51,8.51,0,0,1-8.51-8.51h-.3c-3,5.75-9.81,9.16-16.86,9.16C379.82,101,371.86,94.32,371.86,84.46Zm35.48-4.35v-4l-11.56.8c-6.11.4-9.36,2.8-9.36,6.85s3.46,6.61,8.76,6.61C401.93,90.32,407.34,86.11,407.34,80.11Z" />
+ <path class="cls-31"
+ d="M229.48,44.28C213.32,44.28,203,55.49,203,73s10.26,28.27,27,28.27c12.47,0,22-6.16,24.51-15.6a1.71,1.71,0,0,0-1.64-2.17H242.68a1.87,1.87,0,0,0-1.53,1c-1.71,3.67-5.8,5.88-10.87,5.88A12.63,12.63,0,0,1,221,86.7a13.58,13.58,0,0,1-3.54-9.64v-.9h36.33a1.7,1.7,0,0,0,1.7-1.7V71.65C255.45,54.89,245.34,44.28,229.48,44.28ZM217.57,67.1c.51-7.06,5.4-11.91,12.07-11.91s11.45,4.7,11.7,11.91Z" />
+ <path class="cls-31"
+ d="M188.47,127c-.55-2.91-2.64-4.83-6.08-4.83-4.36,0-6.81,3.25-6.81,9.28s2.47,9.42,6.81,9.42c3.3,0,5.47-1.61,6.08-4.64H196c-.67,6.86-5.67,11.28-13.64,11.28-9.56,0-15-5.78-15-16.06s5.39-15.92,15-15.92c8.11,0,13,4.5,13.64,11.47Z" />
+ <path class="cls-31" d="M199.21,104.5h0a8.08,8.08,0,0,1,8.08,8.08v34.26h0a8.08,8.08,0,0,1-8.08-8.08Z" />
+ <path class="cls-31"
+ d="M210.18,131.5c0-9.92,5.75-16,15.09-16s15.09,6,15.09,16-5.67,16-15.09,16S210.18,141.53,210.18,131.5Zm21.87,0c0-5.89-2.5-9.36-6.78-9.36s-6.78,3.47-6.78,9.36,2.44,9.4,6.78,9.4S232.05,137.45,232.05,131.5Z" />
+ <path class="cls-31"
+ d="M271.83,146.84H264v-4.92h-.5c-1.45,3.56-4.31,5.59-8.95,5.59-6.61,0-10.72-4.22-10.72-11.34v-20h8.08v17.9c0,4.22,1.92,6.39,5.64,6.39,4,0,6.2-2.53,6.2-6.61V116.19h8.08Z" />
+ <path class="cls-31"
+ d="M274.62,131.48c0-9.76,4.78-15.79,12.47-15.79,4.14,0,7.56,2,9.15,5.39h.47V104.5h0a8.08,8.08,0,0,1,8.08,8.08v34.26h-3A4.81,4.81,0,0,1,297,142h-.5c-1.64,3.31-5.11,5.28-9.37,5.28C279.37,147.31,274.62,141.26,274.62,131.48Zm8.31,0c0,5.67,2.58,9.06,6.91,9.06s7-3.42,7-9-2.64-9.06-7-9.06S282.93,125.89,282.93,131.5Z" />
+</svg>
diff --git a/client/js/app/src/app/assets/index.js b/client/js/app/src/app/assets/index.js
new file mode 100644
index 00000000000..a62869fa71b
--- /dev/null
+++ b/client/js/app/src/app/assets/index.js
@@ -0,0 +1,2 @@
+export { default as VespaLogo } from 'app/assets/img/vespa-logo.svg';
+export { default as VespaIcon } from 'app/assets/img/vespa-icon.svg';
diff --git a/client/js/app/src/app/assets/logo.svg b/client/js/app/src/app/assets/logo.svg
deleted file mode 100644
index 6b60c1042f5..00000000000
--- a/client/js/app/src/app/assets/logo.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
- <g fill="#61DAFB">
- <path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
- <circle cx="420.9" cy="296.5" r="45.7"/>
- <path d="M520.5 78.1z"/>
- </g>
-</svg>
diff --git a/client/js/app/src/app/components/App.jsx b/client/js/app/src/app/components/App.jsx
deleted file mode 100644
index 074309854b0..00000000000
--- a/client/js/app/src/app/components/App.jsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import React, { useState } from 'react';
-import logo from 'app/assets/logo.svg';
-import 'app/styles/App.css';
-
-function App() {
- const [count, setCount] = useState(0);
-
- return (
- <div className="App">
- <header className="App-header">
- <img src={logo} className="App-logo" alt="logo" />
- <p>Hello Vite + React!</p>
- <p>
- <button type="button" onClick={() => setCount((count) => count + 1)}>
- count is: {count}
- </button>
- </p>
- <p>
- Edit <code>App.jsx</code> and save to test HMR updates.
- </p>
- <p>
- <a
- className="App-link"
- href="https://reactjs.org"
- target="_blank"
- rel="noopener noreferrer"
- >
- Learn React
- </a>
- {' | '}
- <a
- className="App-link"
- href="https://vitejs.dev/guide/features.html"
- target="_blank"
- rel="noopener noreferrer"
- >
- Vite Docs
- </a>
- </p>
- </header>
- </div>
- );
-}
-
-export default App;
diff --git a/client/js/app/src/app/components/index.js b/client/js/app/src/app/components/index.js
new file mode 100644
index 00000000000..488fc1b23fa
--- /dev/null
+++ b/client/js/app/src/app/components/index.js
@@ -0,0 +1,2 @@
+export { Error } from 'app/components/layout/error';
+export { Layout } from 'app/components/layout/layout';
diff --git a/client/js/app/src/app/components/layout/error.jsx b/client/js/app/src/app/components/layout/error.jsx
new file mode 100644
index 00000000000..95bc78df413
--- /dev/null
+++ b/client/js/app/src/app/components/layout/error.jsx
@@ -0,0 +1,25 @@
+import React from 'react';
+import { Center } from '@mantine/core';
+
+// TODO: make a better page
+
+function getMessage(code, location) {
+ const statusCode =
+ parseInt(code || new URLSearchParams(location?.search).get('code')) || 404;
+
+ switch (statusCode) {
+ case 403:
+ return 'Sorry, you are not authorized to view this page.';
+ case 404:
+ return 'Sorry, the page you were looking for does not exist.';
+ case 500:
+ return 'Oops... something went wrong.';
+ default:
+ return 'Unknown error - really, I have no idea what is going on here.';
+ }
+}
+
+export function Error({ code, location }) {
+ const message = getMessage(code, location);
+ return <Center sx={{ minHeight: '89px' }}>{message}</Center>;
+}
diff --git a/client/js/app/src/app/components/layout/header-logo.jsx b/client/js/app/src/app/components/layout/header-logo.jsx
new file mode 100644
index 00000000000..42b03af4bf6
--- /dev/null
+++ b/client/js/app/src/app/components/layout/header-logo.jsx
@@ -0,0 +1,7 @@
+import React from 'react';
+import { Image } from '@mantine/core';
+import { VespaLogo } from 'app/assets';
+
+export function HeaderLogo() {
+ return <Image height={34} src={VespaLogo} />;
+}
diff --git a/client/js/app/src/app/components/layout/header.jsx b/client/js/app/src/app/components/layout/header.jsx
new file mode 100644
index 00000000000..2ddc3943445
--- /dev/null
+++ b/client/js/app/src/app/components/layout/header.jsx
@@ -0,0 +1,11 @@
+import React from 'react';
+import { Header as MantineHeader } from '@mantine/core';
+import { HeaderLogo } from 'app/components/layout/header-logo';
+
+export function Header() {
+ return (
+ <MantineHeader height={55} sx={{ display: 'flex', alignItems: 'center' }}>
+ <HeaderLogo />
+ </MantineHeader>
+ );
+}
diff --git a/client/js/app/src/app/components/layout/layout.jsx b/client/js/app/src/app/components/layout/layout.jsx
new file mode 100644
index 00000000000..f0f5a0594c0
--- /dev/null
+++ b/client/js/app/src/app/components/layout/layout.jsx
@@ -0,0 +1,11 @@
+import React from 'react';
+import { AppShell } from '@mantine/core';
+import { Header } from 'app/components/layout/header';
+
+export function Layout({ children }) {
+ return (
+ <AppShell header={<Header />} fixed>
+ {children}
+ </AppShell>
+ );
+}
diff --git a/client/js/app/src/app/libs/app-router.jsx b/client/js/app/src/app/libs/app-router.jsx
new file mode 100644
index 00000000000..0f196c5d58b
--- /dev/null
+++ b/client/js/app/src/app/libs/app-router.jsx
@@ -0,0 +1,42 @@
+import React from 'react';
+import { Redirect, Router } from '@reach/router';
+import { Error } from 'app/components';
+
+const mainTitle = 'Vespa App';
+
+function AppRoute({ element, title, default: isDefault, ...props }) {
+ const clone = React.cloneElement(element, props, props.children);
+ if (title != null) {
+ const titleStr = typeof title === 'function' ? title(props) : title;
+ document.title = titleStr.endsWith(mainTitle)
+ ? titleStr
+ : `${titleStr} - ${mainTitle}`;
+ } else if (isDefault) {
+ // Reset the title if title is not set and this is a default router
+ document.title = mainTitle;
+ }
+ return clone;
+}
+
+export function AppRouter({ children, props: inParentProps }) {
+ const newProps = Object.assign(
+ { primary: false, component: React.Fragment },
+ inParentProps
+ );
+
+ // If there is only one route then this comes as an object.
+ if (!Array.isArray(children)) children = [children];
+ const hasDefault = children.some((child) => child.props.default);
+
+ return (
+ <Router {...newProps}>
+ {children
+ .filter(({ props }) => props.enabled ?? true)
+ .map((e, i) => {
+ if (e.type === Redirect) return e;
+ return <AppRoute key={i} element={e} {...e.props} />;
+ })}
+ {!hasDefault && <Error code={404} default />}
+ </Router>
+ );
+}
diff --git a/client/js/app/src/app/pages/main.jsx b/client/js/app/src/app/main.jsx
index e385b05b2a4..96514d419e1 100644
--- a/client/js/app/src/app/pages/main.jsx
+++ b/client/js/app/src/app/main.jsx
@@ -1,7 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
-import App from 'app/components/App';
-import 'app/styles/index.css';
+import { App } from 'app/app';
ReactDOM.createRoot(document.getElementById('root')).render(
<React.StrictMode>
diff --git a/client/js/app/src/app/pages/home/home.jsx b/client/js/app/src/app/pages/home/home.jsx
new file mode 100644
index 00000000000..d39b696bf08
--- /dev/null
+++ b/client/js/app/src/app/pages/home/home.jsx
@@ -0,0 +1,5 @@
+import React from 'react';
+
+export function Home() {
+ return <>home</>;
+}
diff --git a/client/js/app/src/app/pages/querybuilder/query-builder.jsx b/client/js/app/src/app/pages/querybuilder/query-builder.jsx
new file mode 100644
index 00000000000..7e8f133f9ec
--- /dev/null
+++ b/client/js/app/src/app/pages/querybuilder/query-builder.jsx
@@ -0,0 +1,5 @@
+import React from 'react';
+
+export function QueryBuilder() {
+ return <>query builder</>;
+}
diff --git a/client/js/app/src/app/styles/App.css b/client/js/app/src/app/styles/App.css
deleted file mode 100644
index 8da3fde63d9..00000000000
--- a/client/js/app/src/app/styles/App.css
+++ /dev/null
@@ -1,42 +0,0 @@
-.App {
- text-align: center;
-}
-
-.App-logo {
- height: 40vmin;
- pointer-events: none;
-}
-
-@media (prefers-reduced-motion: no-preference) {
- .App-logo {
- animation: App-logo-spin infinite 20s linear;
- }
-}
-
-.App-header {
- background-color: #282c34;
- min-height: 100vh;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- font-size: calc(10px + 2vmin);
- color: white;
-}
-
-.App-link {
- color: #61dafb;
-}
-
-@keyframes App-logo-spin {
- from {
- transform: rotate(0deg);
- }
- to {
- transform: rotate(360deg);
- }
-}
-
-button {
- font-size: calc(10px + 2vmin);
-}
diff --git a/client/js/app/src/app/styles/index.css b/client/js/app/src/app/styles/index.css
deleted file mode 100644
index ec2585e8c0b..00000000000
--- a/client/js/app/src/app/styles/index.css
+++ /dev/null
@@ -1,13 +0,0 @@
-body {
- margin: 0;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
- sans-serif;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-code {
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
- monospace;
-}
diff --git a/client/js/app/yarn.lock b/client/js/app/yarn.lock
index 709d0d356fb..90377962003 100644
--- a/client/js/app/yarn.lock
+++ b/client/js/app/yarn.lock
@@ -402,7 +402,7 @@
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"
-"@mantine/core@^4.2.10":
+"@mantine/core@^4":
version "4.2.10"
resolved "https://registry.yarnpkg.com/@mantine/core/-/core-4.2.10.tgz#6b4973bc5c79cd077341ab2bbe327749ca3ed8c4"
integrity sha512-UCPhDcumygfBvik64VkMnBvqy0ZN9q+1AQ0fPdK8aAUvjRBWSyH0dJPL55vsK1ODboKktSEsyjHtb09DroL7fA==
@@ -413,7 +413,7 @@
react-popper "^2.2.5"
react-textarea-autosize "^8.3.2"
-"@mantine/hooks@^4.2.10":
+"@mantine/hooks@^4":
version "4.2.10"
resolved "https://registry.yarnpkg.com/@mantine/hooks/-/hooks-4.2.10.tgz#ad55d5ad3c5814eab924dfb6fd04f9ffd44e3d30"
integrity sha512-gVYWeE4Ieu6FBwh9h/3FjcrrNzKx1k6Yw07/LSngJP0uT3fLt1gvY2p4PtPpOh7z2/RpTXBR1x+dOgEUKomYUQ==
@@ -525,6 +525,16 @@
dependencies:
"@babel/runtime" "^7.13.10"
+"@reach/router@^1":
+ version "1.3.4"
+ resolved "https://registry.yarnpkg.com/@reach/router/-/router-1.3.4.tgz#d2574b19370a70c80480ed91f3da840136d10f8c"
+ integrity sha512-+mtn9wjlB9NN2CNnnC/BRYtwdKBfSyyasPYraNAyvaV1occr/5NnB4CVzjEZipNHwYebQwcndGUmpFzxAUoqSA==
+ dependencies:
+ create-react-context "0.3.0"
+ invariant "^2.2.3"
+ prop-types "^15.6.1"
+ react-lifecycles-compat "^3.0.4"
+
"@rollup/pluginutils@^4.2.1":
version "4.2.1"
resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz#e6c6c3aba0744edce3fb2074922d3776c0af2a6d"
@@ -790,6 +800,14 @@ convert-source-map@^1.7.0:
dependencies:
safe-buffer "~5.1.1"
+create-react-context@0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.3.0.tgz#546dede9dc422def0d3fc2fe03afe0bc0f4f7d8c"
+ integrity sha512-dNldIoSuNSvlTJ7slIKC/ZFGKexBMBrrcc+TTe1NdmROnaASuLPvqpwj9v4XS4uXZ8+YPu0sNmShX2rXI5LNsw==
+ dependencies:
+ gud "^1.0.0"
+ warning "^4.0.3"
+
cross-spawn@^7.0.0, cross-spawn@^7.0.2:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
@@ -1408,6 +1426,11 @@ globals@^13.15.0:
dependencies:
type-fest "^0.20.2"
+gud@^1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0"
+ integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==
+
has-bigints@^1.0.1, has-bigints@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa"
@@ -1506,6 +1529,13 @@ internal-slot@^1.0.3:
has "^1.0.3"
side-channel "^1.0.4"
+invariant@^2.2.3:
+ version "2.2.4"
+ resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
+ integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
+ dependencies:
+ loose-envify "^1.0.0"
+
is-bigint@^1.0.1:
version "1.0.4"
resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3"
@@ -1971,7 +2001,7 @@ pretty-quick@^3:
mri "^1.1.5"
multimatch "^4.0.0"
-prop-types@^15.8.1:
+prop-types@^15.6.1, prop-types@^15.8.1:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
@@ -2011,6 +2041,11 @@ react-is@^16.13.1, react-is@^16.7.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
+react-lifecycles-compat@^3.0.4:
+ version "3.0.4"
+ resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
+ integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==
+
react-popper@^2.2.5:
version "2.3.0"
resolved "https://registry.yarnpkg.com/react-popper/-/react-popper-2.3.0.tgz#17891c620e1320dce318bad9fede46a5f71c70ba"
@@ -2314,7 +2349,7 @@ vite@^2:
optionalDependencies:
fsevents "~2.3.2"
-warning@^4.0.2:
+warning@^4.0.2, warning@^4.0.3:
version "4.0.3"
resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3"
integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==
diff --git a/container-dependencies-enforcer/pom.xml b/container-dependencies-enforcer/pom.xml
index b8d661de111..a88b7e1d577 100644
--- a/container-dependencies-enforcer/pom.xml
+++ b/container-dependencies-enforcer/pom.xml
@@ -19,15 +19,16 @@
<dependencies>
<dependency>
<groupId>com.yahoo.vespa</groupId>
- <artifactId>container</artifactId>
+ <artifactId>container-test</artifactId>
<version>${project.version}</version>
- <scope>provided</scope>
+ <scope>test</scope>
</dependency>
+ <!-- Declare container-test before container here, opposite of what we do in hosted-tenant-base, to cover both cases -->
<dependency>
<groupId>com.yahoo.vespa</groupId>
- <artifactId>container-test</artifactId>
+ <artifactId>container</artifactId>
<version>${project.version}</version>
- <scope>test</scope>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
diff --git a/container-dev/pom.xml b/container-dev/pom.xml
index 715340c4913..8279a497e4a 100644
--- a/container-dev/pom.xml
+++ b/container-dev/pom.xml
@@ -17,13 +17,6 @@
<packaging>jar</packaging>
<dependencies>
<dependency>
- <!-- This dep is a workaround for bugs 7272469, 7259035 -->
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- <version>${jackson2.version}</version>
- </dependency>
-
- <dependency>
<groupId>com.yahoo.vespa</groupId>
<artifactId>jdisc_core</artifactId>
<version>${project.version}</version>
@@ -159,10 +152,6 @@
<artifactId>commons-exec</artifactId>
</exclusion>
<exclusion>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </exclusion>
- <exclusion>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
</exclusion>
@@ -248,12 +237,6 @@
<groupId>com.yahoo.vespa</groupId>
<artifactId>jrt</artifactId>
<version>${project.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcpkix-jdk15on</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<!-- NOTE: Dependencies below are added explicitly to exclude transitive deps that are not provided runtime by the container,
diff --git a/container-spifly/src/main/javadoc/README b/container-spifly/src/main/javadoc/README
new file mode 100644
index 00000000000..6695538e308
--- /dev/null
+++ b/container-spifly/src/main/javadoc/README
@@ -0,0 +1 @@
+No javadoc available for module \ No newline at end of file
diff --git a/container-test/pom.xml b/container-test/pom.xml
index ab5a2dc3612..9e0ea06c801 100644
--- a/container-test/pom.xml
+++ b/container-test/pom.xml
@@ -26,8 +26,22 @@
<groupId>biz.aQute.bnd</groupId>
<artifactId>*</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>com.yahoo.vespa</groupId>
+ <artifactId>vespajlib</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcpkix-jdk15on</artifactId>
+ </exclusion>
</exclusions>
</dependency>
+ <!-- Excluded above, and re-declared here, to work around a presumed Maven bug which otherwise puts this
+ in provided scope when container-test is declared before, and together with, the container artifact -->
+ <dependency>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcpkix-jdk15on</artifactId>
+ </dependency>
<!-- All dependencies that should be visible in test classpath, but not compile classpath,
for user projects must be added in compile scope here. These dependencies are explicitly excluded
@@ -103,14 +117,6 @@
<scope>compile</scope>
</dependency>
<dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcpkix-jdk15on</artifactId>
- </dependency>
- <dependency>
- <groupId>org.bouncycastle</groupId>
- <artifactId>bcprov-jdk15on</artifactId>
- </dependency>
- <dependency>
<!-- required for container-search code using org.json -->
<groupId>org.json</groupId>
<artifactId>json</artifactId>
diff --git a/container/pom.xml b/container/pom.xml
index b2a3a1baef8..4cda7b346b3 100644
--- a/container/pom.xml
+++ b/container/pom.xml
@@ -23,6 +23,10 @@
<version>${project.version}</version>
<exclusions>
<exclusion>
+ <groupId>org.bouncycastle</groupId>
+ <artifactId>bcpkix-jdk15on</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
diff --git a/document/src/tests/serialization/vespadocumentserializer_test.cpp b/document/src/tests/serialization/vespadocumentserializer_test.cpp
index 3db001e1732..40d78327ab4 100644
--- a/document/src/tests/serialization/vespadocumentserializer_test.cpp
+++ b/document/src/tests/serialization/vespadocumentserializer_test.cpp
@@ -812,7 +812,7 @@ DocumenttypesConfig getTensorDocTypesConfig() {
const DocumentTypeRepo tensor_doc_repo(getTensorDocTypesConfig());
const FixedTypeRepo tensor_repo(tensor_doc_repo,
- *tensor_doc_repo.getDocumentType(doc_type_id));
+ *tensor_doc_repo.getDocumentType(tensor_doc_type_id));
const DocumentTypeRepo tensor_doc_repo1(getTensorDocTypesConfig("tensor(dimX{})"));
diff --git a/document/src/vespa/document/base/field.h b/document/src/vespa/document/base/field.h
index c80733dd5ff..dea7198015a 100644
--- a/document/src/vespa/document/base/field.h
+++ b/document/src/vespa/document/base/field.h
@@ -56,7 +56,7 @@ public:
bool contains(const Set & field) const;
size_t size() const { return _fields.size(); }
bool empty() const { return _fields.empty(); }
- const CPtr * begin() const { return &_fields[0]; }
+ const CPtr * begin() const { return _fields.data(); }
const CPtr * end() const { return begin() + _fields.size(); }
static Set emptySet() { return Builder().build(); }
private:
diff --git a/jdisc-security-filters/pom.xml b/jdisc-security-filters/pom.xml
index dcfb61de3cc..475a8b7e3e9 100644
--- a/jdisc-security-filters/pom.xml
+++ b/jdisc-security-filters/pom.xml
@@ -29,12 +29,6 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>com.yahoo.vespa</groupId>
- <artifactId>security-utils</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
<!-- test -->
<dependency>
diff --git a/screwdriver/release-java-artifacts.sh b/screwdriver/release-java-artifacts.sh
index 8d80bb45578..0c8ae0e4eb1 100755
--- a/screwdriver/release-java-artifacts.sh
+++ b/screwdriver/release-java-artifacts.sh
@@ -52,6 +52,10 @@ for MODULE in $(comm -2 -3 \
echo "No javadoc available for module" > $MODULE/src/main/javadoc/README
done
+# Workaround new module without java code and no javadoc
+mkdir -p container-spifly/src/main/javadoc
+echo "No javadoc available for module" > container-spifly/src/main/javadoc/README
+
# Workaround for broken nexus-staging-maven-plugin instead of swapping JDK
export MAVEN_OPTS="--add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
export VESPA_MAVEN_EXTRA_OPTS="--show-version --batch-mode"
diff --git a/screwdriver/release-rpms.sh b/screwdriver/release-rpms.sh
index 256bfd8c11a..c6206fd662e 100755
--- a/screwdriver/release-rpms.sh
+++ b/screwdriver/release-rpms.sh
@@ -12,7 +12,7 @@ fi
readonly VESPA_RELEASE="$1"
readonly VESPA_REF="$2"
-VESPA_RPM=$(dnf repoquery --repofrompath=vespa,https://copr-be.cloud.fedoraproject.org/results/@vespa/vespa/epel-7-x86_64 --repoid=vespa -q vespa | tail -1 | cut -d: -f2 | cut -d- -f1)
+VESPA_RPM=$(dnf repoquery --repofrompath=vespa,https://copr-be.cloud.fedoraproject.org/results/@vespa/vespa/centos-stream-8-x86_64 --repoid=vespa -q vespa | tail -1 | cut -d: -f2 | cut -d- -f1)
echo "Latest RPM on Copr: $VESPA_RPM"
if [ "$VESPA_RELEASE" == "$VESPA_RPM" ]; then
@@ -32,8 +32,8 @@ cd vespa
dist/release-vespa-rpm.sh $VESPA_RELEASE $VESPA_REF
while [ "$VESPA_RELEASE" != "$VESPA_RPM" ]; do
- dnf clean --repofrompath=vespa,https://copr-be.cloud.fedoraproject.org/results/@vespa/vespa/epel-7-x86_64 --repoid=vespa metadata
- VESPA_RPM=$(dnf repoquery --repofrompath=vespa,https://copr-be.cloud.fedoraproject.org/results/@vespa/vespa/epel-7-x86_64 --repoid=vespa -q vespa | tail -1 | cut -d: -f2 | cut -d- -f1)
+ dnf clean --repofrompath=vespa,https://copr-be.cloud.fedoraproject.org/results/@vespa/vespa/centos-stream-8-x86_64 --repoid=vespa metadata
+ VESPA_RPM=$(dnf repoquery --repofrompath=vespa,https://copr-be.cloud.fedoraproject.org/results/@vespa/vespa/centos-stream-8-x86_64 --repoid=vespa -q vespa | tail -1 | cut -d: -f2 | cut -d- -f1)
echo "RPM: $VESPA_RPM"
sleep 150
done
diff --git a/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp b/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
index 2d7e242b9fb..e367df3abbd 100644
--- a/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
+++ b/searchcore/src/tests/proton/common/attribute_updater/attribute_updater_test.cpp
@@ -159,7 +159,7 @@ check(const AttributePtr &vec, uint32_t docId, const std::vector<T> &values)
uint32_t sz = vec->getValueCount(docId);
if (!EXPECT_EQUAL(sz, values.size())) return false;
std::vector<T> buf(sz);
- uint32_t asz = vec->get(docId, &buf[0], sz);
+ uint32_t asz = vec->get(docId, buf.data(), sz);
if (!EXPECT_EQUAL(sz, asz)) return false;
std::vector<T> wanted(values.begin(), values.end());
if (vec->hasWeightedSetType()) {
diff --git a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
index 5c4d7aca41d..6c1821dc00e 100644
--- a/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
+++ b/searchcore/src/tests/proton/feedoperation/feedoperation_test.cpp
@@ -232,9 +232,9 @@ TEST("require that serialize/deserialize works for CompactLidSpaceOperation")
op.serialize(stream);
}
{
- const document::DocumentTypeRepo *repo = NULL;
+ const document::DocumentTypeRepo repo;
CompactLidSpaceOperation op;
- op.deserialize(stream, *repo);
+ op.deserialize(stream, repo);
EXPECT_EQUAL(FeedOperation::COMPACT_LID_SPACE, op.getType());
EXPECT_EQUAL(2u, op.getSubDbId());
EXPECT_EQUAL(99u, op.getLidLimit());
diff --git a/searchcore/src/tests/proton/matching/match_loop_communicator/match_loop_communicator_test.cpp b/searchcore/src/tests/proton/matching/match_loop_communicator/match_loop_communicator_test.cpp
index 4c2afe32ae8..0cf7aea6c00 100644
--- a/searchcore/src/tests/proton/matching/match_loop_communicator/match_loop_communicator_test.cpp
+++ b/searchcore/src/tests/proton/matching/match_loop_communicator/match_loop_communicator_test.cpp
@@ -32,7 +32,7 @@ std::tuple<size_t,Hits,RangePair> second_phase(MatchLoopCommunicator &com, const
for (size_t i = 0; i < hits.size(); ++i) {
refs.push_back(i);
}
- auto my_work = com.get_second_phase_work(SortedHitSequence(&hits[0], &refs[0], refs.size()), thread_id);
+ auto my_work = com.get_second_phase_work(SortedHitSequence(hits.data(), refs.data(), refs.size()), thread_id);
// the DocumentScorer used by the match thread will sort on docid here to ensure increasing seek order, this is not needed here
size_t work_size = my_work.size();
for (auto &[hit, tag]: my_work) {
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
index 88d5281535a..826860b743e 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
@@ -196,8 +196,8 @@ Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundl
{ // we want to measure full set-up and tear-down time as part of
// collateral time
GroupingContext groupingContext(_clock, request.getTimeOfDoom(),
- &request.groupSpec[0], request.groupSpec.size());
- SessionId sessionId(&request.sessionId[0], request.sessionId.size());
+ request.groupSpec.data(), request.groupSpec.size());
+ SessionId sessionId(request.sessionId.data(), request.sessionId.size());
bool shouldCacheSearchSession = false;
bool shouldCacheGroupingSession = false;
if (!sessionId.empty()) {
@@ -355,7 +355,7 @@ Matcher::create_docsum_matcher(const DocsumRequest &req, ISearchContext &search_
}
}
std::sort(docs.begin(), docs.end());
- SessionId sessionId(&req.sessionId[0], req.sessionId.size());
+ SessionId sessionId(req.sessionId.data(), req.sessionId.size());
bool expectedSessionCached(false);
if (!sessionId.empty()) {
const Properties &cache_props = req.propertiesMap.cacheProperties();
diff --git a/searchcore/src/vespa/searchcore/proton/matching/partial_result.cpp b/searchcore/src/vespa/searchcore/proton/matching/partial_result.cpp
index 432752d69d0..450779dd97d 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/partial_result.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/partial_result.cpp
@@ -20,9 +20,9 @@ void mergeHits(size_t maxHits,
std::vector<search::RankedHit> my_hits;
std::swap(hits, my_hits);
hits.reserve(maxHits);
- const search::RankedHit *a_pos = &my_hits[0];
+ const search::RankedHit *a_pos = my_hits.data();
const search::RankedHit *a_end = a_pos + my_hits.size();
- const search::RankedHit *b_pos = &rhs_hits[0];
+ const search::RankedHit *b_pos = rhs_hits.data();
const search::RankedHit *b_end = b_pos + rhs_hits.size();
while (a_pos < a_end && b_pos < b_end && hits.size() < maxHits) {
if (before(*a_pos, *b_pos)) {
@@ -64,12 +64,12 @@ size_t mergeHits(size_t maxHits,
std::swap(sortData, my_sortData);
hits.reserve(maxHits);
sortData.reserve(maxHits);
- const search::RankedHit *a_pos = &my_hits[0];
+ const search::RankedHit *a_pos = my_hits.data();
const search::RankedHit *a_end = a_pos + my_hits.size();
- const search::RankedHit *b_pos = &rhs_hits[0];
+ const search::RankedHit *b_pos = rhs_hits.data();
const search::RankedHit *b_end = b_pos + rhs_hits.size();
- const PartialResult::SortRef *a_sort_pos = &my_sortData[0];
- const PartialResult::SortRef *b_sort_pos = &rhs_sortData[0];
+ const PartialResult::SortRef *a_sort_pos = my_sortData.data();
+ const PartialResult::SortRef *b_sort_pos = rhs_sortData.data();
while (a_pos < a_end && b_pos < b_end && hits.size() < maxHits) {
if (before(*a_sort_pos, a_pos->_docId,
*b_sort_pos, b_pos->_docId))
diff --git a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp
index 4da09df1297..2c758ee712f 100644
--- a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp
@@ -131,7 +131,7 @@ ConfigFile::ConfigFile(const vespalib::string &name, const vespalib::string &ful
return;
int64_t fileSize = file.getSize();
_content.resize(fileSize);
- file.ReadBuf(&_content[0], fileSize);
+ file.ReadBuf(_content.data(), fileSize);
_modTime = file.GetModificationTime();
}
@@ -143,7 +143,7 @@ ConfigFile::serialize(nbostream &stream) const
stream << static_cast<int64_t>(_modTime);;
uint32_t sz = _content.size();
stream << sz;
- stream.write(&_content[0], sz);
+ stream.write(_content.data(), sz);
return stream;
}
@@ -159,7 +159,9 @@ ConfigFile::deserialize(nbostream &stream)
stream >> sz;
_content.resize(sz);
assert(stream.size() >= sz);
- memcpy(&_content[0], stream.peek(), sz);
+ if (sz > 0) {
+ memcpy(_content.data(), stream.peek(), sz);
+ }
stream.adjustReadPos(sz);
return stream;
}
@@ -173,7 +175,7 @@ ConfigFile::save(const vespalib::string &snapDir) const
assert(openRes);
(void) openRes;
- file.WriteBuf(&_content[0], _content.size());
+ file.WriteBuf(_content.data(), _content.size());
bool closeRes = file.Close();
assert(closeRes);
(void) closeRes;
diff --git a/searchlib/src/tests/attribute/attribute_test.cpp b/searchlib/src/tests/attribute/attribute_test.cpp
index bb516c3b451..a0906e2a488 100644
--- a/searchlib/src/tests/attribute/attribute_test.cpp
+++ b/searchlib/src/tests/attribute/attribute_test.cpp
@@ -791,7 +791,7 @@ AttributeTest::checkCount(const AttributePtr & ptr, uint32_t doc, uint32_t value
if (!result) {
return false;
}
- EXPECT_EQ(valueCount, ptr->get(doc, &buffer[0], buffer.size())) << (result = false, "");
+ EXPECT_EQ(valueCount, ptr->get(doc, buffer.data(), buffer.size())) << (result = false, "");
if (!result) {
return false;
}
@@ -807,7 +807,7 @@ AttributeTest::checkContent(const AttributePtr & ptr, uint32_t doc, uint32_t val
std::vector<BufferType> buffer(valueCount);
bool retval = true;
EXPECT_TRUE((retval = retval && (static_cast<uint32_t>(ptr->getValueCount(doc)) == valueCount)));
- EXPECT_TRUE((retval = retval && (ptr->get(doc, &buffer[0], buffer.size()) == valueCount)));
+ EXPECT_TRUE((retval = retval && (ptr->get(doc, buffer.data(), buffer.size()) == valueCount)));
for (uint32_t i = 0; i < valueCount; ++i) {
EXPECT_TRUE((retval = retval && (buffer[i] == values[i % range])));
}
@@ -868,7 +868,7 @@ AttributeTest::testSingle(const AttributePtr & ptr, const std::vector<BufferType
ptr->clearDoc(doc);
}
ptr->commit();
- EXPECT_EQ(1u, ptr->get(doc, &buffer[0], buffer.size()));
+ EXPECT_EQ(1u, ptr->get(doc, buffer.data(), buffer.size()));
if (doc % 2 == 0) {
if (smallUInt) {
expectZero(buffer[0]);
@@ -1156,7 +1156,7 @@ AttributeTest::testWeightedSet(const AttributePtr & ptr, const std::vector<Buffe
EXPECT_TRUE(v.append(doc, values[j].getValue(), values[j].getWeight()));
}
commit(ptr);
- ASSERT_TRUE(ptr->get(doc, &buffer[0], buffer.size()) == valueCount);
+ ASSERT_TRUE(ptr->get(doc, buffer.data(), buffer.size()) == valueCount);
std::sort(buffer.begin(), buffer.begin() + valueCount, order_by_weight());
for (uint32_t j = 0; j < valueCount; ++j) {
EXPECT_TRUE(buffer[j].getValue() == ordered_values[j].getValue());
@@ -1173,20 +1173,20 @@ AttributeTest::testWeightedSet(const AttributePtr & ptr, const std::vector<Buffe
// append non-existent value
EXPECT_TRUE(v.append(doc, values[doc].getValue(), values[doc].getWeight()));
commit(ptr);
- ASSERT_TRUE(ptr->get(doc, &buffer[0], buffer.size()) == valueCount + 1);
+ ASSERT_TRUE(ptr->get(doc, buffer.data(), buffer.size()) == valueCount + 1);
EXPECT_TRUE(contains(buffer, valueCount + 1, values[doc]));
// append existent value
EXPECT_TRUE(v.append(doc, values[doc].getValue(), values[doc].getWeight() + 10));
commit(ptr);
- ASSERT_TRUE(ptr->get(doc, &buffer[0], buffer.size()) == valueCount + 1);
+ ASSERT_TRUE(ptr->get(doc, buffer.data(), buffer.size()) == valueCount + 1);
EXPECT_TRUE(contains(buffer, valueCount + 1, BufferType(values[doc].getValue(), values[doc].getWeight() + 10)));
// append non-existent value two times
EXPECT_TRUE(v.append(doc, values[doc + 1].getValue(), values[doc + 1].getWeight()));
EXPECT_TRUE(v.append(doc, values[doc + 1].getValue(), values[doc + 1].getWeight() + 10));
commit(ptr);
- ASSERT_TRUE(ptr->get(doc, &buffer[0], buffer.size()) == valueCount + 2);
+ ASSERT_TRUE(ptr->get(doc, buffer.data(), buffer.size()) == valueCount + 2);
EXPECT_TRUE(contains(buffer, valueCount + 2, BufferType(values[doc + 1].getValue(), values[doc + 1].getWeight() + 10)));
}
EXPECT_EQ(ptr->getStatus().getUpdateCount(), numDocs + (numDocs*(numDocs-1))/2 + numDocs*4);
@@ -1203,11 +1203,11 @@ AttributeTest::testWeightedSet(const AttributePtr & ptr, const std::vector<Buffe
EXPECT_TRUE(static_cast<uint32_t>(v.getValueCount(doc)) == valueCount + 2);
// remove existent value
- ASSERT_TRUE(ptr->get(doc, &buffer[0], buffer.size()) == valueCount + 2);
+ ASSERT_TRUE(ptr->get(doc, buffer.data(), buffer.size()) == valueCount + 2);
EXPECT_TRUE(contains_value(buffer, valueCount + 2, values[doc + 1].getValue()));
EXPECT_TRUE(v.remove(doc, values[doc + 1].getValue(), 0));
commit(ptr);
- ASSERT_TRUE(ptr->get(doc, &buffer[0], buffer.size()) == valueCount + 1);
+ ASSERT_TRUE(ptr->get(doc, buffer.data(), buffer.size()) == valueCount + 1);
EXPECT_FALSE(contains_value(buffer, valueCount + 1, values[doc + 1].getValue()));
}
EXPECT_EQ(ptr->getStatus().getUpdateCount(), numDocs + (numDocs*(numDocs-1))/2 + numDocs*4 + numDocs * 2);
diff --git a/searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp b/searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp
index 5c1c49d8eb5..e27065f1c25 100644
--- a/searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp
+++ b/searchlib/src/tests/attribute/document_weight_or_filter_search/document_weight_or_filter_search_test.cpp
@@ -47,7 +47,7 @@ public:
for (auto& key : keys) {
adds.emplace_back(KeyData(key, 1));
}
- _postings.apply(_trees[idx], &*adds.begin(), &*adds.end(), &*removes.begin(), &*removes.end());
+ _postings.apply(_trees[idx], adds.data(), adds.data() + adds.size(), removes.data(), removes.data() + removes.size());
}
void clear_tree(size_t idx) {
diff --git a/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp b/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp
index 92c3da40fe9..90127e9ae7b 100644
--- a/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp
+++ b/searchlib/src/tests/attribute/enumeratedsave/enumeratedsave_test.cpp
@@ -21,6 +21,7 @@
#include <vespa/vespalib/data/databuffer.h>
#include <vespa/vespalib/testkit/testapp.h>
#include <vespa/vespalib/util/compress.h>
+#include <vespa/vespalib/util/memory.h>
#include <vespa/vespalib/stllike/asciistream.h>
#include <limits>
#include <cmath>
@@ -184,8 +185,8 @@ MemAttr::bufEqual(const Buffer &lhs, const Buffer &rhs) const
return true;
if (!EXPECT_TRUE(lhs->getDataLen() == rhs->getDataLen()))
return false;
- if (!EXPECT_TRUE(memcmp(lhs->getData(), rhs->getData(),
- lhs->getDataLen()) == 0))
+ if (!EXPECT_TRUE(vespalib::memcmp_safe(lhs->getData(), rhs->getData(),
+ lhs->getDataLen()) == 0))
return false;
return true;
}
@@ -480,7 +481,7 @@ EnumeratedSaveTest::getSearch(const V &vec, const T &term, bool prefix)
buildTermQuery(query, vec.getName(), ss.str(), prefix);
return (static_cast<const AttributeVector &>(vec)).
- getSearch(vespalib::stringref(&query[0], query.size()),
+ getSearch(vespalib::stringref(query.data(), query.size()),
SearchContextParams());
}
diff --git a/searchlib/src/tests/attribute/posting_store/posting_store_test.cpp b/searchlib/src/tests/attribute/posting_store/posting_store_test.cpp
index 10cc14012dd..573284ffa35 100644
--- a/searchlib/src/tests/attribute/posting_store/posting_store_test.cpp
+++ b/searchlib/src/tests/attribute/posting_store/posting_store_test.cpp
@@ -83,8 +83,8 @@ protected:
additions.emplace_back(i, 0);
}
_store.apply(root,
- &additions[0], &additions[0] + additions.size(),
- &removals[0], &removals[0] + removals.size());
+ additions.data(), additions.data() + additions.size(),
+ removals.data(), removals.data() + removals.size());
return root;
}
static std::vector<int> make_exp_sequence(int start_key, int end_key)
diff --git a/searchlib/src/tests/attribute/postinglist/postinglist.cpp b/searchlib/src/tests/attribute/postinglist/postinglist.cpp
index 446aeaf22a7..54efb3261c8 100644
--- a/searchlib/src/tests/attribute/postinglist/postinglist.cpp
+++ b/searchlib/src/tests/attribute/postinglist/postinglist.cpp
@@ -379,8 +379,8 @@ insertRandomValues(Tree &tree,
std::vector<AttributePosting> additions;
std::vector<uint32_t> removals;
additions.push_back(newPosting);
- postings.apply(newIdx, &additions[0], &additions[0] + additions.size(),
- &removals[0], &removals[0] + removals.size());
+ postings.apply(newIdx, additions.data(), additions.data() + additions.size(),
+ removals.data(), removals.data() + removals.size());
std::atomic_thread_fence(std::memory_order_release);
itr.writeData(newIdx);
@@ -461,8 +461,8 @@ removeRandomValues(Tree &tree,
std::vector<AttributePosting> additions;
std::vector<uint32_t> removals;
removals.push_back(i->_docId);
- postings.apply(newIdx, &additions[0], &additions[0]+additions.size(),
- &removals[0], &removals[0] + removals.size());
+ postings.apply(newIdx, additions.data(), additions.data() + additions.size(),
+ removals.data(), removals.data() + removals.size());
if (newIdx != oldIdx) {
std::atomic_thread_fence(std::memory_order_release);
itr.writeData(newIdx);
diff --git a/searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp b/searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp
index aa2c475e7b6..96039bee15b 100644
--- a/searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp
+++ b/searchlib/src/tests/attribute/stringattribute/stringattribute_test.cpp
@@ -48,7 +48,7 @@ checkCount(Attribute & vec, uint32_t doc, uint32_t valueCount,
{
std::vector<vespalib::string> buffer(valueCount);
EXPECT_TRUE(static_cast<uint32_t>(vec.getValueCount(doc)) == valueCount);
- EXPECT_TRUE(vec.get(doc, &buffer[0], buffer.size()) == valueCount);
+ EXPECT_TRUE(vec.get(doc, buffer.data(), buffer.size()) == valueCount);
EXPECT_TRUE(std::count(buffer.begin(), buffer.end(), value) == numValues);
}
@@ -125,10 +125,10 @@ testMultiValue(Attribute & attr, uint32_t numDocs)
// test get all
std::vector<vespalib::string> values(valueCount);
- ASSERT_TRUE(attr.get(doc, &values[0], valueCount) == valueCount);
+ ASSERT_TRUE(attr.get(doc, values.data(), valueCount) == valueCount);
std::vector<uint32_t> enums(valueCount);
- ASSERT_TRUE((static_cast<search::attribute::IAttributeVector &>(attr)).get(doc, &enums[0], valueCount) == valueCount);
+ ASSERT_TRUE((static_cast<search::attribute::IAttributeVector &>(attr)).get(doc, enums.data(), valueCount) == valueCount);
auto combined = zipped_and_sorted_by_first(values, enums);
for (uint32_t j = 0; j < valueCount; ++j) {
@@ -167,10 +167,10 @@ testMultiValue(Attribute & attr, uint32_t numDocs)
// test get all
std::vector<vespalib::string> values(valueCount);
- EXPECT_TRUE(attr.get(doc, &values[0], valueCount) == valueCount);
+ EXPECT_TRUE(attr.get(doc, values.data(), valueCount) == valueCount);
std::vector<uint32_t> enums(valueCount);
- EXPECT_TRUE((static_cast<search::attribute::IAttributeVector &>(attr)).get(doc, &enums[0], valueCount) == valueCount);
+ EXPECT_TRUE((static_cast<search::attribute::IAttributeVector &>(attr)).get(doc, enums.data(), valueCount) == valueCount);
auto combined = zipped_and_sorted_by_first(values, enums);
for (uint32_t j = 0; j < valueCount; ++j) {
diff --git a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
index fffa1778c85..0865e2c199a 100644
--- a/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
+++ b/searchlib/src/tests/docstore/logdatastore/logdatastore_test.cpp
@@ -18,6 +18,7 @@
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
#include <vespa/vespalib/util/size_literals.h>
+#include <vespa/vespalib/util/memory.h>
#include <iomanip>
using document::BucketId;
@@ -275,7 +276,7 @@ void fetchAndTest(IDataStore & datastore, uint32_t lid, const void *a, size_t sz
vespalib::DataBuffer buf;
EXPECT_EQUAL(static_cast<ssize_t>(sz), datastore.read(lid, buf));
EXPECT_EQUAL(buf.getDataLen(), sz);
- EXPECT_TRUE(memcmp(a, buf.getData(), sz) == 0);
+ EXPECT_TRUE(vespalib::memcmp_safe(a, buf.getData(), sz) == 0);
}
TEST("testTruncatedIdxFile"){
diff --git a/searchlib/src/vespa/searchlib/attribute/attribute_operation.cpp b/searchlib/src/vespa/searchlib/attribute/attribute_operation.cpp
index 57980237f21..55577b3916c 100644
--- a/searchlib/src/vespa/searchlib/attribute/attribute_operation.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/attribute_operation.cpp
@@ -111,7 +111,7 @@ public:
void operator()(IAttributeVector &attributeVector) override {
OP op(attributeVector, _operand);
if (op.valid()) {
- const RankedHit *hits = &_result.second[0];
+ const RankedHit *hits = _result.second.data();
size_t numHits = _result.second.size();
std::for_each(hits, hits+numHits, [&op](RankedHit hit) { op(hit.getDocId()); });
if (_result.first) {
diff --git a/searchlib/src/vespa/searchlib/attribute/loadedenumvalue.cpp b/searchlib/src/vespa/searchlib/attribute/loadedenumvalue.cpp
index b514275f75d..80e9b28139a 100644
--- a/searchlib/src/vespa/searchlib/attribute/loadedenumvalue.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/loadedenumvalue.cpp
@@ -13,7 +13,7 @@ sortLoadedByEnum(LoadedEnumAttributeVector &loaded)
LoadedEnumAttribute::EnumCompare, 56>::
radix_sort(LoadedEnumAttribute::EnumRadix(),
LoadedEnumAttribute::EnumCompare(),
- &loaded[0], loaded.size(), 16);
+ loaded.data(), loaded.size(), 16);
}
}
diff --git a/searchlib/src/vespa/searchlib/attribute/loadednumericvalue.cpp b/searchlib/src/vespa/searchlib/attribute/loadednumericvalue.cpp
index 0ffd6e2c845..4d3912ae24d 100644
--- a/searchlib/src/vespa/searchlib/attribute/loadednumericvalue.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/loadednumericvalue.cpp
@@ -14,7 +14,7 @@ sortLoadedByValue(SequentialReadModifyWriteVector<LoadedNumericValue<T>> & loade
typename LoadedNumericValue<T>::ValueCompare, 56>::
radix_sort(typename LoadedNumericValue<T>::ValueRadix(),
typename LoadedNumericValue<T>::ValueCompare(),
- &loaded[0],
+ loaded.data(),
loaded.size(),
16);
}
@@ -29,7 +29,7 @@ sortLoadedByDocId(SequentialReadModifyWriteVector<LoadedNumericValue<T>> & loade
typename LoadedNumericValue<T>::DocOrderCompare, 56>::
radix_sort(typename LoadedNumericValue<T>::DocRadix(),
typename LoadedNumericValue<T>::DocOrderCompare(),
- &loaded[0],
+ loaded.data(),
loaded.size(),
16);
}
diff --git a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h
index cc128b0eef1..0a29b4af48d 100644
--- a/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h
+++ b/searchlib/src/vespa/searchlib/attribute/multinumericattribute.h
@@ -49,7 +49,7 @@ protected:
using WType = MultiValueType;
uint32_t get(DocId doc, const WType * & values) const {
MultiValueArrayRef array(this->_mvMapping.get(doc));
- values = &array[0];
+ values = array.data();
return array.size();
}
diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp b/searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp
index 0e0dceaf254..79276ce6f55 100644
--- a/searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/postinglistattribute.cpp
@@ -69,11 +69,11 @@ PostingListAttributeBase<P>::handle_load_posting_lists_and_update_enum_store(enu
postings.removeDups();
newIndex = EntryRef();
_postingList.apply(newIndex,
- &postings._additions[0],
- &postings._additions[0] +
+ postings._additions.data(),
+ postings._additions.data() +
postings._additions.size(),
- &postings._removals[0],
- &postings._removals[0] +
+ postings._removals.data(),
+ postings._removals.data() +
postings._removals.size());
posting_indexes[posting_enum] = newIndex;
postings.clear();
@@ -91,10 +91,10 @@ PostingListAttributeBase<P>::handle_load_posting_lists_and_update_enum_store(enu
postings.removeDups();
newIndex = EntryRef();
_postingList.apply(newIndex,
- &postings._additions[0],
- &postings._additions[0] + postings._additions.size(),
- &postings._removals[0],
- &postings._removals[0] + postings._removals.size());
+ postings._additions.data(),
+ postings._additions.data() + postings._additions.size(),
+ postings._removals.data(),
+ postings._removals.data() + postings._removals.size());
posting_indexes[posting_enum] = newIndex;
loader.build_dictionary();
loader.free_unused_values();
@@ -158,10 +158,10 @@ clearPostings(attribute::IAttributeVector::EnumHandle eidx,
auto updater = [this, &postings](EntryRef posting_idx) -> EntryRef
{
_postingList.apply(posting_idx,
- &postings._additions[0],
- &postings._additions[0] + postings._additions.size(),
- &postings._removals[0],
- &postings._removals[0] + postings._removals.size());
+ postings._additions.data(),
+ postings._additions.data() + postings._additions.size(),
+ postings._removals.data(),
+ postings._removals.data() + postings._removals.size());
return posting_idx;
};
_dictionary.update_posting_list(er, cmp, updater);
@@ -240,11 +240,11 @@ handle_load_posting_lists(LoadedVector& loaded)
postings.removeDups();
newIndex = EntryRef();
_postingList.apply(newIndex,
- &postings._additions[0],
- &postings._additions[0] +
+ postings._additions.data(),
+ postings._additions.data() +
postings._additions.size(),
- &postings._removals[0],
- &postings._removals[0] +
+ postings._removals.data(),
+ postings._removals.data() +
postings._removals.size());
postings.clear();
if (value._docId < docIdLimit) {
@@ -262,11 +262,11 @@ handle_load_posting_lists(LoadedVector& loaded)
postings.removeDups();
newIndex = EntryRef();
_postingList.apply(newIndex,
- &postings._additions[0],
- &postings._additions[0] +
+ postings._additions.data(),
+ postings._additions.data() +
postings._additions.size(),
- &postings._removals[0],
- &postings._removals[0] + postings._removals.size());
+ postings._removals.data(),
+ postings._removals.data() + postings._removals.size());
similarValues[0]._pidx = newIndex;
for (size_t i(0), m(similarValues.size()); i < m; i++) {
loaded.write(similarValues[i]);
diff --git a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp
index c17627a5026..d8426ce1a45 100644
--- a/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/postinglistsearchcontext.cpp
@@ -20,8 +20,8 @@ PostingListSearchContext(const IEnumStoreDictionary& dictionary,
const ISearchContext &baseSearchCtx)
: _dictionary(dictionary),
_frozenDictionary(_dictionary.get_has_btree_dictionary() ? _dictionary.get_posting_dictionary().getFrozenView() : FrozenDictionary()),
- _lowerDictItr(BTreeNode::Ref(), _frozenDictionary.getAllocator()),
- _upperDictItr(BTreeNode::Ref(), _frozenDictionary.getAllocator()),
+ _lowerDictItr(_dictionary.get_has_btree_dictionary() ? DictionaryConstIterator(BTreeNode::Ref(), _frozenDictionary.getAllocator()) : DictionaryConstIterator()),
+ _upperDictItr(_dictionary.get_has_btree_dictionary() ? DictionaryConstIterator(BTreeNode::Ref(), _frozenDictionary.getAllocator()) : DictionaryConstIterator()),
_uniqueValues(0u),
_docIdLimit(docIdLimit),
_dictSize(_frozenDictionary.size()),
diff --git a/searchlib/src/vespa/searchlib/bitcompression/compression.h b/searchlib/src/vespa/searchlib/bitcompression/compression.h
index 45005d499fb..441fac3aef1 100644
--- a/searchlib/src/vespa/searchlib/bitcompression/compression.h
+++ b/searchlib/src/vespa/searchlib/bitcompression/compression.h
@@ -165,8 +165,7 @@ public:
#define UC64BE_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \
do { \
- length = \
- 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \
+ length = __builtin_clzl(val); \
unsigned int olength = length; \
val <<= length; \
if (__builtin_expect(length * 2 + 1 + (k) > 64, false)) { \
@@ -174,8 +173,9 @@ public:
length = 0; \
} \
val64 = (val >> (63 - olength - (k))) - (UINT64_C(1) << (k)); \
- val <<= olength + 1 + (k); \
- if (__builtin_expect(olength + 1 + (k) == 64, false)) { \
+ if (__builtin_expect(olength + 1 + (k) != 64, true)) { \
+ val <<= olength + 1 + (k); \
+ } else { \
val = 0; \
} \
length += olength + 1 + (k); \
@@ -193,8 +193,7 @@ public:
#define UC64BE_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \
EC) \
do { \
- length = \
- 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \
+ length = __builtin_clzl(val); \
val <<= length; \
val64 = (val >> (63 - length - (k))) - (UINT64_C(1) << (k)); \
val <<= length + 1 + (k); \
@@ -219,8 +218,7 @@ public:
#define UC64BE_DECODEEXPGOLOMB_SMALL_APPLY(val, valI, preRead, cacheInt, \
k, EC, resop) \
do { \
- length = \
- 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \
+ length = __builtin_clzl(val); \
val <<= length; \
resop (val >> (63 - length - (k))) - (UINT64_C(1) << (k)); \
val <<= length + 1 + (k); \
@@ -231,16 +229,16 @@ public:
#define UC64BE_SKIPEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \
do { \
- length = \
- 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \
+ length = __builtin_clzl(val); \
unsigned int olength = length; \
val <<= length; \
if (__builtin_expect(length * 2 + 1 + (k) > 64, false)) { \
UC64BE_READBITS(val, valI, preRead, cacheInt, EC); \
length = 0; \
} \
- val <<= olength + 1 + (k); \
- if (__builtin_expect(olength + 1 + (k) == 64, false)) { \
+ if (__builtin_expect(olength + 1 + (k) != 64, true)) { \
+ val <<= olength + 1 + (k); \
+ } else { \
val = 0; \
} \
length += olength + 1 + (k); \
@@ -258,8 +256,7 @@ public:
#define UC64BE_SKIPEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \
EC) \
do { \
- length = \
- 63 - ::search::bitcompression::EncodeContext64BE::asmlog2(val); \
+ length = __builtin_clzl(val); \
val <<= length; \
val <<= length + 1 + (k); \
length += length + 1 + (k); \
@@ -394,11 +391,11 @@ public:
#define UC64LE_DECODEEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \
do { \
- unsigned int olength = \
- ::search::bitcompression::EncodeContext64LE::ffsl(val); \
+ unsigned int olength = __builtin_ctzl(val); \
length = olength + 1; \
- val >>= length; \
- if (__builtin_expect(length == 64, false)) { \
+ if (__builtin_expect(length != 64, true)) { \
+ val >>= length; \
+ } else { \
val = 0; \
} \
if (__builtin_expect(olength * 2 + 1 + (k) > 64, false)) { \
@@ -423,7 +420,7 @@ public:
#define UC64LE_DECODEEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \
EC) \
do { \
- length = ::search::bitcompression::EncodeContext64LE::ffsl(val); \
+ length = __builtin_ctzl(val); \
val >>= length + 1; \
val64 = (val & ((UINT64_C(1) << (length + (k))) - 1)) + \
(UINT64_C(1) << (length + (k))) - (UINT64_C(1) << (k)); \
@@ -449,7 +446,7 @@ public:
#define UC64LE_DECODEEXPGOLOMB_SMALL_APPLY(val, valI, preRead, cacheInt, \
k, EC, resop) \
do { \
- length = ::search::bitcompression::EncodeContext64LE::ffsl(val); \
+ length = __builtin_ctzl(val); \
val >>= length + 1; \
resop (val & ((UINT64_C(1) << (length + (k))) - 1)) + \
(UINT64_C(1) << (length + (k))) - (UINT64_C(1) << (k)); \
@@ -461,11 +458,11 @@ public:
#define UC64LE_SKIPEXPGOLOMB(val, valI, preRead, cacheInt, k, EC) \
do { \
- unsigned int olength = \
- ::search::bitcompression::EncodeContext64LE::ffsl(val); \
+ unsigned int olength = __builtin_ctzl(val); \
length = olength + 1; \
- val >>= length; \
- if (__builtin_expect(length == 64, false)) { \
+ if (__builtin_expect(length != 64, true)) { \
+ val >>= length; \
+ } else { \
val = 0; \
} \
if (__builtin_expect(olength * 2 + 1 + (k) > 64, false)) { \
@@ -488,7 +485,7 @@ public:
#define UC64LE_SKIPEXPGOLOMB_SMALL(val, valI, preRead, cacheInt, k, \
EC) \
do { \
- length = ::search::bitcompression::EncodeContext64LE::ffsl(val); \
+ length = __builtin_ctzl(val); \
val >>= length + 1; \
val >>= length + (k); \
length += length + 1 + (k); \
diff --git a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp
index 9a711a028fb..b0a201d913e 100644
--- a/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp
+++ b/searchlib/src/vespa/searchlib/bitcompression/pagedict4.cpp
@@ -365,7 +365,7 @@ PageDict4SPWriter::flushPage()
_prevL3Size - wordsSize * 8;
e.padBits(padding);
if (wordsSize > 0) {
- e.writeBytes(vespalib::ConstArrayRef<char>(&_words[0], wordsSize));
+ e.writeBytes(vespalib::ConstArrayRef<char>(_words.data(), wordsSize));
}
assert((e.getWriteOffset() & (getPageBitSize() - 1)) == 0);
_l6Word = _l3Word;
@@ -676,7 +676,7 @@ PageDict4PWriter::flushPage()
_countsSize - _countsWordOffset * 8;
e.padBits(padding);
if (_countsWordOffset > 0) {
- e.writeBytes(vespalib::ConstArrayRef(&_words[0], _countsWordOffset));
+ e.writeBytes(vespalib::ConstArrayRef(_words.data(), _countsWordOffset));
}
assert((e.getWriteOffset() & (getPageBitSize() - 1)) == 0);
_l3Word = _pendingCountsWord;
@@ -1055,7 +1055,7 @@ lookup(vespalib::stringref key)
L7Vector::const_iterator l7lb;
l7lb = std::lower_bound(_l7.begin(), _l7.end(), key);
- l7Pos = &*l7lb - &_l7[0];
+ l7Pos = l7lb - _l7.cbegin();
StartOffset startOffset;
uint64_t pageNum = _pFirstPageNum;
uint32_t sparsePageNum = _spFirstPageNum;
@@ -1863,7 +1863,7 @@ PageDict4Reader::setupPage()
uint32_t padding = (getPageBitSize() - wordsSize * 8 - pageOffset) & (getPageBitSize() - 1);
_pd.skipBits(padding);
_words.resize(wordsSize);
- _pd.readBytes(reinterpret_cast<uint8_t *>(&_words[0]), wordsSize);
+ _pd.readBytes(reinterpret_cast<uint8_t *>(_words.data()), wordsSize);
_wc = _words.begin();
_we = _words.end();
checkWordOffsets(_words, _l1SkipChecks, _l2SkipChecks);
@@ -1985,7 +1985,7 @@ PageDict4Reader::setupSPage()
uint32_t padding = getPageBitSize() - wordsSize * 8 - pageOffset;
_spd.skipBits(padding);
_spwords.resize(wordsSize);
- _spd.readBytes(reinterpret_cast<uint8_t *>(&_spwords[0]), wordsSize);
+ _spd.readBytes(reinterpret_cast<uint8_t *>(_spwords.data()), wordsSize);
_spwc = _spwords.begin();
_spwe = _spwords.end();
checkWordOffsets(_spwords, _l4SkipChecks, _l5SkipChecks);
diff --git a/searchlib/src/vespa/searchlib/common/geo_location.cpp b/searchlib/src/vespa/searchlib/common/geo_location.cpp
index 1806ba1338c..20408a93a82 100644
--- a/searchlib/src/vespa/searchlib/common/geo_location.cpp
+++ b/searchlib/src/vespa/searchlib/common/geo_location.cpp
@@ -8,6 +8,12 @@ namespace search::common {
namespace {
+uint64_t abs_diff(int32_t a, int32_t b) {
+ return (a > b)
+ ? (int64_t(a) - int64_t(b))
+ : (int64_t(b) - int64_t(a));
+}
+
ZCurve::BoundingBox to_z(GeoLocation::Box box) {
return ZCurve::BoundingBox(box.x.low, box.x.high,
box.y.low, box.y.high);
@@ -158,13 +164,13 @@ GeoLocation::GeoLocation(Box b, Point p, uint32_t r, Aspect xa)
uint64_t GeoLocation::sq_distance_to(Point p) const {
if (has_point) {
- uint64_t dx = (p.x > point.x) ? (p.x - point.x) : (point.x - p.x);
+ uint64_t dx = abs_diff(p.x, point.x);
if (x_aspect.active()) {
// x_aspect is a 32-bit fixed-point number in range [0,1]
// this implements dx = (dx * x_aspect)
dx = (dx * x_aspect.multiplier) >> 32;
}
- uint64_t dy = (p.y > point.y) ? (p.y - point.y) : (point.y - p.y);
+ uint64_t dy = abs_diff(p.y, point.y);
return dx*dx + dy*dy;
}
return 0;
diff --git a/searchlib/src/vespa/searchlib/common/geo_location_parser.cpp b/searchlib/src/vespa/searchlib/common/geo_location_parser.cpp
index 8794169b4a6..d829e1b93e4 100644
--- a/searchlib/src/vespa/searchlib/common/geo_location_parser.cpp
+++ b/searchlib/src/vespa/searchlib/common/geo_location_parser.cpp
@@ -15,7 +15,7 @@ LOG_SETUP(".searchlib.common.geo_location_parser");
namespace {
int getInt(const char * &p) {
- int val;
+ uint32_t val;
bool isminus;
val = 0;
isminus = false;
diff --git a/searchlib/src/vespa/searchlib/common/resultset.cpp b/searchlib/src/vespa/searchlib/common/resultset.cpp
index 2e1e431ad82..3a88a310fe8 100644
--- a/searchlib/src/vespa/searchlib/common/resultset.cpp
+++ b/searchlib/src/vespa/searchlib/common/resultset.cpp
@@ -99,7 +99,7 @@ ResultSet::mergeWithBitOverflow(HitRank default_value)
void
ResultSet::sort(FastS_IResultSorter & sorter, unsigned int ntop) {
- sorter.sortResults(&_rankedHitsArray[0], _rankedHitsArray.size(), ntop);
+ sorter.sortResults(_rankedHitsArray.data(), _rankedHitsArray.size(), ntop);
}
std::pair<std::unique_ptr<BitVector>, vespalib::Array<RankedHit>>
diff --git a/searchlib/src/vespa/searchlib/common/resultset.h b/searchlib/src/vespa/searchlib/common/resultset.h
index 6824fc4170d..a4823d2f372 100644
--- a/searchlib/src/vespa/searchlib/common/resultset.h
+++ b/searchlib/src/vespa/searchlib/common/resultset.h
@@ -26,7 +26,7 @@ public:
void allocArray(unsigned int arrayAllocated);
void setBitOverflow(std::unique_ptr<BitVector> newBitOverflow);
- const RankedHit * getArray() const { return &_rankedHitsArray[0]; }
+ const RankedHit * getArray() const { return _rankedHitsArray.data(); }
RankedHit & operator [](uint32_t i) { return _rankedHitsArray[i]; }
void push_back(RankedHit hit) { _rankedHitsArray.push_back_fast(hit); }
unsigned int getArrayUsed() const { return _rankedHitsArray.size(); }
diff --git a/searchlib/src/vespa/searchlib/common/sortresults.cpp b/searchlib/src/vespa/searchlib/common/sortresults.cpp
index f1756712d2c..59a47dd3312 100644
--- a/searchlib/src/vespa/searchlib/common/sortresults.cpp
+++ b/searchlib/src/vespa/searchlib/common/sortresults.cpp
@@ -209,9 +209,9 @@ FastS_SortSpec::realloc(uint32_t n, size_t & variableWidth, uint32_t & available
variableWidth *= 2;
available += variableWidth * n;
dataSize += variableWidth * n;
- uint32_t byteUsed = mySortData - &_binarySortData[0];
+ uint32_t byteUsed = mySortData - _binarySortData.data();
_binarySortData.resize(dataSize);
- return &_binarySortData[0] + byteUsed;
+ return _binarySortData.data() + byteUsed;
}
void
@@ -237,7 +237,7 @@ FastS_SortSpec::initSortData(const RankedHit *hits, uint32_t n)
uint32_t dataSize = (fixedWidth + variableWidth) * n;
uint32_t available = dataSize;
_binarySortData.resize(dataSize);
- uint8_t *mySortData = &_binarySortData[0];
+ uint8_t *mySortData = _binarySortData.data();
_sortDataArray.resize(n);
@@ -342,7 +342,7 @@ void
FastS_SortSpec::copySortData(uint32_t offset, uint32_t n,
uint32_t *idx, char *buf)
{
- const uint8_t * sortData = &_binarySortData[0];
+ const uint8_t * sortData = _binarySortData.data();
uint32_t totalLen = 0;
for (uint32_t i = offset; i < (offset + n); ++i, ++idx) {
const uint8_t * src = sortData + _sortDataArray[i]._idx;
@@ -378,7 +378,7 @@ inline int
FastS_SortSpec::Compare(const FastS_SortSpec *self, const SortData &a,
const SortData &b)
{
- const uint8_t * ref = &(self->_binarySortData[0]);
+ const uint8_t * ref = self->_binarySortData.data();
uint32_t len = a._len < b._len ? a._len : b._len;
int retval = memcmp(ref + a._idx,
ref + b._idx, len);
@@ -448,10 +448,10 @@ void
FastS_SortSpec::sortResults(RankedHit a[], uint32_t n, uint32_t topn)
{
initSortData(a, n);
- SortData * sortData = &_sortDataArray[0];
+ SortData * sortData = _sortDataArray.data();
{
Array<uint32_t> radixScratchPad(n, Alloc::alloc(0, MMAP_LIMIT));
- search::radix_sort(SortDataRadix(&_binarySortData[0]), StdSortDataCompare(&_binarySortData[0]), SortDataEof(), 1, sortData, n, &radixScratchPad[0], 0, 96, topn);
+ search::radix_sort(SortDataRadix(_binarySortData.data()), StdSortDataCompare(_binarySortData.data()), SortDataEof(), 1, sortData, n, radixScratchPad.data(), 0, 96, topn);
}
for (uint32_t i(0), m(_sortDataArray.size()); i < m; ++i) {
a[i]._rankValue = _sortDataArray[i]._rankValue;
diff --git a/searchlib/src/vespa/searchlib/diskindex/docidmapper.h b/searchlib/src/vespa/searchlib/diskindex/docidmapper.h
index 90bfa658a72..7c6f53720f2 100644
--- a/searchlib/src/vespa/searchlib/diskindex/docidmapper.h
+++ b/searchlib/src/vespa/searchlib/diskindex/docidmapper.h
@@ -42,9 +42,9 @@ public:
{ }
void setup(const DocIdMapping &mapping) {
- _selector = (mapping._selector != nullptr) ? &((*mapping._selector)[0]) : nullptr;
+ _selector = (mapping._selector != nullptr) ? mapping._selector->data() : nullptr;
_docIdLimit = mapping._docIdLimit;
- _selectorLimit = (mapping._selector != nullptr) ? (*mapping._selector).size() : 0u;
+ _selectorLimit = (mapping._selector != nullptr) ? mapping._selector->size() : 0u;
_selectorId = mapping._selectorId;
}
diff --git a/searchlib/src/vespa/searchlib/engine/proto_converter.cpp b/searchlib/src/vespa/searchlib/engine/proto_converter.cpp
index 77781d583cb..4eaa5b3eb65 100644
--- a/searchlib/src/vespa/searchlib/engine/proto_converter.cpp
+++ b/searchlib/src/vespa/searchlib/engine/proto_converter.cpp
@@ -135,7 +135,7 @@ ProtoConverter::search_reply_to_proto(const SearchReply &reply, ProtoSearchReply
}
}
}
- proto.set_grouping_blob(&reply.groupResult[0], reply.groupResult.size());
+ proto.set_grouping_blob(reply.groupResult.data(), reply.groupResult.size());
const auto &slime_trace = reply.propertiesMap.trace().lookup("slime");
proto.set_slime_trace(slime_trace.get().data(), slime_trace.get().size());
if (reply.my_issues) {
diff --git a/searchlib/src/vespa/searchlib/queryeval/hitcollector.cpp b/searchlib/src/vespa/searchlib/queryeval/hitcollector.cpp
index b851fc50518..8664b0fc14b 100644
--- a/searchlib/src/vespa/searchlib/queryeval/hitcollector.cpp
+++ b/searchlib/src/vespa/searchlib/queryeval/hitcollector.cpp
@@ -18,7 +18,7 @@ HitCollector::sortHitsByScore(size_t topn)
_scoreOrder.push_back(i);
}
ShiftBasedRadixSorter<uint32_t, IndirectScoreRadix, IndirectScoreComparator, 56, true>::
- radix_sort(IndirectScoreRadix(&_hits[0]), IndirectScoreComparator(&_hits[0]), &_scoreOrder[0], _scoreOrder.size(), 16, topn);
+ radix_sort(IndirectScoreRadix(_hits.data()), IndirectScoreComparator(_hits.data()), _scoreOrder.data(), _scoreOrder.size(), 16, topn);
_scoreOrder.resize(topn);
}
}
@@ -28,7 +28,7 @@ HitCollector::sortHitsByDocId()
{
if (_hitsSortOrder != SortOrder::DOC_ID) {
ShiftBasedRadixSorter<Hit, DocIdRadix, DocIdComparator, 24>::
- radix_sort(DocIdRadix(), DocIdComparator(), &_hits[0], _hits.size(), 16);
+ radix_sort(DocIdRadix(), DocIdComparator(), _hits.data(), _hits.size(), 16);
_hitsSortOrder = SortOrder::DOC_ID;
_scoreOrder.clear();
}
@@ -170,7 +170,7 @@ HitCollector::getSortedHitSequence(size_t max_hits)
{
size_t num_hits = std::min(_hits.size(), max_hits);
sortHitsByScore(num_hits);
- return SortedHitSequence(&_hits[0], &_scoreOrder[0], num_hits);
+ return SortedHitSequence(_hits.data(), _scoreOrder.data(), num_hits);
}
void
diff --git a/searchlib/src/vespa/searchlib/tensor/streamed_value_store.cpp b/searchlib/src/vespa/searchlib/tensor/streamed_value_store.cpp
index a668387e5bd..58e625e6aca 100644
--- a/searchlib/src/vespa/searchlib/tensor/streamed_value_store.cpp
+++ b/searchlib/src/vespa/searchlib/tensor/streamed_value_store.cpp
@@ -68,7 +68,7 @@ struct MyFastValueView final : Value {
{
const StringIdVector &labels = handle_view;
for (size_t i = 0; i < num_spaces; ++i) {
- ConstArrayRef<string_id> addr(&labels[i * num_mapped], num_mapped);
+ ConstArrayRef<string_id> addr(labels.data() + (i * num_mapped), num_mapped);
my_index.map.add_mapping(FastAddrMap::hash_labels(addr));
}
assert(my_index.map.size() == num_spaces);
diff --git a/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.cpp b/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.cpp
index d240e5a7c6c..d1bb464fc37 100644
--- a/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.cpp
+++ b/searchlib/src/vespa/searchlib/test/imported_attribute_fixture.cpp
@@ -10,10 +10,7 @@ namespace search {
namespace {
struct MockReadGuard : public IDocumentMetaStoreContext::IReadGuard {
- virtual const search::IDocumentMetaStore &get() const override {
- search::IDocumentMetaStore *nullStore = nullptr;
- return static_cast<search::IDocumentMetaStore &>(*nullStore);
- }
+ virtual const search::IDocumentMetaStore &get() const override { abort(); }
};
}
diff --git a/searchlib/src/vespa/searchlib/util/comprfile.cpp b/searchlib/src/vespa/searchlib/util/comprfile.cpp
index 61eeca6fc2d..bde246a1239 100644
--- a/searchlib/src/vespa/searchlib/util/comprfile.cpp
+++ b/searchlib/src/vespa/searchlib/util/comprfile.cpp
@@ -155,7 +155,7 @@ ComprFileReadBase::SetPosition(uint64_t newPosition,
bool readAll,
ComprFileDecodeContext &decodeContext,
int &bitOffset,
- FastOS_FileInterface &file,
+ FastOS_FileInterface *file,
uint64_t &fileReadByteOffset,
uint64_t fileSize,
ComprBuffer &cbuf)
@@ -176,7 +176,7 @@ ComprFileReadBase::SetPosition(uint64_t newPosition,
readAll,
decodeContext,
bitOffset,
- file,
+ *file,
fileReadByteOffset,
fileSize,
cbuf);
@@ -200,7 +200,7 @@ ComprFileReadBase::SetPosition(uint64_t newPosition,
readAll,
decodeContext,
bitOffset,
- file,
+ *file,
fileReadByteOffset,
fileSize,
cbuf);
@@ -221,9 +221,8 @@ ComprFileReadBase::SetPosition(uint64_t newPosition,
(cbuf.getUnitBitSize() - 1));
assert(pos <= static_cast<int64_t>(fileSize));
-
- file.SetPosition(pos);
- assert(pos == file.GetPosition());
+ file->SetPosition(pos);
+ assert(pos == file->GetPosition());
decodeContext.emptyBuffer(newPosition);
assert(decodeContext.getBitPos(bitOffset,
@@ -337,7 +336,7 @@ ComprFileReadContext::setPosition(uint64_t newPosition)
_readAll,
*_decodeContext,
_bitOffset,
- *_file,
+ _file,
_fileReadByteOffset,
_fileSize,
*this);
diff --git a/searchlib/src/vespa/searchlib/util/comprfile.h b/searchlib/src/vespa/searchlib/util/comprfile.h
index 2ee95a53235..dc8cf6185fc 100644
--- a/searchlib/src/vespa/searchlib/util/comprfile.h
+++ b/searchlib/src/vespa/searchlib/util/comprfile.h
@@ -76,7 +76,7 @@ public:
bool readAll,
ComprFileDecodeContext &decodeContext,
int &bitOffset,
- FastOS_FileInterface &file,
+ FastOS_FileInterface *file,
uint64_t &fileReadByteOffset,
uint64_t fileSize,
ComprBuffer &cbuf);
diff --git a/vdslib/src/tests/distribution/distributiontest.cpp b/vdslib/src/tests/distribution/distributiontest.cpp
index 4e050affec6..dee620738c6 100644
--- a/vdslib/src/tests/distribution/distributiontest.cpp
+++ b/vdslib/src/tests/distribution/distributiontest.cpp
@@ -369,7 +369,7 @@ TEST(DistributionTest, testHighSplitBit)
for (uint32_t bits = 33; bits < 36; ++bits) {
uint64_t base = 0x23456789;
- base |= (1 << bits);
+ base |= (1L << bits);
document::BucketId bid1 = document::BucketId(bits, base);
document::BucketId bid2 = document::BucketId(bits, base);
diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/DefaultZmsClient.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/DefaultZmsClient.java
index a4045016b78..7f16505c500 100644
--- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/DefaultZmsClient.java
+++ b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/client/zms/DefaultZmsClient.java
@@ -103,11 +103,11 @@ public class DefaultZmsClient extends ClientBase implements ZmsClient {
public void createProviderResourceGroup(AthenzDomain tenantDomain, AthenzIdentity providerService, String resourceGroup,
Set<RoleAction> roleActions, OAuthCredentials oAuthCredentials) {
URI uri = zmsUrl.resolve(String.format("domain/%s/provDomain/%s/provService/%s/resourceGroup/%s", tenantDomain.getName(), providerService.getDomainName(), providerService.getName(), resourceGroup));
- HttpUriRequest request = RequestBuilder.put()
+ RequestBuilder builder = RequestBuilder.put()
.setUri(uri)
- .addHeader(createCookieHeader(oAuthCredentials))
- .setEntity(toJsonStringEntity(new ResourceGroupRolesEntity(providerService, tenantDomain, roleActions, resourceGroup)))
- .build();
+ .setEntity(toJsonStringEntity(new ResourceGroupRolesEntity(providerService, tenantDomain, roleActions, resourceGroup)));
+ if (oAuthCredentials != null) builder.addHeader(createCookieHeader(oAuthCredentials));
+ HttpUriRequest request = builder.build();
execute(request, response -> readEntity(response, Void.class)); // Note: The ZMS API will actually return a json object that is similar to ProviderResourceGroupRolesRequestEntity
}
diff --git a/vespajlib/src/main/java/com/yahoo/config/ini/Ini.java b/vespajlib/src/main/java/com/yahoo/config/ini/Ini.java
new file mode 100644
index 00000000000..db1c3a1c98b
--- /dev/null
+++ b/vespajlib/src/main/java/com/yahoo/config/ini/Ini.java
@@ -0,0 +1,172 @@
+package com.yahoo.config.ini;
+
+import com.yahoo.yolean.Exceptions;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.nio.charset.StandardCharsets;
+import java.util.Collections;
+import java.util.Scanner;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * Basic <a href="https://en.wikipedia.org/wiki/INI_file">INI file</a> parser.
+ *
+ * <p>Supported syntax:</p>
+ *
+ * <ul>
+ * <li>Sections. Surrounded with '[' and ']'</li>
+ * <li>Optional quoting of values. When quoted, the quote character '"' can be escaped with '\'</li>
+ * <li>Comments, separate and in-line. Indicated with leading ';' or '#'</li>
+ * </ul>
+ *
+ * <p>Behaviour:</p>
+ *
+ * <ul>
+ * <li>Leading and trailing whitespace is always ignored if the value is unquoted</li>
+ * <li>Sections are sorted in alphabetic order. The same goes for keys within a section</li>
+ * <li>Empty string in the parsed Map holds section-less config keys</li>
+ * <li>Duplicated keys within the same section is an error</li>
+ * <li>Parsing discards comments</li>
+ * <li>No limitations on section or key names</li>
+ * </ul>
+ *
+ * @param entries Entries of the INI file, grouped by section.
+ *
+ * @author mpolden
+ */
+public record Ini(SortedMap<String, SortedMap<String, String>> entries) {
+
+ private static final char ESCAPE_C = '\\';
+ private static final char QUOTE_C = '"';
+ private static final String QUOTE = String.valueOf(QUOTE_C);
+
+ public Ini {
+ var copy = new TreeMap<>(entries);
+ copy.replaceAll((k, v) -> Collections.unmodifiableSortedMap(new TreeMap<>(copy.get(k))));
+ entries = Collections.unmodifiableSortedMap(copy);
+ }
+
+ /** Write the text representation of this to given output */
+ public void write(OutputStream output) {
+ PrintStream printer = new PrintStream(output, true);
+ entries.forEach((section, sectionEntries) -> {
+ if (!section.isEmpty()) {
+ printer.printf("[%s]\n", section);
+ }
+ sectionEntries.forEach((key, value) -> {
+ printer.printf("%s = %s\n", key, quote(value));
+ });
+ if (!section.equals(entries.lastKey())) {
+ printer.println();
+ }
+ });
+ }
+
+ /** Parse an INI configuration from given input */
+ public static Ini parse(InputStream input) {
+ SortedMap<String, SortedMap<String, String>> entries = new TreeMap<>();
+ Scanner scanner = new Scanner(input, StandardCharsets.UTF_8);
+ String section = "";
+ int lineNum = 0;
+ while (scanner.hasNextLine()) {
+ lineNum++;
+ String line = scanner.nextLine().trim();
+ // Blank line
+ if (line.isEmpty()) {
+ continue;
+ }
+ // Comment
+ if (isComment(line)) {
+ continue;
+ }
+ // Section
+ if (line.startsWith("[") && line.endsWith("]")) {
+ section = line.substring(1, line.length() - 1);
+ continue;
+ }
+ // Key-value entry
+ try {
+ Entry entry = Entry.parse(line);
+ entries.putIfAbsent(section, new TreeMap<>());
+ String prevValue = entries.computeIfAbsent(section, (k) -> new TreeMap<>())
+ .put(entry.key, entry.value);
+ if (prevValue != null) {
+ throw new IllegalArgumentException("Key '" + entry.key + "' duplicated in section '" +
+ section + "'");
+ }
+ } catch (IllegalArgumentException e) {
+ throw new IllegalArgumentException("Invalid entry on line " + lineNum + ": '" + line + "': " +
+ Exceptions.toMessageString(e));
+ }
+ }
+ return new Ini(entries);
+ }
+
+ private static boolean isComment(String s) {
+ return s.startsWith(";") || s.startsWith("#");
+ }
+
+ private static boolean requiresQuoting(String s) {
+ return s.isEmpty() || s.contains(QUOTE) || !s.equals(s.trim());
+ }
+
+ private static boolean unescapedQuoteAt(int index, String s) {
+ return s.charAt(index) == QUOTE_C && (index == 0 || s.charAt(index - 1) != ESCAPE_C);
+ }
+
+ private static String quote(String s) {
+ if (!requiresQuoting(s)) return s;
+ StringBuilder sb = new StringBuilder();
+ sb.append(QUOTE);
+ for (int i = 0; i < s.length(); i++) {
+ if (unescapedQuoteAt(i, s)) {
+ sb.append(ESCAPE_C);
+ }
+ sb.append(s.charAt(i));
+ }
+ sb.append(QUOTE);
+ return sb.toString();
+ }
+
+ private record Entry(String key, String value) {
+
+ static Entry parse(String s) {
+ int equalIndex = s.indexOf('=');
+ if (equalIndex < 0) throw new IllegalArgumentException("Expected key=[value]");
+ String key = s.substring(0, equalIndex).trim();
+ String value = s.substring(equalIndex + 1).trim();
+ return new Entry(key, dequote(value));
+ }
+
+ private static String dequote(String s) {
+ boolean quoted = s.startsWith(QUOTE);
+ int end = s.length();
+ boolean closeQuote = false;
+ for (int i = 0; i < s.length(); i++) {
+ closeQuote = quoted && i > 0 && unescapedQuoteAt(i, s);
+ boolean startComment = !quoted && isComment(String.valueOf(s.charAt(i)));
+ if (closeQuote || startComment) {
+ end = i;
+ if (quoted && end < s.length() - 1) {
+ String trailing = s.substring(end + 1).trim();
+ if (!isComment(trailing)) {
+ throw new IllegalArgumentException("Additional character(s) after end quote at column " + end);
+ }
+ }
+ break;
+ }
+ }
+ if (quoted && !closeQuote) {
+ throw new IllegalArgumentException("Missing closing quote");
+ }
+ int start = quoted ? 1 : 0;
+ String value = s.substring(start, end);
+ return quoted ? value : value.trim();
+ }
+
+ }
+
+}
diff --git a/vespajlib/src/test/java/com/yahoo/config/ini/IniTest.java b/vespajlib/src/test/java/com/yahoo/config/ini/IniTest.java
new file mode 100644
index 00000000000..7900f71d410
--- /dev/null
+++ b/vespajlib/src/test/java/com/yahoo/config/ini/IniTest.java
@@ -0,0 +1,101 @@
+package com.yahoo.config.ini;
+
+import org.junit.jupiter.api.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.nio.charset.StandardCharsets;
+import java.util.Map;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
+
+/**
+ * @author mpolden
+ */
+class IniTest {
+
+ @Test
+ public void parse() {
+ String example = """
+ key1 = no section
+ []
+ key2 = also no section ; in-line comment
+ ; a comment
+ # another comment
+
+ [foo]
+ key3 = "with spaces; and an escaped quote: \\" " # in-line comment
+ key4 = \\"single leading escaped quote
+ key1 = leading whitespace unquoted
+ key2 = " leading whitespace quoted"
+ key6 =
+
+ [bar]
+ key1=in section
+
+ [foo]
+ key5 = quote \\" in the middle
+ """;
+ Ini ini = parse(example);
+ assertEquals(Map.of("", Map.of("key1", "no section",
+ "key2", "also no section"),
+ "foo", Map.of("key1", "leading whitespace unquoted",
+ "key2", " leading whitespace quoted",
+ "key3", "with spaces; and an escaped quote: \\\" ",
+ "key4", "\\\"single leading escaped quote",
+ "key5", "quote \\\" in the middle",
+ "key6", ""),
+ "bar", Map.of("key1", "in section")),
+ ini.entries());
+
+ String expected = """
+ key1 = no section
+ key2 = also no section
+
+ [bar]
+ key1 = in section
+
+ [foo]
+ key1 = leading whitespace unquoted
+ key2 = " leading whitespace quoted"
+ key3 = "with spaces; and an escaped quote: \\" "
+ key4 = "\\"single leading escaped quote"
+ key5 = "quote \\" in the middle"
+ key6 = ""
+ """;
+ ByteArrayOutputStream out = new ByteArrayOutputStream();
+ ini.write(out);
+ String serialized = out.toString(StandardCharsets.UTF_8);
+ assertEquals(expected, serialized);
+ assertEquals(ini, parse(serialized));
+ }
+
+ @Test
+ public void parse_invalid() {
+ var tests = Map.of("key1\n",
+ "Invalid entry on line 1: 'key1': Expected key=[value]",
+
+ "key0 = ok\nkey1 = \"foo bar\" trailing stuff\n",
+ "Invalid entry on line 2: 'key1 = \"foo bar\" trailing stuff': Additional character(s) after end quote at column 8",
+
+ "[section1]\nkey0=foo\nkey0=bar\n",
+ "Invalid entry on line 3: 'key0=bar': Key 'key0' duplicated in section 'section1'",
+
+ "key1 = \"foo",
+ "Invalid entry on line 1: 'key1 = \"foo': Missing closing quote");
+ tests.forEach((input, errorMessage) -> {
+ try {
+ parse(input);
+ fail("Expected exception for input '" + input + "'");
+ } catch (IllegalArgumentException e) {
+ assertEquals(errorMessage, e.getMessage());
+ }
+ });
+ }
+
+ private static Ini parse(String ini) {
+ return Ini.parse(new ByteArrayInputStream(ini.getBytes(StandardCharsets.UTF_8)));
+ }
+
+}
diff --git a/vespalib/src/vespa/vespalib/stllike/asciistream.cpp b/vespalib/src/vespa/vespalib/stllike/asciistream.cpp
index 6b673363d2d..caacec196bd 100644
--- a/vespalib/src/vespa/vespalib/stllike/asciistream.cpp
+++ b/vespalib/src/vespa/vespalib/stllike/asciistream.cpp
@@ -429,22 +429,32 @@ printInt(unsigned long long r, char * tmp, uint8_t i)
return i;
}
+unsigned long long normalize(long long v, bool &negative) {
+ if (v < 0) {
+ negative = true;
+ if (v == std::numeric_limits<long long>::min()) {
+ // according to UBSAN:
+ // negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself
+ return v;
+ }
+ return -v;
+ }
+ return v;
+}
+
}
asciistream &
-asciistream::operator << (long long v)
+asciistream::operator << (long long v_in)
{
char tmp[72];
uint8_t i(sizeof(tmp));
bool negative(false);
- if (v == 0) {
+ if (v_in == 0) {
tmp[--i] = '0';
} else {
- if (v < 0) {
- v = -v;
- negative = true;
- }
+ unsigned long long v = normalize(v_in, negative);
switch (_base) {
case 2:
i = printInt<2>(v, tmp, i); break;
diff --git a/vespalib/src/vespa/vespalib/util/shared_string_repo.h b/vespalib/src/vespa/vespalib/util/shared_string_repo.h
index 353e4fd1ca4..7ed50bf0858 100644
--- a/vespalib/src/vespa/vespalib/util/shared_string_repo.h
+++ b/vespalib/src/vespa/vespalib/util/shared_string_repo.h
@@ -215,7 +215,12 @@ private:
string_id resolve(vespalib::stringref str) {
uint32_t direct_id = try_make_direct_id(str);
if (direct_id >= ID_BIAS) {
+#pragma GCC diagnostic push
+#if !defined(__clang__) && defined(__GNUC__) && __GNUC__ == 12
+#pragma GCC diagnostic ignored "-Warray-bounds"
+#endif
uint64_t full_hash = XXH3_64bits(str.data(), str.size());
+#pragma GCC diagnostic pop
uint32_t part = full_hash & PART_MASK;
uint32_t local_hash = full_hash >> PART_BITS;
uint32_t local_idx = _partitions[part].resolve(AltKey{str, local_hash});