diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-11-30 13:03:07 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-12-12 02:55:41 +0100 |
commit | c650f2f379179780d428fb5505a0ed3d52f48ba4 (patch) | |
tree | 5780a899b56d66aa8172c3ab296afc4f778915d1 /memfilepersistence | |
parent | f1d0f2af6b0bae3042b77f37b2461aa1229eca45 (diff) |
Targeted include.
Diffstat (limited to 'memfilepersistence')
6 files changed, 34 insertions, 36 deletions
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 |