aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--document/src/vespa/document/fieldvalue/document.cpp1
-rw-r--r--document/src/vespa/document/update/addvalueupdate.cpp1
-rw-r--r--document/src/vespa/document/update/arithmeticvalueupdate.cpp1
-rw-r--r--document/src/vespa/document/update/documentupdate.cpp1
-rw-r--r--documentapi/src/vespa/documentapi/messagebus/messages/removelocationmessage.cpp4
-rw-r--r--documentapi/src/vespa/documentapi/messagebus/routablerepository.cpp6
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/options.cpp8
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/common/types.cpp5
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/mapper/fileinfo.cpp15
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.cpp7
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.cpp24
-rw-r--r--memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.h11
-rw-r--r--metrics/src/vespa/metrics/metricmanager.cpp10
-rw-r--r--metrics/src/vespa/metrics/metricmanager.h11
-rw-r--r--metrics/src/vespa/metrics/valuemetricvalues.hpp1
-rw-r--r--metrics/src/vespa/metrics/xmlwriter.cpp1
-rw-r--r--searchlib/src/vespa/searchlib/attribute/integerbase.cpp6
-rw-r--r--searchlib/src/vespa/searchlib/attribute/integerbase.h59
-rw-r--r--searchlib/src/vespa/searchlib/attribute/integerbase.hpp63
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/xmlserializable.cpp15
-rw-r--r--storageframework/src/vespa/storageframework/defaultimplementation/component/componentregisterimpl.cpp4
-rw-r--r--vdslib/src/vespa/vdslib/container/documentlist.cpp11
-rw-r--r--vdslib/src/vespa/vdslib/distribution/distribution.cpp1
-rw-r--r--vdslib/src/vespa/vdslib/state/clusterstate.cpp4
24 files changed, 154 insertions, 116 deletions
diff --git a/document/src/vespa/document/fieldvalue/document.cpp b/document/src/vespa/document/fieldvalue/document.cpp
index 70e872caca9..86ca6e8a701 100644
--- a/document/src/vespa/document/fieldvalue/document.cpp
+++ b/document/src/vespa/document/fieldvalue/document.cpp
@@ -13,7 +13,6 @@
#include <vespa/document/serialization/vespadocumentserializer.h>
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/document/util/serializableexceptions.h>
-#include <vespa/vespalib/util/xmlserializable.hpp>
#include <sstream>
using vespalib::nbostream;
diff --git a/document/src/vespa/document/update/addvalueupdate.cpp b/document/src/vespa/document/update/addvalueupdate.cpp
index 3bcb3c12839..408657f40f9 100644
--- a/document/src/vespa/document/update/addvalueupdate.cpp
+++ b/document/src/vespa/document/update/addvalueupdate.cpp
@@ -9,7 +9,6 @@
#include <vespa/document/util/serializable.h>
#include <vespa/document/util/serializableexceptions.h>
#include <vespa/vespalib/objects/nbostream.h>
-#include <vespa/vespalib/util/xmlserializable.hpp>
using vespalib::IllegalArgumentException;
using vespalib::IllegalStateException;
diff --git a/document/src/vespa/document/update/arithmeticvalueupdate.cpp b/document/src/vespa/document/update/arithmeticvalueupdate.cpp
index 915ab4042e4..78614b4bc28 100644
--- a/document/src/vespa/document/update/arithmeticvalueupdate.cpp
+++ b/document/src/vespa/document/update/arithmeticvalueupdate.cpp
@@ -2,7 +2,6 @@
#include "arithmeticvalueupdate.h"
#include <vespa/document/base/field.h>
#include <vespa/document/fieldvalue/fieldvalues.h>
-#include <vespa/vespalib/util/xmlserializable.hpp>
using vespalib::IllegalArgumentException;
using vespalib::IllegalStateException;
diff --git a/document/src/vespa/document/update/documentupdate.cpp b/document/src/vespa/document/update/documentupdate.cpp
index 823d32584e1..df4410ce2eb 100644
--- a/document/src/vespa/document/update/documentupdate.cpp
+++ b/document/src/vespa/document/update/documentupdate.cpp
@@ -12,7 +12,6 @@
#include <vespa/document/util/serializableexceptions.h>
#include <vespa/vespalib/objects/nbostream.h>
#include <vespa/document/util/bufferexceptions.h>
-#include <vespa/vespalib/util/xmlserializable.hpp>
using vespalib::IllegalArgumentException;
using vespalib::IllegalStateException;
diff --git a/documentapi/src/vespa/documentapi/messagebus/messages/removelocationmessage.cpp b/documentapi/src/vespa/documentapi/messagebus/messages/removelocationmessage.cpp
index 29c5d40ca7e..08300299706 100644
--- a/documentapi/src/vespa/documentapi/messagebus/messages/removelocationmessage.cpp
+++ b/documentapi/src/vespa/documentapi/messagebus/messages/removelocationmessage.cpp
@@ -1,9 +1,9 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/documentapi/messagebus/messages/removelocationmessage.h>
+#include "removelocationmessage.h"
#include <vespa/documentapi/messagebus/documentprotocol.h>
#include <vespa/document/select/parser.h>
#include <vespa/document/bucket/bucketselector.h>
+#include <vespa/vespalib/util/exceptions.h>
namespace documentapi {
diff --git a/documentapi/src/vespa/documentapi/messagebus/routablerepository.cpp b/documentapi/src/vespa/documentapi/messagebus/routablerepository.cpp
index dfd959ba2dd..4572b2bbcc6 100644
--- a/documentapi/src/vespa/documentapi/messagebus/routablerepository.cpp
+++ b/documentapi/src/vespa/documentapi/messagebus/routablerepository.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 <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".routablerepository");
#include "routablerepository.h"
#include <vespa/documentapi/loadtypes/loadtypeset.h>
+#include <vespa/document/util/stringutil.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/log/log.h>
+LOG_SETUP(".routablerepository");
namespace documentapi {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/options.cpp b/memfilepersistence/src/vespa/memfilepersistence/common/options.cpp
index 7cf75c4f977..651543219ec 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/options.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/options.cpp
@@ -1,12 +1,10 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/memfilepersistence/common/options.h>
-
-#include <vespa/log/log.h>
-#include <iomanip>
+#include "options.h"
#include <vespa/config-stor-memfilepersistence.h>
+#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/log/log.h>
LOG_SETUP(".persistence.slotfile.options");
namespace storage {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/common/types.cpp b/memfilepersistence/src/vespa/memfilepersistence/common/types.cpp
index 337638cadc9..75e1217e680 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/common/types.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/common/types.cpp
@@ -1,8 +1,7 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <iostream>
-#include <vespa/memfilepersistence/common/types.h>
+#include "types.h"
+#include <sstream>
namespace storage {
namespace memfile {
diff --git a/memfilepersistence/src/vespa/memfilepersistence/mapper/fileinfo.cpp b/memfilepersistence/src/vespa/memfilepersistence/mapper/fileinfo.cpp
index bda57a13aa7..8d577c8093a 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/mapper/fileinfo.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/mapper/fileinfo.cpp
@@ -1,6 +1,6 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/memfilepersistence/mapper/fileinfo.h>
+#include "fileinfo.h"
+#include <sstream>
namespace storage {
@@ -10,8 +10,7 @@ FileInfo::FileInfo()
: _metaDataListSize(0),
_headerBlockSize(0),
_bodyBlockSize(0)
-{
-}
+{ }
FileInfo::FileInfo(uint32_t metaDataListSize,
uint32_t headerBlockSize,
@@ -19,8 +18,7 @@ FileInfo::FileInfo(uint32_t metaDataListSize,
: _metaDataListSize(metaDataListSize),
_headerBlockSize(headerBlockSize),
_bodyBlockSize(bodyBlockSize)
-{
-}
+{ }
FileInfo::FileInfo(const Header& header, size_t fileSize)
@@ -29,8 +27,7 @@ FileInfo::FileInfo(const Header& header, size_t fileSize)
_bodyBlockSize(
fileSize - header._headerBlockSize
- sizeof(MetaSlot) * header._metaDataListSize - sizeof(Header))
-{
-}
+{ }
uint32_t
FileInfo::getHeaderBlockStartIndex() const
@@ -53,7 +50,7 @@ FileInfo::getFileSize() const
std::string
FileInfo::toString() const
{
- std::ostringstream ost;
+ vespalib::asciistream ost;
ost << "FileInfo("
<< "meta_size " << _metaDataListSize
<< " header_start " << getHeaderBlockStartIndex()
diff --git a/memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.cpp b/memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.cpp
index b292d5751b7..6dfa983729b 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/memfile/memfile.cpp
@@ -4,7 +4,6 @@
#include <vespa/memfilepersistence/memfile/memfile.h>
#include <ext/algorithm>
-#include <vespa/log/log.h>
#include <vespa/memfilepersistence/common/exceptions.h>
#include <vespa/memfilepersistence/mapper/memfilemapper.h>
#include <vespa/memfilepersistence/mapper/simplememfileiobuffer.h>
@@ -13,6 +12,10 @@
#include <vespa/vespalib/util/crc.h>
#include <vespa/memfilepersistence/common/environment.h>
#include <iomanip>
+#include <vespa/document/util/stringutil.h>
+
+#include <vespa/log/log.h>
+LOG_SETUP(".persistence.memfile.memfile");
namespace {
@@ -25,8 +28,6 @@ std::vector<A> toVector(A entry) {
}
-LOG_SETUP(".persistence.memfile.memfile");
-
#define FAIL_INCONSISTENT(msg, slot) \
{ \
std::ostringstream error; \
diff --git a/memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.cpp b/memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.cpp
index 56208e8ad3f..398ca65ac19 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.cpp
+++ b/memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.cpp
@@ -26,8 +26,7 @@ MemSlot::MemSlot(const MemSlot& other)
_gid(other._gid),
_flags(other._flags),
_checksum(other._checksum)
-{
-}
+{ }
MemSlot::MemSlot(const GlobalId& gid, Timestamp time,
DataLocation header, DataLocation body,
@@ -38,12 +37,9 @@ MemSlot::MemSlot(const GlobalId& gid, Timestamp time,
_gid(gid),
_flags(flags),
_checksum(checksum)
-{
-}
+{ }
-MemSlot::~MemSlot()
-{
-}
+MemSlot::~MemSlot() { }
MemSlot::MemoryUsage
MemSlot::getCacheSize() const
@@ -129,5 +125,19 @@ MemSlot::MemoryUsage::toString() const
return ss.str();
}
+std::string
+MemSlot::toString(bool verbose) const {
+ std::ostringstream ost;
+ print(ost, verbose, "");
+ return ost.str();
+}
+
+std::ostream&
+operator<<(std::ostream& out, const MemSlot& slot) {
+ slot.print(out, false, "");
+ return out;
+}
+
+
} // memfile
} // storage
diff --git a/memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.h b/memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.h
index 4ea44a45996..32f7f0ebe39 100644
--- a/memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.h
+++ b/memfilepersistence/src/vespa/memfilepersistence/memfile/memslot.h
@@ -174,17 +174,10 @@ public:
void print(std::ostream& out, bool verbose,
const std::string& indent) const;
- std::string toString(bool verbose = false) const {
- std::ostringstream ost;
- print(ost, verbose, "");
- return ost.str();
- }
+ std::string toString(bool verbose = false) const;
};
-inline std::ostream& operator<<(std::ostream& out, const MemSlot& slot) {
- slot.print(out, false, "");
- return out;
-}
+std::ostream& operator<<(std::ostream& out, const MemSlot& slot);
} // memfile
} // storage
diff --git a/metrics/src/vespa/metrics/metricmanager.cpp b/metrics/src/vespa/metrics/metricmanager.cpp
index 2ac3954fa31..6267ef88b04 100644
--- a/metrics/src/vespa/metrics/metricmanager.cpp
+++ b/metrics/src/vespa/metrics/metricmanager.cpp
@@ -11,8 +11,8 @@
#include <vespa/metrics/jsonwriter.h>
#include <vespa/metrics/textwriter.h>
#include <vespa/metrics/xmlwriter.h>
+#include <vespa/vespalib/util/exceptions.h>
#include <vespa/log/log.h>
-#include <stack>
LOG_SETUP(".metrics.manager");
@@ -21,6 +21,14 @@ namespace metrics {
typedef MetricsmanagerConfig Config;
void
+MetricManager::assertMetricLockLocked(const MetricLockGuard& g) const {
+ if (!g.monitors(_waiter)) {
+ throw vespalib::IllegalArgumentException(
+ "Given lock does not lock the metric lock.", VESPA_STRLOC);
+ }
+}
+
+void
MetricManager::ConsumerSpec::print(std::ostream& out, bool verbose,
const std::string& indent) const
{
diff --git a/metrics/src/vespa/metrics/metricmanager.h b/metrics/src/vespa/metrics/metricmanager.h
index 28e03b01aff..ad2a807f8f4 100644
--- a/metrics/src/vespa/metrics/metricmanager.h
+++ b/metrics/src/vespa/metrics/metricmanager.h
@@ -292,15 +292,8 @@ private:
void handleMetricsAltered(const MetricLockGuard & guard);
typedef std::pair<uint32_t, std::string> SnapSpec;
- static std::vector<SnapSpec> createSnapshotPeriods(
- const MetricsmanagerConfig& config);
- void assertMetricLockLocked(const MetricLockGuard& g) const {
- if (!g.monitors(_waiter)) {
- throw vespalib::IllegalArgumentException(
- "Given lock does not lock the metric lock.", VESPA_STRLOC);
- }
- }
-
+ static std::vector<SnapSpec> createSnapshotPeriods( const MetricsmanagerConfig& config);
+ void assertMetricLockLocked(const MetricLockGuard& g) const;
};
} // metrics
diff --git a/metrics/src/vespa/metrics/valuemetricvalues.hpp b/metrics/src/vespa/metrics/valuemetricvalues.hpp
index fe58a1f53c6..d8becca3e72 100644
--- a/metrics/src/vespa/metrics/valuemetricvalues.hpp
+++ b/metrics/src/vespa/metrics/valuemetricvalues.hpp
@@ -2,6 +2,7 @@
#pragma once
#include "valuemetricvalues.h"
+#include <vespa/vespalib/util/exceptions.h>
#include <ostream>
namespace metrics {
diff --git a/metrics/src/vespa/metrics/xmlwriter.cpp b/metrics/src/vespa/metrics/xmlwriter.cpp
index 01c509030ff..66f83cdd4bf 100644
--- a/metrics/src/vespa/metrics/xmlwriter.cpp
+++ b/metrics/src/vespa/metrics/xmlwriter.cpp
@@ -6,6 +6,7 @@
#include <vespa/metrics/metricset.h>
#include <vespa/metrics/metricsnapshot.h>
#include <vespa/metrics/valuemetric.h>
+#include <sstream>
namespace metrics {
diff --git a/searchlib/src/vespa/searchlib/attribute/integerbase.cpp b/searchlib/src/vespa/searchlib/attribute/integerbase.cpp
index 46ecf789ae5..81cd7a5bb53 100644
--- a/searchlib/src/vespa/searchlib/attribute/integerbase.cpp
+++ b/searchlib/src/vespa/searchlib/attribute/integerbase.cpp
@@ -1,14 +1,10 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include "integerbase.h"
+#include "integerbase.hpp"
#include <vespa/searchlib/common/sort.h>
#include <vespa/searchlib/attribute/attributevector.hpp>
#include <vespa/document/fieldvalue/fieldvalue.h>
-#include <vespa/log/log.h>
-LOG_SETUP(".searchlib.attribute.integerbase");
-
namespace search {
IMPLEMENT_IDENTIFIABLE_ABSTRACT(IntegerAttribute, NumericAttribute);
diff --git a/searchlib/src/vespa/searchlib/attribute/integerbase.h b/searchlib/src/vespa/searchlib/attribute/integerbase.h
index 702bab0772c..4c60a880074 100644
--- a/searchlib/src/vespa/searchlib/attribute/integerbase.h
+++ b/searchlib/src/vespa/searchlib/attribute/integerbase.h
@@ -1,10 +1,10 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/searchlib/attribute/numericbase.h>
-#include <vespa/searchlib/attribute/multivalue.h>
-#include <vespa/searchlib/attribute/loadednumericvalue.h>
-#include <vespa/searchlib/attribute/changevector.h>
+#include "numericbase.h"
+#include "multivalue.h"
+#include "loadednumericvalue.h"
+#include "changevector.h"
namespace search {
@@ -61,11 +61,7 @@ public:
typedef T BaseType;
typedef T LoadedValueType;
typedef SequentialReadModifyWriteInterface<LoadedNumericValueT> LoadedVector;
- virtual uint32_t getRawValues(DocId doc, const multivalue::Value<T> * & values) const {
- (void) doc;
- (void) values;
- throw std::runtime_error(getNativeClassName() + "::getRawValues() not implemented.");
- }
+ virtual uint32_t getRawValues(DocId doc, const multivalue::Value<T> * & values) const;
protected:
IntegerAttributeTemplate(const vespalib::string & name) :
@@ -75,7 +71,9 @@ protected:
IntegerAttributeTemplate(const vespalib::string & name, const Config & c) :
IntegerAttribute(name, c),
_defaultValue(ChangeBase::UPDATE, 0, defaultValue())
- { assert(c.basicType() == BasicType::fromType(T())); }
+ {
+ assert(c.basicType() == BasicType::fromType(T()));
+ }
IntegerAttributeTemplate(const vespalib::string & name,
const Config & c,
const BasicType &realType)
@@ -92,45 +90,12 @@ protected:
virtual bool isUndefined(DocId doc) const { return get(doc) == defaultValue(); }
Change _defaultValue;
private:
- virtual bool findEnum(const char *value, EnumHandle &e) const {
- vespalib::asciistream iss(value);
- int64_t ivalue = 0;
- try {
- iss >> ivalue;
- } catch (const vespalib::IllegalArgumentException &) {
- }
- return findEnum(ivalue, e);
- }
+ bool findEnum(const char *value, EnumHandle &e) const override;
virtual T get(DocId doc) const = 0;
virtual T getFromEnum(EnumHandle e) const = 0;
- virtual largeint_t getIntFromEnum(EnumHandle e) const {
- T v(getFromEnum(e));
- if (attribute::isUndefined<T>(v)) {
- return attribute::getUndefined<largeint_t>();
- }
- return v;
- }
- virtual long onSerializeForAscendingSort(DocId doc, void * serTo, long available, const common::BlobConverter * bc) const {
- (void) bc;
- if (available >= long(sizeof(T))) {
- T origValue(get(doc));
- vespalib::serializeForSort< vespalib::convertForSort<T, true> >(origValue, serTo);
- } else {
- return -1;
- }
- return sizeof(T);
- }
- virtual long onSerializeForDescendingSort(DocId doc, void * serTo, long available, const common::BlobConverter * bc) const {
- (void) bc;
- if (available >= long(sizeof(T))) {
- T origValue(get(doc));
- vespalib::serializeForSort< vespalib::convertForSort<T, false> >(origValue, serTo);
- } else {
- return -1;
- }
- return sizeof(T);
- }
+ largeint_t getIntFromEnum(EnumHandle e) const override;
+ long onSerializeForAscendingSort(DocId doc, void * serTo, long available, const common::BlobConverter * bc) const override;
+ long onSerializeForDescendingSort(DocId doc, void * serTo, long available, const common::BlobConverter * bc) const override;
};
}
-
diff --git a/searchlib/src/vespa/searchlib/attribute/integerbase.hpp b/searchlib/src/vespa/searchlib/attribute/integerbase.hpp
new file mode 100644
index 00000000000..a218cd11264
--- /dev/null
+++ b/searchlib/src/vespa/searchlib/attribute/integerbase.hpp
@@ -0,0 +1,63 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#pragma once
+
+#include "integerbase.hpp"
+
+namespace search {
+
+template<typename T>
+uint32_t
+IntegerAttributeTemplate<T>::getRawValues(DocId, const multivalue::Value<T> * &) const {
+ throw std::runtime_error(getNativeClassName() + "::getRawValues() not implemented.");
+}
+
+template<typename T>
+bool
+IntegerAttributeTemplate<T>::findEnum(const char *value, EnumHandle &e) const {
+ vespalib::asciistream iss(value);
+ int64_t ivalue = 0;
+ try {
+ iss >> ivalue;
+ } catch (const vespalib::IllegalArgumentException &) {
+ }
+ return findEnum(ivalue, e);
+}
+
+template<typename T>
+largeint_t
+IntegerAttributeTemplate<T>::getIntFromEnum(EnumHandle e) const {
+ T v(getFromEnum(e));
+ if (attribute::isUndefined<T>(v)) {
+ return attribute::getUndefined<largeint_t>();
+ }
+ return v;
+}
+
+template<typename T>
+long
+IntegerAttributeTemplate<T>::onSerializeForAscendingSort(DocId doc, void * serTo, long available, const common::BlobConverter * bc) const {
+ (void) bc;
+ if (available >= long(sizeof(T))) {
+ T origValue(get(doc));
+ vespalib::serializeForSort< vespalib::convertForSort<T, true> >(origValue, serTo);
+ } else {
+ return -1;
+ }
+ return sizeof(T);
+}
+
+template<typename T>
+long
+IntegerAttributeTemplate<T>::onSerializeForDescendingSort(DocId doc, void * serTo, long available, const common::BlobConverter * bc) const {
+ (void) bc;
+ if (available >= long(sizeof(T))) {
+ T origValue(get(doc));
+ vespalib::serializeForSort< vespalib::convertForSort<T, false> >(origValue, serTo);
+ } else {
+ return -1;
+ }
+ return sizeof(T);
+}
+
+}
+
diff --git a/staging_vespalib/src/vespa/vespalib/util/xmlserializable.cpp b/staging_vespalib/src/vespa/vespalib/util/xmlserializable.cpp
index 58aa6ca0d36..42e1a069ebf 100644
--- a/staging_vespalib/src/vespa/vespalib/util/xmlserializable.cpp
+++ b/staging_vespalib/src/vespa/vespalib/util/xmlserializable.cpp
@@ -433,6 +433,21 @@ XmlSerializable::toXml(const std::string& indent) const
printXml(xos);
return ost.str();
}
+using CharP = char *;
+using ConstCharP = const char *;
+
+template XmlAttribute::XmlAttribute(const std::string &, const std::string &, unsigned int);
+template XmlAttribute::XmlAttribute(const std::string &, const vespalib::string &, unsigned int);
+template XmlAttribute::XmlAttribute(const std::string &, const vespalib::stringref &, unsigned int);
+template XmlAttribute::XmlAttribute(const std::string &, const CharP &, unsigned int);
+template XmlAttribute::XmlAttribute(const std::string &, const ConstCharP &, unsigned int);
+template XmlAttribute::XmlAttribute(const std::string &, const int16_t &, unsigned int);
+template XmlAttribute::XmlAttribute(const std::string &, const int32_t &, unsigned int);
+template XmlAttribute::XmlAttribute(const std::string &, const int64_t &, unsigned int);
+template XmlAttribute::XmlAttribute(const std::string &, const uint16_t &, unsigned int);
+template XmlAttribute::XmlAttribute(const std::string &, const uint32_t &, unsigned int);
+template XmlAttribute::XmlAttribute(const std::string &, const uint64_t &, unsigned int);
+template XmlAttribute::XmlAttribute(const std::string &, const double &, unsigned int);
} // xml
} // vespalib
diff --git a/storageframework/src/vespa/storageframework/defaultimplementation/component/componentregisterimpl.cpp b/storageframework/src/vespa/storageframework/defaultimplementation/component/componentregisterimpl.cpp
index acc9cf248b4..01f1d2583be 100644
--- a/storageframework/src/vespa/storageframework/defaultimplementation/component/componentregisterimpl.cpp
+++ b/storageframework/src/vespa/storageframework/defaultimplementation/component/componentregisterimpl.cpp
@@ -1,9 +1,9 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/storageframework/defaultimplementation/component/componentregisterimpl.h>
+#include "componentregisterimpl.h"
#include <vespa/storageframework/storageframework.h>
#include <vespa/metrics/metricmanager.h>
+#include <vespa/vespalib/util/exceptions.h>
namespace storage {
namespace framework {
diff --git a/vdslib/src/vespa/vdslib/container/documentlist.cpp b/vdslib/src/vespa/vdslib/container/documentlist.cpp
index 10c942f3002..5fcedc588bc 100644
--- a/vdslib/src/vespa/vdslib/container/documentlist.cpp
+++ b/vdslib/src/vespa/vdslib/container/documentlist.cpp
@@ -1,8 +1,9 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/vdslib/container/documentlist.h>
+#include "documentlist.h"
#include <vespa/vespalib/util/exceptions.h>
-#include <iostream>
+#include <sstream>
+#include <vespa/document/util/stringutil.h>
+#include <vespa/document/util/serializableexceptions.h>
#include <vespa/log/log.h>
LOG_SETUP(".vdslib.container.documentlist");
@@ -422,7 +423,7 @@ DocumentList::checkConsistency(bool do_memset)
i, curEnd, prevStart);
std::ostringstream oss;
print(oss, true, "");
- std::cerr << "Dumping DocumentList: " << oss.str() << "\n";
+ fprintf(stderr, "%s\n", oss.str().c_str());
assert(!"DocumentList has overlapping blocks!");
}
if (curEnd < prevStart) {
@@ -469,7 +470,7 @@ DocumentList::print(std::ostream& out, bool verbose,
entry.print(out, indent + " ");
if (entry.headerPos + entry.headerLen > _bufferSize ||
entry.bodyPos + entry.bodyLen > _bufferSize) {
- std::cerr << " Invalid entry. Aborting print.)";
+ fprintf(stderr, " Invalid entry. Aborting print.\n");
return;
}
}
diff --git a/vdslib/src/vespa/vdslib/distribution/distribution.cpp b/vdslib/src/vespa/vdslib/distribution/distribution.cpp
index f732dea1030..da3fa2f3302 100644
--- a/vdslib/src/vespa/vdslib/distribution/distribution.cpp
+++ b/vdslib/src/vespa/vdslib/distribution/distribution.cpp
@@ -15,6 +15,7 @@
#include <vespa/config/common/misc.h>
#include <vespa/config/print/asciiconfigwriter.h>
#include <vespa/config/print/asciiconfigreader.h>
+#include <vespa/vespalib/util/exceptions.h>
#include <vespa/log/log.h>
LOG_SETUP(".vdslib.distribution");
diff --git a/vdslib/src/vespa/vdslib/state/clusterstate.cpp b/vdslib/src/vespa/vdslib/state/clusterstate.cpp
index ce3dffbfb82..97ce96fc5e3 100644
--- a/vdslib/src/vespa/vdslib/state/clusterstate.cpp
+++ b/vdslib/src/vespa/vdslib/state/clusterstate.cpp
@@ -1,12 +1,12 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vespalib/text/stringtokenizer.h>
#include <vespa/document/util/stringutil.h>
-#include <vespa/log/log.h>
#include <sstream>
#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/log/log.h>
LOG_SETUP(".vdslib.state.cluster");