diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-01-15 15:17:07 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-01-16 15:41:23 +0000 |
commit | d3cf455cba32ef3f5280634470858e80761d8450 (patch) | |
tree | 7d4dd978a349cd305fff48ee5967acbe0ad4458b /storageapi | |
parent | 6abc05684fc3fe46da2b159b8944fae9adb086a4 (diff) |
Unify towards nbostream
Diffstat (limited to 'storageapi')
4 files changed, 6 insertions, 5 deletions
diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization7.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization7.cpp index bf56dd56db6..27b91836fd2 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization7.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization7.cpp @@ -85,7 +85,7 @@ std::shared_ptr<document::Document> get_document(const protobuf::Document& src_d const document::DocumentTypeRepo& type_repo) { if (!src_doc.payload().empty()) { - document::ByteBuffer doc_buf(src_doc.payload().data(), src_doc.payload().size()); + vespalib::nbostream doc_buf(src_doc.payload().data(), src_doc.payload().size()); return std::make_shared<document::Document>(type_repo, doc_buf); } return std::shared_ptr<document::Document>(); diff --git a/storageapi/src/vespa/storageapi/mbusprot/serializationhelper.h b/storageapi/src/vespa/storageapi/mbusprot/serializationhelper.h index 08cec601cce..24cc3e4371d 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/serializationhelper.h +++ b/storageapi/src/vespa/storageapi/mbusprot/serializationhelper.h @@ -87,9 +87,9 @@ public: if (size == 0) { return document::Document::UP(); } else { - document::ByteBuffer bbuf(buf.getBufferAtPos(), size); + vespalib::nbostream stream(buf.getBufferAtPos(), size); buf.incPos(size); - return document::Document::UP(new document::Document(repo, bbuf)); + return std::make_unique<document::Document>(repo, stream); } } diff --git a/storageapi/src/vespa/storageapi/message/bucket.cpp b/storageapi/src/vespa/storageapi/message/bucket.cpp index ee8aff31914..de47a52ca9d 100644 --- a/storageapi/src/vespa/storageapi/message/bucket.cpp +++ b/storageapi/src/vespa/storageapi/message/bucket.cpp @@ -3,6 +3,7 @@ #include "bucket.h" #include <vespa/document/fieldvalue/document.h> #include <vespa/vespalib/stllike/asciistream.h> +#include <vespa/vespalib/objects/nbostream.h> #include <vespa/vespalib/util/array.hpp> #include <ostream> #include <iterator> @@ -319,7 +320,7 @@ ApplyBucketDiffCommand::Entry::print( << "), headerBlob(" << _headerBlob.size() << "), bodyBlob(" << _bodyBlob.size() << ")"; if (_headerBlob.size() > 0) { - document::ByteBuffer buf(&_headerBlob[0], + vespalib::nbostream buf(&_headerBlob[0], _headerBlob.size()); if (_repo) { document::Document doc(*_repo, buf); diff --git a/storageapi/src/vespa/storageapi/message/persistence.cpp b/storageapi/src/vespa/storageapi/message/persistence.cpp index 54df92546a5..8b8dedda231 100644 --- a/storageapi/src/vespa/storageapi/message/persistence.cpp +++ b/storageapi/src/vespa/storageapi/message/persistence.cpp @@ -60,7 +60,7 @@ PutCommand::print(std::ostream& out, bool verbose, const std::string& indent) co { out << "Put(" << getBucketId() << ", " << _doc->getId() << ", timestamp " << _timestamp << ", size " - << _doc->serialize()->getLength() << ")"; + << _doc->getSerializedSize() << ")"; if (verbose) { out << " {\n" << indent << " "; _doc->print(out, verbose, indent + " "); |