summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--document/src/tests/arrayfieldvaluetest.cpp1
-rw-r--r--document/src/tests/documentcalculatortestcase.cpp63
-rw-r--r--document/src/tests/documenttestcase.cpp1
-rw-r--r--document/src/tests/primitivefieldvaluetest.cpp1
-rw-r--r--document/src/tests/structfieldvaluetest.cpp1
-rw-r--r--document/src/tests/weightedsetfieldvaluetest.cpp1
-rw-r--r--document/src/vespa/document/base/documentcalculator.cpp5
-rw-r--r--document/src/vespa/document/base/documentcalculator.h8
-rw-r--r--document/src/vespa/document/fieldvalue/document.cpp2
-rw-r--r--document/src/vespa/document/fieldvalue/serializablearray.cpp2
-rw-r--r--document/src/vespa/document/fieldvalue/structfieldvalue.cpp21
-rw-r--r--document/src/vespa/document/fieldvalue/structfieldvalue.h21
-rw-r--r--document/src/vespa/document/select/branch.cpp1
-rw-r--r--document/src/vespa/document/select/constant.cpp4
-rw-r--r--document/src/vespa/document/select/context.cpp26
-rw-r--r--document/src/vespa/document/select/context.h36
-rw-r--r--document/src/vespa/document/select/invalidconstant.cpp10
-rw-r--r--document/src/vespa/document/select/value.cpp1
-rw-r--r--document/src/vespa/document/select/valuenode.cpp15
-rw-r--r--document/src/vespa/document/select/valuenode.h22
-rw-r--r--document/src/vespa/document/select/variablemap.h15
-rw-r--r--document/src/vespa/document/serialization/vespadocumentdeserializer.cpp1
-rw-r--r--document/src/vespa/document/serialization/vespadocumentserializer.cpp2
-rw-r--r--document/src/vespa/document/update/assignfieldpathupdate.cpp10
-rw-r--r--document/src/vespa/document/update/clearvalueupdate.cpp6
-rw-r--r--documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.cpp20
-rw-r--r--documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.h13
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/types.cpp22
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/types.h16
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp2
-rw-r--r--persistence/src/vespa/persistence/dummyimpl/dummypersistence.cpp1
-rw-r--r--persistence/src/vespa/persistence/spi/docentry.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/feedoperation/moveoperation.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.cpp1
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/bucketdocuments.h1
-rw-r--r--searchlib/src/vespa/searchlib/docstore/documentstore.cpp2
-rw-r--r--searchlib/src/vespa/searchlib/docstore/visitcache.cpp7
-rw-r--r--searchlib/src/vespa/searchlib/docstore/visitcache.h6
-rw-r--r--storage/src/vespa/storage/storageserver/messagesink.cpp1
-rw-r--r--storageapi/src/vespa/storageapi/message/batch.cpp2
-rw-r--r--storageapi/src/vespa/storageapi/message/bucket.cpp8
-rw-r--r--storageapi/src/vespa/storageapi/message/persistence.cpp1
-rw-r--r--vsm/src/vespa/vsm/searcher/utf8stringfieldsearcherbase.cpp1
-rw-r--r--vsm/src/vespa/vsm/searcher/utf8substringsnippetmodifier.cpp1
44 files changed, 218 insertions, 166 deletions
diff --git a/document/src/tests/arrayfieldvaluetest.cpp b/document/src/tests/arrayfieldvaluetest.cpp
index 7f31e0c3b3a..0535edc495b 100644
--- a/document/src/tests/arrayfieldvaluetest.cpp
+++ b/document/src/tests/arrayfieldvaluetest.cpp
@@ -4,6 +4,7 @@
#include <vespa/document/serialization/vespadocumentdeserializer.h>
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/vespalib/objects/nbostream.h>
+#include <vespa/document/util/bytebuffer.h>
using vespalib::nbostream;
diff --git a/document/src/tests/documentcalculatortestcase.cpp b/document/src/tests/documentcalculatortestcase.cpp
index a292302ad61..bc112c80a8c 100644
--- a/document/src/tests/documentcalculatortestcase.cpp
+++ b/document/src/tests/documentcalculatortestcase.cpp
@@ -9,6 +9,7 @@
#include <vespa/document/fieldvalue/intfieldvalue.h>
#include <vespa/document/fieldvalue/longfieldvalue.h>
#include <vespa/document/fieldvalue/floatfieldvalue.h>
+#include <vespa/document/select/variablemap.h>
#include <vespa/vespalib/util/exceptions.h>
namespace document {
@@ -52,46 +53,42 @@ CPPUNIT_TEST_SUITE_REGISTRATION(DocumentCalculatorTest);
void
DocumentCalculatorTest::testConstant() {
- DocumentCalculator::VariableMap variables;
+ auto variables = std::make_unique<select::VariableMap>();
DocumentCalculator calc(getRepo(), "4.0");
- Document doc(*_testRepo.getDocumentType("testdoctype1"),
- DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
CPPUNIT_ASSERT_EQUAL(4.0, calc.evaluate(doc, std::move(variables)));
}
void
DocumentCalculatorTest::testSimple() {
- DocumentCalculator::VariableMap variables;
+ auto variables = std::make_unique<select::VariableMap>();
DocumentCalculator calc(getRepo(), "(3 + 5) / 2");
- Document doc(*_testRepo.getDocumentType("testdoctype1"),
- DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
CPPUNIT_ASSERT_EQUAL(4.0, calc.evaluate(doc, std::move(variables)));
}
void
DocumentCalculatorTest::testVariables() {
- DocumentCalculator::VariableMap variables;
- variables["x"] = 3.0;
- variables["y"] = 5.0;
+ auto variables = std::make_unique<select::VariableMap>();
+ (*variables)["x"] = 3.0;
+ (*variables)["y"] = 5.0;
DocumentCalculator calc(getRepo(), "($x + $y) / 2");
- Document doc(*_testRepo.getDocumentType("testdoctype1"),
- DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
CPPUNIT_ASSERT_EQUAL(4.0, calc.evaluate(doc, std::move(variables)));
}
void
DocumentCalculatorTest::testFields() {
- DocumentCalculator::VariableMap variables;
- variables["x"] = 3.0;
- variables["y"] = 5.0;
+ auto variables = std::make_unique<select::VariableMap>();
+ (*variables)["x"] = 3.0;
+ (*variables)["y"] = 5.0;
DocumentCalculator calc(getRepo(), "(testdoctype1.headerval + testdoctype1"
".hfloatval) / testdoctype1.headerlongval");
- Document doc(*_testRepo.getDocumentType("testdoctype1"),
- DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
doc.setValue(doc.getField("headerval"), IntFieldValue(5));
doc.setValue(doc.getField("hfloatval"), FloatFieldValue(3.0));
doc.setValue(doc.getField("headerlongval"), LongFieldValue(2));
@@ -100,14 +97,13 @@ DocumentCalculatorTest::testFields() {
void
DocumentCalculatorTest::testFieldsDivZero() {
- DocumentCalculator::VariableMap variables;
- variables["x"] = 3.0;
- variables["y"] = 5.0;
+ auto variables = std::make_unique<select::VariableMap>();
+ (*variables)["x"] = 3.0;
+ (*variables)["y"] = 5.0;
DocumentCalculator calc(getRepo(), "(testdoctype1.headerval + testdoctype1"
".hfloatval) / testdoctype1.headerlongval");
- Document doc(*_testRepo.getDocumentType("testdoctype1"),
- DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
doc.setValue(doc.getField("headerval"), IntFieldValue(5));
doc.setValue(doc.getField("hfloatval"), FloatFieldValue(3.0));
doc.setValue(doc.getField("headerlongval"), LongFieldValue(0));
@@ -121,11 +117,10 @@ DocumentCalculatorTest::testFieldsDivZero() {
void
DocumentCalculatorTest::testDivideByZero() {
- DocumentCalculator::VariableMap variables;
+ auto variables = std::make_unique<select::VariableMap>();
DocumentCalculator calc(getRepo(), "(3 + 5) / 0");
- Document doc(*_testRepo.getDocumentType("testdoctype1"),
- DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
try {
calc.evaluate(doc, std::move(variables));
CPPUNIT_ASSERT(false);
@@ -136,11 +131,10 @@ DocumentCalculatorTest::testDivideByZero() {
void
DocumentCalculatorTest::testModByZero() {
- DocumentCalculator::VariableMap variables;
+ auto variables = std::make_unique<select::VariableMap>();
DocumentCalculator calc(getRepo(), "(3 + 5) % 0");
- Document doc(*_testRepo.getDocumentType("testdoctype1"),
- DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
try {
calc.evaluate(doc, std::move(variables));
CPPUNIT_ASSERT(false);
@@ -151,12 +145,11 @@ DocumentCalculatorTest::testModByZero() {
void
DocumentCalculatorTest::testFieldNotSet() {
- DocumentCalculator::VariableMap variables;
+ auto variables = std::make_unique<select::VariableMap>();
DocumentCalculator calc(getRepo(), "(testdoctype1.headerval + testdoctype1"
".hfloatval) / testdoctype1.headerlongval");
- Document doc(*_testRepo.getDocumentType("testdoctype1"),
- DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
doc.setValue(doc.getField("hfloatval"), FloatFieldValue(3.0));
doc.setValue(doc.getField("headerlongval"), LongFieldValue(2));
try {
@@ -169,13 +162,12 @@ DocumentCalculatorTest::testFieldNotSet() {
void
DocumentCalculatorTest::testFieldNotFound() {
- DocumentCalculator::VariableMap variables;
+ auto variables = std::make_unique<select::VariableMap>();
DocumentCalculator calc(getRepo(),
"(testdoctype1.mynotfoundfield + testdoctype1"
".hfloatval) / testdoctype1.headerlongval");
- Document doc(*_testRepo.getDocumentType("testdoctype1"),
- DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
doc.setValue(doc.getField("hfloatval"), FloatFieldValue(3.0));
doc.setValue(doc.getField("headerlongval"), LongFieldValue(2));
try {
@@ -188,11 +180,10 @@ DocumentCalculatorTest::testFieldNotFound() {
void
DocumentCalculatorTest::testByteSubtractionZeroResult() {
- DocumentCalculator::VariableMap variables;
+ auto variables = std::make_unique<select::VariableMap>();
DocumentCalculator calc(getRepo(), "testdoctype1.byteval - 3");
- Document doc(*_testRepo.getDocumentType("testdoctype1"),
- DocumentId("doc:test:foo"));
+ Document doc(*_testRepo.getDocumentType("testdoctype1"), DocumentId("doc:test:foo"));
doc.setValue(doc.getField("byteval"), ByteFieldValue(3));
CPPUNIT_ASSERT_EQUAL(0.0, calc.evaluate(doc, std::move(variables)));
}
diff --git a/document/src/tests/documenttestcase.cpp b/document/src/tests/documenttestcase.cpp
index b100487a94e..c844f2cf5a2 100644
--- a/document/src/tests/documenttestcase.cpp
+++ b/document/src/tests/documenttestcase.cpp
@@ -11,6 +11,7 @@
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/document/util/serializableexceptions.h>
+#include <vespa/document/util/bytebuffer.h>
using vespalib::nbostream;
diff --git a/document/src/tests/primitivefieldvaluetest.cpp b/document/src/tests/primitivefieldvaluetest.cpp
index 15fd6e00959..018408a2d02 100644
--- a/document/src/tests/primitivefieldvaluetest.cpp
+++ b/document/src/tests/primitivefieldvaluetest.cpp
@@ -4,6 +4,7 @@
#include <vespa/document/serialization/vespadocumentdeserializer.h>
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/vespalib/objects/nbostream.h>
+#include <vespa/document/util/bytebuffer.h>
using vespalib::nbostream;
diff --git a/document/src/tests/structfieldvaluetest.cpp b/document/src/tests/structfieldvaluetest.cpp
index 9940f2de5b3..1b2fa17a79a 100644
--- a/document/src/tests/structfieldvaluetest.cpp
+++ b/document/src/tests/structfieldvaluetest.cpp
@@ -6,6 +6,7 @@
#include <vespa/document/serialization/vespadocumentdeserializer.h>
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/vespalib/objects/nbostream.h>
+#include <vespa/document/util/bytebuffer.h>
using vespalib::nbostream;
using document::config_builder::Struct;
diff --git a/document/src/tests/weightedsetfieldvaluetest.cpp b/document/src/tests/weightedsetfieldvaluetest.cpp
index 81b98da297f..68b94cd2f16 100644
--- a/document/src/tests/weightedsetfieldvaluetest.cpp
+++ b/document/src/tests/weightedsetfieldvaluetest.cpp
@@ -4,6 +4,7 @@
#include <vespa/document/serialization/vespadocumentdeserializer.h>
#include <vespa/vdstestlib/cppunit/macros.h>
#include <vespa/vespalib/objects/nbostream.h>
+#include <vespa/document/util/bytebuffer.h>
using vespalib::nbostream;
diff --git a/document/src/vespa/document/base/documentcalculator.cpp b/document/src/vespa/document/base/documentcalculator.cpp
index 7a83d80764c..24afdee3bd1 100644
--- a/document/src/vespa/document/base/documentcalculator.cpp
+++ b/document/src/vespa/document/base/documentcalculator.cpp
@@ -5,6 +5,7 @@
#include <vespa/document/select/compare.h>
#include <vespa/document/select/parser.h>
#include <vespa/document/select/valuenode.h>
+#include <vespa/document/select/variablemap.h>
#include <vespa/vespalib/util/exceptions.h>
namespace document {
@@ -21,13 +22,13 @@ DocumentCalculator::DocumentCalculator(
DocumentCalculator::~DocumentCalculator() { }
double
-DocumentCalculator::evaluate(const Document& doc, VariableMap && variables)
+DocumentCalculator::evaluate(const Document& doc, std::unique_ptr<select::VariableMap> variables)
{
select::Compare& compare(static_cast<select::Compare&>(*_selectionNode));
const select::ValueNode& left = compare.getLeft();
select::Context context(doc);
- context._variables = std::move(variables);
+ context.setVariableMap(std::move(variables));
std::unique_ptr<select::Value> value = left.getValue(context);
select::NumberValue* num = dynamic_cast<select::NumberValue*>(value.get());
diff --git a/document/src/vespa/document/base/documentcalculator.h b/document/src/vespa/document/base/documentcalculator.h
index 7e1feaf5688..fc9eb73dea2 100644
--- a/document/src/vespa/document/base/documentcalculator.h
+++ b/document/src/vespa/document/base/documentcalculator.h
@@ -2,18 +2,18 @@
#pragma once
#include <vespa/document/select/node.h>
-#include <vespa/vespalib/stllike/hash_map.h>
namespace document {
+
+namespace select { class VariableMap; }
+
class DocumentTypeRepo;
class DocumentCalculator {
public:
- using VariableMap = vespalib::hash_map<vespalib::string, double>;
-
DocumentCalculator(const DocumentTypeRepo& repo, const vespalib::string& expression);
~DocumentCalculator();
- double evaluate(const Document& doc, VariableMap && variables);
+ double evaluate(const Document& doc, std::unique_ptr<select::VariableMap> variables);
private:
std::unique_ptr<select::Node> _selectionNode;
diff --git a/document/src/vespa/document/fieldvalue/document.cpp b/document/src/vespa/document/fieldvalue/document.cpp
index 8e8f6ab52d8..29f487df989 100644
--- a/document/src/vespa/document/fieldvalue/document.cpp
+++ b/document/src/vespa/document/fieldvalue/document.cpp
@@ -9,6 +9,7 @@
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/document/util/serializableexceptions.h>
#include <vespa/document/base/exceptions.h>
+#include <vespa/document/util/bytebuffer.h>
#include <sstream>
@@ -17,7 +18,6 @@ using vespalib::make_string;
using vespalib::IllegalArgumentException;
using vespalib::IllegalStateException;
-
namespace document {
namespace {
diff --git a/document/src/vespa/document/fieldvalue/serializablearray.cpp b/document/src/vespa/document/fieldvalue/serializablearray.cpp
index 77204490dc0..f5aa25d4d0c 100644
--- a/document/src/vespa/document/fieldvalue/serializablearray.cpp
+++ b/document/src/vespa/document/fieldvalue/serializablearray.cpp
@@ -3,6 +3,8 @@
#include <vespa/document/util/serializableexceptions.h>
#include <vespa/document/util/bytebuffer.h>
#include <vespa/vespalib/stllike/hash_map.hpp>
+#include <vespa/vespalib/data/databuffer.h>
+#include <vespa/document/util/compressor.h>
#include <vespa/log/log.h>
LOG_SETUP(".document.serializable-array");
diff --git a/document/src/vespa/document/fieldvalue/structfieldvalue.cpp b/document/src/vespa/document/fieldvalue/structfieldvalue.cpp
index d3cbcb77ba2..74805ce3f10 100644
--- a/document/src/vespa/document/fieldvalue/structfieldvalue.cpp
+++ b/document/src/vespa/document/fieldvalue/structfieldvalue.cpp
@@ -10,6 +10,7 @@
#include <vespa/document/datatype/positiondatatype.h>
#include <vespa/document/util/serializableexceptions.h>
#include <vespa/document/base/exceptions.h>
+#include <vespa/document/util/bytebuffer.h>
#include <vespa/log/log.h>
LOG_SETUP(".document.structfieldvalue");
@@ -42,6 +43,26 @@ StructFieldValue::~StructFieldValue() { }
StructFieldValue::Chunks::~Chunks() { }
void
+StructFieldValue::Chunks::push_back(SerializableArray::UP item) {
+ assert(_sz < 2);
+ _chunks[_sz++].reset(item.release());
+}
+
+void
+StructFieldValue::Chunks::clear() {
+ _chunks[0].reset();
+ _chunks[1].reset();
+ _sz = 0;
+}
+
+void
+StructFieldValue::Chunks::swap(Chunks & rhs) {
+ _chunks[0].swap(rhs._chunks[0]);
+ _chunks[1].swap(rhs._chunks[1]);
+ std::swap(_sz, rhs._sz);
+}
+
+void
StructFieldValue::swap(StructFieldValue & rhs)
{
StructuredFieldValue::swap(rhs);
diff --git a/document/src/vespa/document/fieldvalue/structfieldvalue.h b/document/src/vespa/document/fieldvalue/structfieldvalue.h
index d57c8b965f7..01a0e732e43 100644
--- a/document/src/vespa/document/fieldvalue/structfieldvalue.h
+++ b/document/src/vespa/document/fieldvalue/structfieldvalue.h
@@ -11,8 +11,6 @@
#include "structuredfieldvalue.h"
#include "serializablearray.h"
-#include <vespa/document/util/compressionconfig.h>
-#include <vector>
namespace document {
@@ -33,24 +31,13 @@ public:
~Chunks();
SerializableArray & operator [] (size_t i) { return *_chunks[i]; }
const SerializableArray & operator [] (size_t i) const { return *_chunks[i]; }
- void push_back(SerializableArray::UP item) {
- assert(_sz < 2);
- _chunks[_sz++].reset(item.release());
- }
+ VESPA_DLL_LOCAL void push_back(SerializableArray::UP item);
SerializableArray & back() { return *_chunks[_sz-1]; }
const SerializableArray & back() const { return *_chunks[_sz-1]; }
size_t size() const { return _sz; }
bool empty() const { return _sz == 0; }
- void clear() {
- _chunks[0].reset();
- _chunks[1].reset();
- _sz = 0;
- }
- void swap(Chunks & rhs) {
- _chunks[0].swap(rhs._chunks[0]);
- _chunks[1].swap(rhs._chunks[1]);
- std::swap(_sz, rhs._sz);
- }
+ VESPA_DLL_LOCAL void clear();
+ VESPA_DLL_LOCAL void swap(Chunks & rhs);
private:
SerializableArray::CP _chunks[2];
size_t _sz;
@@ -79,7 +66,7 @@ public:
void lazyDeserialize(const FixedTypeRepo &repo,
uint16_t version,
SerializableArray::EntryMap && fields,
- ByteBuffer::UP buffer,
+ std::unique_ptr<ByteBuffer> buffer,
CompressionConfig::Type comp_type,
int32_t uncompressed_length);
diff --git a/document/src/vespa/document/select/branch.cpp b/document/src/vespa/document/select/branch.cpp
index 85e42dd74b5..ea0d0ef5646 100644
--- a/document/src/vespa/document/select/branch.cpp
+++ b/document/src/vespa/document/select/branch.cpp
@@ -3,6 +3,7 @@
#include "branch.h"
#include "visitor.h"
#include <cassert>
+#include <ostream>
namespace document {
namespace select {
diff --git a/document/src/vespa/document/select/constant.cpp b/document/src/vespa/document/select/constant.cpp
index a48492685f3..0e2fdc2ecec 100644
--- a/document/src/vespa/document/select/constant.cpp
+++ b/document/src/vespa/document/select/constant.cpp
@@ -3,6 +3,7 @@
#include "constant.h"
#include "visitor.h"
#include <cassert>
+#include <ostream>
namespace document::select {
@@ -46,8 +47,7 @@ Constant::visit(Visitor &v) const
void
-Constant::print(std::ostream& out, bool,
- const std::string&) const
+Constant::print(std::ostream& out, bool, const std::string&) const
{
if (_parentheses) out << '(';
out << _name;
diff --git a/document/src/vespa/document/select/context.cpp b/document/src/vespa/document/select/context.cpp
index 44d005e9db2..ef29770ddc8 100644
--- a/document/src/vespa/document/select/context.cpp
+++ b/document/src/vespa/document/select/context.cpp
@@ -1,11 +1,12 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "context.h"
+#include "variablemap.h"
+#include <vespa/document/select/value.h>
-namespace document {
-namespace select {
+namespace document::select {
-Context::Context(void)
+Context::Context()
: _doc(NULL),
_docId(NULL),
_docUpdate(NULL),
@@ -35,5 +36,20 @@ Context::Context(const DocumentUpdate& docUpdate)
Context::~Context() { }
-} // select
-} // document
+std::unique_ptr<Value>
+Context::getValue(const vespalib::string & value) const {
+ VariableMap::const_iterator iter = _variables->find(value);
+
+ if (iter != _variables->end()) {
+ return std::make_unique<FloatValue>(iter->second);
+ } else {
+ return std::make_unique<FloatValue>(0.0);
+ }
+}
+
+void
+Context::setVariableMap(std::unique_ptr<VariableMap> map) {
+ _variables = std::move(map);
+}
+
+}
diff --git a/document/src/vespa/document/select/context.h b/document/src/vespa/document/select/context.h
index 11a3a2be51c..0e347e22bb5 100644
--- a/document/src/vespa/document/select/context.h
+++ b/document/src/vespa/document/select/context.h
@@ -2,9 +2,9 @@
#pragma once
#include <vespa/vespalib/stllike/string.h>
-#include <vespa/vespalib/stllike/hash_map.h>
+#include <memory>
-namespace document{
+namespace document {
class Document;
class DocumentId;
@@ -12,24 +12,26 @@ class DocumentUpdate;
namespace select {
-class Context
-{
-public:
- typedef vespalib::hash_map<vespalib::string, double> VariableMap;
+class Value;
+class VariableMap;
+class Context {
+public:
Context();
- Context(const Document& doc);
- Context(const DocumentId& docId);
- Context(const DocumentUpdate& docUpdate);
+ Context(const Document & doc);
+ Context(const DocumentId & docId);
+ Context(const DocumentUpdate & docUpdate);
virtual ~Context();
- const Document * _doc;
- const DocumentId * _docId;
- const DocumentUpdate * _docUpdate;
- VariableMap _variables;
-};
-
-} // select
-} // document
+ void setVariableMap(std::unique_ptr<VariableMap> map);
+ std::unique_ptr<Value> getValue(const vespalib::string & value) const;
+ const Document *_doc;
+ const DocumentId *_docId;
+ const DocumentUpdate *_docUpdate;
+private:
+ std::unique_ptr<VariableMap> _variables;
+};
+}
+}
diff --git a/document/src/vespa/document/select/invalidconstant.cpp b/document/src/vespa/document/select/invalidconstant.cpp
index 793e34c7bc5..53e3a6e1647 100644
--- a/document/src/vespa/document/select/invalidconstant.cpp
+++ b/document/src/vespa/document/select/invalidconstant.cpp
@@ -2,9 +2,9 @@
#include "invalidconstant.h"
#include "visitor.h"
+#include <ostream>
-namespace document {
-namespace select {
+namespace document::select {
InvalidConstant::InvalidConstant(const vespalib::stringref & value)
: Node(value)
@@ -26,13 +26,11 @@ InvalidConstant::visit(Visitor &v) const
void
-InvalidConstant::print(std::ostream& out, bool,
- const std::string&) const
+InvalidConstant::print(std::ostream& out, bool, const std::string&) const
{
if (_parentheses) out << '(';
out << _name;
if (_parentheses) out << ')';
}
-} // select
-} // document
+}
diff --git a/document/src/vespa/document/select/value.cpp b/document/src/vespa/document/select/value.cpp
index 7638ba3c36e..7a453fe5cf3 100644
--- a/document/src/vespa/document/select/value.cpp
+++ b/document/src/vespa/document/select/value.cpp
@@ -2,7 +2,6 @@
#include "value.h"
#include "operator.h"
-#include <cstdint>
namespace document {
namespace select {
diff --git a/document/src/vespa/document/select/valuenode.cpp b/document/src/vespa/document/select/valuenode.cpp
index 49eab9d75ff..96bc46bd54e 100644
--- a/document/src/vespa/document/select/valuenode.cpp
+++ b/document/src/vespa/document/select/valuenode.cpp
@@ -36,6 +36,13 @@ namespace {
}
}
+std::unique_ptr<Value>
+ValueNode::defaultTrace(std::unique_ptr<Value> val, std::ostream& out) const
+{
+ out << "Returning value " << *val << ".\n";
+ return std::move(val);
+}
+
InvalidValueNode::InvalidValueNode(const vespalib::stringref & name)
: _name(name)
{ }
@@ -147,13 +154,7 @@ CurrentTimeValueNode::print(std::ostream& out, bool verbose,
std::unique_ptr<Value>
VariableValueNode::getValue(const Context& context) const {
- VariableMap::const_iterator iter = context._variables.find(_value);
-
- if (iter != context._variables.end()) {
- return std::unique_ptr<Value>(new FloatValue(iter->second));
- } else {
- return std::unique_ptr<Value>(new FloatValue(0.0));
- }
+ return context.getValue(_value);
}
diff --git a/document/src/vespa/document/select/valuenode.h b/document/src/vespa/document/select/valuenode.h
index e3f0b4c4a94..d56b1468508 100644
--- a/document/src/vespa/document/select/valuenode.h
+++ b/document/src/vespa/document/select/valuenode.h
@@ -29,34 +29,25 @@ namespace select {
class ValueNode : public Printable
{
public:
- typedef std::unique_ptr<ValueNode> UP;
- typedef Context::VariableMap VariableMap;
+ using UP = std::unique_ptr<ValueNode>;
ValueNode() : _parentheses(false) {}
virtual ~ValueNode() {}
void setParentheses() { _parentheses = true; }
-
- void clearParentheses()
- {
- _parentheses = false;
- }
-
+ void clearParentheses() { _parentheses = false; }
bool hadParentheses() const { return _parentheses; }
virtual std::unique_ptr<Value>
getValue(const Context& context) const = 0;
virtual std::unique_ptr<Value>
- traceValue(const Context &context,
- std::ostream &out) const {
+ traceValue(const Context &context, std::ostream &out) const {
return defaultTrace(getValue(context), out);
}
virtual void print(std::ostream& out, bool verbose, const std::string& indent) const override = 0;
-
virtual void visit(Visitor&) const = 0;
-
virtual ValueNode::UP clone() const = 0;
private:
bool _parentheses; // Set to true if parentheses was used around this part
@@ -70,12 +61,7 @@ protected:
return ret;
}
- std::unique_ptr<Value> defaultTrace(std::unique_ptr<Value> val,
- std::ostream& out) const
- {
- out << "Returning value " << *val << ".\n";
- return std::move(val);
- }
+ std::unique_ptr<Value> defaultTrace(std::unique_ptr<Value> val, std::ostream& out) const;
};
class InvalidValueNode : public ValueNode
diff --git a/document/src/vespa/document/select/variablemap.h b/document/src/vespa/document/select/variablemap.h
new file mode 100644
index 00000000000..86a1cb85e63
--- /dev/null
+++ b/document/src/vespa/document/select/variablemap.h
@@ -0,0 +1,15 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include <vespa/vespalib/stllike/hash_map.h>
+#include <vespa/vespalib/stllike/string.h>
+
+namespace document::select {
+
+using VariableMapT = vespalib::hash_map<vespalib::string, double>;
+
+class VariableMap : public VariableMapT {
+public:
+ using VariableMapT::VariableMapT;
+};
+
+}
diff --git a/document/src/vespa/document/serialization/vespadocumentdeserializer.cpp b/document/src/vespa/document/serialization/vespadocumentdeserializer.cpp
index 93856b376aa..b2a2bd098a6 100644
--- a/document/src/vespa/document/serialization/vespadocumentdeserializer.cpp
+++ b/document/src/vespa/document/serialization/vespadocumentdeserializer.cpp
@@ -27,6 +27,7 @@
#include <vespa/document/util/serializableexceptions.h>
#include <vespa/document/base/exceptions.h>
#include <vespa/vespalib/objects/nbostream.h>
+#include <vespa/document/util/bytebuffer.h>
#include <vespa/log/log.h>
LOG_SETUP(".vespadocumentdeserializer");
diff --git a/document/src/vespa/document/serialization/vespadocumentserializer.cpp b/document/src/vespa/document/serialization/vespadocumentserializer.cpp
index 11317f2ff0a..1f6a4a4f0b0 100644
--- a/document/src/vespa/document/serialization/vespadocumentserializer.cpp
+++ b/document/src/vespa/document/serialization/vespadocumentserializer.cpp
@@ -24,7 +24,9 @@
#include <vespa/document/update/fieldpathupdates.h>
#include <vespa/vespalib/data/slime/binary_format.h>
#include <vespa/vespalib/objects/nbostream.h>
+#include <vespa/vespalib/data/databuffer.h>
#include <vespa/eval/tensor/serialization/typed_binary_format.h>
+#include <vespa/document/util/compressor.h>
using std::make_pair;
using std::pair;
diff --git a/document/src/vespa/document/update/assignfieldpathupdate.cpp b/document/src/vespa/document/update/assignfieldpathupdate.cpp
index 0a676c88df2..4b8ee510576 100644
--- a/document/src/vespa/document/update/assignfieldpathupdate.cpp
+++ b/document/src/vespa/document/update/assignfieldpathupdate.cpp
@@ -1,9 +1,10 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include "assignfieldpathupdate.h"
#include <vespa/document/fieldvalue/fieldvalues.h>
-#include <vespa/document/repo/fixedtyperepo.h>
#include <vespa/document/select/parser.h>
+#include <vespa/document/select/variablemap.h>
#include <vespa/document/serialization/vespadocumentdeserializer.h>
-#include <vespa/document/update/assignfieldpathupdate.h>
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/vespalib/util/exceptions.h>
#include <boost/numeric/conversion/cast.hpp>
@@ -108,7 +109,8 @@ FieldValue::IteratorHandler::ModificationStatus
AssignFieldPathUpdate::AssignExpressionIteratorHandler::doModify(FieldValue& fv) {
LOG(spam, "fv = %s", fv.toString().c_str());
if (fv.inherits(NumericFieldValueBase::classId)) {
- DocumentCalculator::VariableMap vars;
+ std::unique_ptr<select::VariableMap> varHolder = std::make_unique<select::VariableMap>();
+ select::VariableMap & vars = *varHolder;
for (VariableMap::const_iterator i(getVariables().begin()),
e(getVariables().end()); i != e; ++i)
{
@@ -122,7 +124,7 @@ AssignFieldPathUpdate::AssignExpressionIteratorHandler::doModify(FieldValue& fv)
vars["value"] = fv.getAsDouble();
try {
- double res = _calc.evaluate(_doc, std::move(vars));
+ double res = _calc.evaluate(_doc, std::move(varHolder));
if (_removeIfZero && static_cast<uint64_t>(res) == 0) {
return REMOVED;
} else {
diff --git a/document/src/vespa/document/update/clearvalueupdate.cpp b/document/src/vespa/document/update/clearvalueupdate.cpp
index 13143e004ee..cb526852299 100644
--- a/document/src/vespa/document/update/clearvalueupdate.cpp
+++ b/document/src/vespa/document/update/clearvalueupdate.cpp
@@ -1,15 +1,15 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include "clearvalueupdate.h"
#include <vespa/document/base/field.h>
-#include <vespa/document/update/clearvalueupdate.h>
#include <vespa/document/fieldvalue/document.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <ostream>
using vespalib::IllegalArgumentException;
using vespalib::IllegalStateException;
-namespace document
-{
+namespace document {
IMPLEMENT_IDENTIFIABLE(ClearValueUpdate, ValueUpdate);
diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.cpp b/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.cpp
index 4d260a8e81f..ba4d0cff079 100644
--- a/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.cpp
+++ b/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.cpp
@@ -1,12 +1,26 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
#include "messagetypepolicy.h"
#include <vespa/documentapi/messagebus/documentprotocol.h>
+#include <vespa/messagebus/routing/route.h>
+#include <vespa/messagebus/routing/routingcontext.h>
#include <vespa/vespalib/stllike/hash_map.hpp>
using vespa::config::content::MessagetyperouteselectorpolicyConfig;
namespace documentapi {
+namespace policy {
+
+using MessageTypeMapT = vespalib::hash_map<int, mbus::Route>;
+
+class MessageTypeMap : public MessageTypeMapT {
+public:
+ using MessageTypeMapT::MessageTypeMapT;
+};
+
+}
+
MessageTypePolicy::MessageTypePolicy(const config::ConfigUri & configUri) :
mbus::IRoutingPolicy(),
config::IFetcherCallback<MessagetyperouteselectorpolicyConfig>(),
@@ -23,7 +37,7 @@ MessageTypePolicy::~MessageTypePolicy() {}
void
MessageTypePolicy::configure(std::unique_ptr<MessagetyperouteselectorpolicyConfig> cfg)
{
- std::unique_ptr<MessageTypeMap> map(new MessageTypeMap);
+ auto map = std::make_unique<policy::MessageTypeMap>();
for (size_t i(0), m(cfg->route.size()); i < m; i++) {
const MessagetyperouteselectorpolicyConfig::Route & r = cfg->route[i];
(*map)[r.messagetype] = mbus::Route::parse(r.name);
@@ -38,8 +52,8 @@ void
MessageTypePolicy::select(mbus::RoutingContext & context)
{
int messageType = context.getMessage().getType();
- std::shared_ptr<MessageTypeMap> map = _map.get();
- MessageTypeMap::const_iterator found = map->find(messageType);
+ std::shared_ptr<policy::MessageTypeMap> map = _map.get();
+ policy::MessageTypeMap::const_iterator found = map->find(messageType);
if (found != map->end()) {
context.addChild(found->second);
} else {
diff --git a/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.h b/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.h
index d9a324a79c5..18ae4d1acb8 100644
--- a/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.h
+++ b/documentapi/src/vespa/documentapi/messagebus/policies/messagetypepolicy.h
@@ -1,20 +1,20 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/document/select/node.h>
-#include <map>
#include <vespa/messagebus/routing/iroutingpolicy.h>
-#include <vespa/messagebus/routing/route.h>
-#include <vespa/messagebus/routing/routingcontext.h>
-#include <vespa/vespalib/util/sync.h>
#include <vespa/vespalib/util/ptrholder.h>
#include <vespa/config-messagetyperouteselectorpolicy.h>
#include <vespa/config/config.h>
#include <vespa/config/helper/configfetcher.h>
#include <vespa/documentapi/common.h>
+namespace mbus {
+ class RoutingContext;
+ class Route;
+}
namespace documentapi {
+namespace policy {class MessageTypeMap; }
/**
* This policy is responsible for selecting among the given recipient routes
* according to the configured document selection properties. To factilitate
@@ -26,8 +26,7 @@ class MessageTypePolicy : public mbus::IRoutingPolicy,
public config::IFetcherCallback<vespa::config::content::MessagetyperouteselectorpolicyConfig>
{
private:
- typedef vespalib::hash_map<int, mbus::Route> MessageTypeMap;
- typedef vespalib::PtrHolder<MessageTypeMap> MessageTypeHolder;
+ typedef vespalib::PtrHolder<policy::MessageTypeMap> MessageTypeHolder;
typedef vespalib::PtrHolder<mbus::Route> RouteHolder;
MessageTypeHolder _map;
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/types.cpp b/memfilepersistence/src/vespa/memfilepersistence/common/types.cpp
index f02423cb194..2bc85fbc422 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/types.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/types.cpp
@@ -1,11 +1,11 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "types.h"
-#include <sstream>
#include <vespa/vespalib/util/exceptions.h>
+#include <cassert>
+#include <sstream>
-namespace storage {
-namespace memfile {
+namespace storage::memfile {
const framework::MicroSecTime Types::MAX_TIMESTAMP(framework::MicroSecTime::max());
const framework::MicroSecTime Types::UNSET_TIMESTAMP(0);
@@ -34,5 +34,17 @@ operator<<(std::ostream& os, const DataLocation& loc)
return os;
}
-} // memfile
-} // storage
+const char*
+Types::getMemFileFlagName(MemFileFlag flag) {
+ switch (flag) {
+ case FILE_EXIST: return "FILE_EXIST";
+ case HEADER_BLOCK_READ: return "HEADER_BLOCK_READ";
+ case BODY_BLOCK_READ: return "BODY_BLOCK_READ";
+ case BUCKET_INFO_OUTDATED: return "BUCKET_INFO_OUTDATED";
+ case SLOTS_ALTERED: return "SLOTS_ALTERED";
+ case LEGAL_MEMFILE_FLAGS: assert(false); // Not a single flag
+ default: return "INVALID";
+ }
+}
+
+}
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/types.h b/memfilepersistence/src/vespa/memfilepersistence/common/types.h
index 7758e6091ac..c1f29571037 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/types.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/types.h
@@ -173,21 +173,9 @@ struct Types {
}
}
- static const char* getMemFileFlagName(MemFileFlag flag) {
- switch (flag) {
- case FILE_EXIST: return "FILE_EXIST";
- case HEADER_BLOCK_READ: return "HEADER_BLOCK_READ";
- case BODY_BLOCK_READ: return "BODY_BLOCK_READ";
- case BUCKET_INFO_OUTDATED: return "BUCKET_INFO_OUTDATED";
- case SLOTS_ALTERED: return "SLOTS_ALTERED";
- case LEGAL_MEMFILE_FLAGS: assert(false); // Not a single flag
- default: return "INVALID";
- }
- }
-
- static void verifyLegalFlags(uint32_t flags, uint32_t legal,
- const char* operation);
+ static const char* getMemFileFlagName(MemFileFlag flag);
+ static void verifyLegalFlags(uint32_t flags, uint32_t legal, const char* operation);
protected:
~Types() {} // Noone should refer to objects as Types objects
};
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp b/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp
index ccf63ed3504..6bda3d69113 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/simplememfileiobuffer.cpp
@@ -5,8 +5,8 @@
#include <vespa/document/datatype/documenttype.h>
#include <vespa/memfilepersistence/common/environment.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/document/util/bytebuffer.h>
#include <vespa/log/log.h>
-
LOG_SETUP(".memfile.simpleiobuffer");
namespace storage::memfile {
diff --git a/persistence/src/vespa/persistence/dummyimpl/dummypersistence.cpp b/persistence/src/vespa/persistence/dummyimpl/dummypersistence.cpp
index d2a3ab3be65..05e21096fef 100644
--- a/persistence/src/vespa/persistence/dummyimpl/dummypersistence.cpp
+++ b/persistence/src/vespa/persistence/dummyimpl/dummypersistence.cpp
@@ -9,6 +9,7 @@
#include <vespa/document/fieldset/fieldsetrepo.h>
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/vespalib/util/atomic.h>
#include <vespa/vespalib/stllike/hash_map.hpp>
#include <vespa/log/log.h>
diff --git a/persistence/src/vespa/persistence/spi/docentry.cpp b/persistence/src/vespa/persistence/spi/docentry.cpp
index c9ceda982e0..1061a06fd28 100644
--- a/persistence/src/vespa/persistence/spi/docentry.cpp
+++ b/persistence/src/vespa/persistence/spi/docentry.cpp
@@ -3,6 +3,7 @@
#include "docentry.h"
#include <vespa/document/fieldvalue/document.h>
#include <sstream>
+#include <cassert>
namespace storage {
namespace spi {
diff --git a/searchcore/src/vespa/searchcore/proton/feedoperation/moveoperation.cpp b/searchcore/src/vespa/searchcore/proton/feedoperation/moveoperation.cpp
index 2a369cb821b..2cbfee1d5c9 100644
--- a/searchcore/src/vespa/searchcore/proton/feedoperation/moveoperation.cpp
+++ b/searchcore/src/vespa/searchcore/proton/feedoperation/moveoperation.cpp
@@ -1,8 +1,8 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "moveoperation.h"
-#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/document/fieldvalue/document.h>
+#include <cassert>
using document::BucketId;
using document::Document;
diff --git a/searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.cpp b/searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.cpp
index 9df67a6bf11..79629410b00 100644
--- a/searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.cpp
+++ b/searchcore/src/vespa/searchcore/proton/persistenceengine/document_iterator.cpp
@@ -4,6 +4,7 @@
#include <vespa/document/select/gid_filter.h>
#include <vespa/document/select/node.h>
#include <vespa/vespalib/objects/nbostream.h>
+#include <vespa/vespalib/stllike/hash_map.h>
#include <vespa/log/log.h>
LOG_SETUP(".proton.persistenceengine.document_iterator");
diff --git a/searchcore/src/vespa/searchcore/proton/test/bucketdocuments.h b/searchcore/src/vespa/searchcore/proton/test/bucketdocuments.h
index b2fc3ff6dbc..f0d10d9ecbd 100644
--- a/searchcore/src/vespa/searchcore/proton/test/bucketdocuments.h
+++ b/searchcore/src/vespa/searchcore/proton/test/bucketdocuments.h
@@ -2,6 +2,7 @@
#pragma once
#include "document.h"
+#include <cassert>
namespace proton {
diff --git a/searchlib/src/vespa/searchlib/docstore/documentstore.cpp b/searchlib/src/vespa/searchlib/docstore/documentstore.cpp
index dd6a0f07197..fd7df29cd49 100644
--- a/searchlib/src/vespa/searchlib/docstore/documentstore.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/documentstore.cpp
@@ -5,6 +5,8 @@
#include "visitcache.h"
#include "ibucketizer.h"
#include <vespa/vespalib/stllike/cache.hpp>
+#include <vespa/vespalib/data/databuffer.h>
+#include <vespa/document/util/compressor.h>
namespace search {
diff --git a/searchlib/src/vespa/searchlib/docstore/visitcache.cpp b/searchlib/src/vespa/searchlib/docstore/visitcache.cpp
index c424cb61d8c..8fac288a23a 100644
--- a/searchlib/src/vespa/searchlib/docstore/visitcache.cpp
+++ b/searchlib/src/vespa/searchlib/docstore/visitcache.cpp
@@ -4,9 +4,10 @@
#include "ibucketizer.h"
#include <vespa/vespalib/stllike/cache.hpp>
#include <vespa/vespalib/stllike/hash_map.hpp>
+#include <vespa/vespalib/data/databuffer.h>
+#include <vespa/document/util/compressor.h>
-namespace search {
-namespace docstore {
+namespace search::docstore {
using vespalib::ConstBufferRef;
using vespalib::LockGuard;
@@ -241,5 +242,3 @@ VisitCache::Cache::onRemove(const K & key) {
}
}
-}
-
diff --git a/searchlib/src/vespa/searchlib/docstore/visitcache.h b/searchlib/src/vespa/searchlib/docstore/visitcache.h
index d47796d446a..6e5887349ee 100644
--- a/searchlib/src/vespa/searchlib/docstore/visitcache.h
+++ b/searchlib/src/vespa/searchlib/docstore/visitcache.h
@@ -6,11 +6,12 @@
#include "cachestats.h"
#include <vespa/vespalib/stllike/cache.h>
#include <vespa/vespalib/stllike/hash_set.h>
+#include <vespa/vespalib/stllike/hash_map.h>
#include <vespa/vespalib/util/alloc.h>
#include <vespa/vespalib/objects/nbostream.h>
+#include <vespa/document/util/bytebuffer.h>
-namespace search {
-namespace docstore {
+namespace search::docstore {
/**
* Represents a unique set of keys that together acts as a key in a map.
@@ -160,4 +161,3 @@ private:
};
}
-}
diff --git a/storage/src/vespa/storage/storageserver/messagesink.cpp b/storage/src/vespa/storage/storageserver/messagesink.cpp
index 0df24ef3536..4960cd2085e 100644
--- a/storage/src/vespa/storage/storageserver/messagesink.cpp
+++ b/storage/src/vespa/storage/storageserver/messagesink.cpp
@@ -2,6 +2,7 @@
#include "messagesink.h"
#include <vespa/storageapi/message/persistence.h>
+#include <ostream>
using std::shared_ptr;
diff --git a/storageapi/src/vespa/storageapi/message/batch.cpp b/storageapi/src/vespa/storageapi/message/batch.cpp
index 405d5b4c9d2..ee7bbbcbdf6 100644
--- a/storageapi/src/vespa/storageapi/message/batch.cpp
+++ b/storageapi/src/vespa/storageapi/message/batch.cpp
@@ -2,7 +2,7 @@
//
#include "batch.h"
#include <vespa/document/bucket/bucketidfactory.h>
-#include <algorithm>
+#include <ostream>
using namespace storage::api;
diff --git a/storageapi/src/vespa/storageapi/message/bucket.cpp b/storageapi/src/vespa/storageapi/message/bucket.cpp
index 3400e0d6399..e4e6f796ac2 100644
--- a/storageapi/src/vespa/storageapi/message/bucket.cpp
+++ b/storageapi/src/vespa/storageapi/message/bucket.cpp
@@ -4,9 +4,10 @@
#include <vespa/document/fieldvalue/document.h>
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/util/array.hpp>
+#include <ostream>
+#include <iterator>
-namespace storage {
-namespace api {
+namespace storage::api {
IMPLEMENT_COMMAND(CreateBucketCommand, CreateBucketReply)
IMPLEMENT_REPLY(CreateBucketReply)
@@ -625,7 +626,6 @@ SetBucketStateReply::print(std::ostream& out,
}
}
-} // api
-} // storage
+}
template class vespalib::Array<storage::api::RequestBucketInfoReply::Entry>;
diff --git a/storageapi/src/vespa/storageapi/message/persistence.cpp b/storageapi/src/vespa/storageapi/message/persistence.cpp
index 6de53d9db82..ce1adcfa2ca 100644
--- a/storageapi/src/vespa/storageapi/message/persistence.cpp
+++ b/storageapi/src/vespa/storageapi/message/persistence.cpp
@@ -3,6 +3,7 @@
#include "persistence.h"
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/stllike/asciistream.h>
+#include <ostream>
namespace storage {
namespace api {
diff --git a/vsm/src/vespa/vsm/searcher/utf8stringfieldsearcherbase.cpp b/vsm/src/vespa/vsm/searcher/utf8stringfieldsearcherbase.cpp
index 8e444102930..c713e0284ac 100644
--- a/vsm/src/vespa/vsm/searcher/utf8stringfieldsearcherbase.cpp
+++ b/vsm/src/vespa/vsm/searcher/utf8stringfieldsearcherbase.cpp
@@ -1,6 +1,7 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "utf8stringfieldsearcherbase.h"
+#include <cassert>
using search::QueryTerm;
using search::QueryTermList;
diff --git a/vsm/src/vespa/vsm/searcher/utf8substringsnippetmodifier.cpp b/vsm/src/vespa/vsm/searcher/utf8substringsnippetmodifier.cpp
index 23e64d0bf5e..b5d49f463ef 100644
--- a/vsm/src/vespa/vsm/searcher/utf8substringsnippetmodifier.cpp
+++ b/vsm/src/vespa/vsm/searcher/utf8substringsnippetmodifier.cpp
@@ -1,5 +1,6 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "utf8substringsnippetmodifier.h"
+#include <cassert>
using search::byte;
using search::QueryTerm;