diff options
author | Henning Baldersheim <balder@oath.com> | 2018-06-13 21:05:30 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-06-14 09:41:08 +0200 |
commit | b058a774308940118640b4026f55e6ea4a0bb881 (patch) | |
tree | 6b3d9a1b48aea9e3be887b93ed3989c806031973 /document | |
parent | b4f9a3542b2f66041c6704c1f8e554f5c885f2fe (diff) |
Remove unused version
Diffstat (limited to 'document')
11 files changed, 19 insertions, 32 deletions
diff --git a/document/src/vespa/document/serialization/vespadocumentserializer.cpp b/document/src/vespa/document/serialization/vespadocumentserializer.cpp index dac5ca4458b..08fddbaad41 100644 --- a/document/src/vespa/document/serialization/vespadocumentserializer.cpp +++ b/document/src/vespa/document/serialization/vespadocumentserializer.cpp @@ -425,7 +425,7 @@ namespace { void VespaDocumentSerializer::write42(const DocumentUpdate &value) { - _stream << static_cast<uint16_t>(value.getVersion()); + _stream << static_cast<uint16_t>(Document::getNewestSerializationVersion()); write(value.getId()); _stream << static_cast<uint8_t>(CONTENT_HASTYPE); _stream.write(value.getType().getName().c_str(), value.getType().getName().size() + 1); diff --git a/document/src/vespa/document/update/addfieldpathupdate.cpp b/document/src/vespa/document/update/addfieldpathupdate.cpp index d0796b9b2a0..c92bd499796 100644 --- a/document/src/vespa/document/update/addfieldpathupdate.cpp +++ b/document/src/vespa/document/update/addfieldpathupdate.cpp @@ -3,6 +3,7 @@ #include "addfieldpathupdate.h" #include <vespa/document/fieldvalue/iteratorhandler.h> #include <vespa/document/fieldvalue/arrayfieldvalue.h> +#include <vespa/document/fieldvalue/document.h> #include <vespa/document/serialization/vespadocumentdeserializer.h> #include <vespa/document/util/bytebuffer.h> #include <vespa/vespalib/objects/nbostream.h> @@ -88,10 +89,9 @@ AddFieldPathUpdate::print(std::ostream& out, bool verbose, const std::string& in } void -AddFieldPathUpdate::deserialize(const DocumentTypeRepo& repo, const DataType& type, - ByteBuffer& buffer, uint16_t version) +AddFieldPathUpdate::deserialize(const DocumentTypeRepo& repo, const DataType& type, ByteBuffer& buffer) { - FieldPathUpdate::deserialize(repo, type, buffer, version); + FieldPathUpdate::deserialize(repo, type, buffer); FieldPath path; type.buildFieldPath(path, getOriginalFieldPath()); @@ -100,7 +100,7 @@ AddFieldPathUpdate::deserialize(const DocumentTypeRepo& repo, const DataType& ty FieldValue::UP val = fieldType.createFieldValue(); _values.reset(static_cast<ArrayFieldValue*>(val.release())); nbostream stream(buffer.getBufferAtPos(), buffer.getRemaining()); - VespaDocumentDeserializer deserializer(repo, stream, version); + VespaDocumentDeserializer deserializer(repo, stream, Document::getNewestSerializationVersion()); deserializer.read(*_values); buffer.incPos(buffer.getRemaining() - stream.size()); } diff --git a/document/src/vespa/document/update/addfieldpathupdate.h b/document/src/vespa/document/update/addfieldpathupdate.h index 2943248d9d8..d7dbfc0e91e 100644 --- a/document/src/vespa/document/update/addfieldpathupdate.h +++ b/document/src/vespa/document/update/addfieldpathupdate.h @@ -26,8 +26,7 @@ public: private: uint8_t getSerializedType() const override { return AddMagic; } - void deserialize(const DocumentTypeRepo& repo, const DataType& type, - ByteBuffer& buffer, uint16_t version) override; + void deserialize(const DocumentTypeRepo& repo, const DataType& type, ByteBuffer& buffer) override; std::unique_ptr<fieldvalue::IteratorHandler> getIteratorHandler(Document &, const DocumentTypeRepo &) const override; diff --git a/document/src/vespa/document/update/assignfieldpathupdate.cpp b/document/src/vespa/document/update/assignfieldpathupdate.cpp index 1de38b982d0..f33f2928743 100644 --- a/document/src/vespa/document/update/assignfieldpathupdate.cpp +++ b/document/src/vespa/document/update/assignfieldpathupdate.cpp @@ -218,10 +218,9 @@ AssignFieldPathUpdate::print(std::ostream& out, bool verbose, const std::string& } void -AssignFieldPathUpdate::deserialize(const DocumentTypeRepo& repo, const DataType& type, - ByteBuffer& buffer, uint16_t version) +AssignFieldPathUpdate::deserialize(const DocumentTypeRepo& repo, const DataType& type, ByteBuffer& buffer) { - FieldPathUpdate::deserialize(repo, type, buffer, version); + FieldPathUpdate::deserialize(repo, type, buffer); uint8_t flags = 0x00; buffer.getByte(flags); @@ -236,7 +235,7 @@ AssignFieldPathUpdate::deserialize(const DocumentTypeRepo& repo, const DataType& type.buildFieldPath(path, getOriginalFieldPath()); _newValue.reset(getResultingDataType(path).createFieldValue().release()); nbostream stream(buffer.getBufferAtPos(), buffer.getRemaining()); - VespaDocumentDeserializer deserializer(repo, stream, version); + VespaDocumentDeserializer deserializer(repo, stream, Document::getNewestSerializationVersion()); deserializer.read(*_newValue); buffer.incPos(buffer.getRemaining() - stream.size()); } diff --git a/document/src/vespa/document/update/assignfieldpathupdate.h b/document/src/vespa/document/update/assignfieldpathupdate.h index 329ce5d8c93..40452d4d6fb 100644 --- a/document/src/vespa/document/update/assignfieldpathupdate.h +++ b/document/src/vespa/document/update/assignfieldpathupdate.h @@ -44,7 +44,7 @@ public: private: uint8_t getSerializedType() const override { return AssignMagic; } - void deserialize(const DocumentTypeRepo& repo, const DataType& type, ByteBuffer& buffer, uint16_t version) override; + void deserialize(const DocumentTypeRepo& repo, const DataType& type, ByteBuffer& buffer) override; std::unique_ptr<fieldvalue::IteratorHandler> getIteratorHandler(Document& doc, const DocumentTypeRepo & repo) const override; diff --git a/document/src/vespa/document/update/documentupdate.cpp b/document/src/vespa/document/update/documentupdate.cpp index 7c34740d49a..21cd9b17e82 100644 --- a/document/src/vespa/document/update/documentupdate.cpp +++ b/document/src/vespa/document/update/documentupdate.cpp @@ -32,7 +32,6 @@ DocumentUpdate::DocumentUpdate(const DocumentTypeRepo & repo, const DataType &ty _backing(), _updates(), _fieldPathUpdates(), - _version(Document::getNewestSerializationVersion()), _createIfNonExistent(false), _needHardReserialize(false) { @@ -49,7 +48,6 @@ DocumentUpdate::DocumentUpdate() _backing(), _updates(), _fieldPathUpdates(), - _version(Document::getNewestSerializationVersion()), _createIfNonExistent(false), _needHardReserialize(false) { @@ -377,7 +375,7 @@ DocumentUpdate::deserializeHEAD(const DocumentTypeRepo &repo, vespalib::nbostrea _fieldPathUpdates.reserve(numUpdates); ByteBuffer buffer(stream.peek(), stream.size()); for (int i = 0; i < numUpdates; ++i) { - _fieldPathUpdates.emplace_back(FieldPathUpdate::createInstance(repo, *_type, buffer, _version).release()); + _fieldPathUpdates.emplace_back(FieldPathUpdate::createInstance(repo, *_type, buffer).release()); } stream.adjustReadPos(buffer.getPos()); } catch (const DeserializeException &) { diff --git a/document/src/vespa/document/update/documentupdate.h b/document/src/vespa/document/update/documentupdate.h index f791dceb496..b1e93d44bce 100644 --- a/document/src/vespa/document/update/documentupdate.h +++ b/document/src/vespa/document/update/documentupdate.h @@ -125,7 +125,6 @@ public: bool getCreateIfNonExistent() const; int serializeFlags(int size_) const; - int16_t getVersion() const { return _version; } private: DocumentId _documentId; // The ID of the document to update. @@ -134,7 +133,6 @@ private: vespalib::nbostream _backing; FieldUpdateV _updates; // The list of field updates. FieldPathUpdateV _fieldPathUpdates; - const int16_t _version; // Serialization version bool _createIfNonExistent; bool _needHardReserialize; diff --git a/document/src/vespa/document/update/fieldpathupdate.cpp b/document/src/vespa/document/update/fieldpathupdate.cpp index 239ffff2fef..e172b14a846 100644 --- a/document/src/vespa/document/update/fieldpathupdate.cpp +++ b/document/src/vespa/document/update/fieldpathupdate.cpp @@ -117,15 +117,14 @@ FieldPathUpdate::getString(ByteBuffer& buffer) } void -FieldPathUpdate::deserialize(const DocumentTypeRepo&, const DataType&, ByteBuffer& buffer, uint16_t) +FieldPathUpdate::deserialize(const DocumentTypeRepo&, const DataType&, ByteBuffer& buffer) { _originalFieldPath = getString(buffer); _originalWhereClause = getString(buffer); } std::unique_ptr<FieldPathUpdate> -FieldPathUpdate::createInstance(const DocumentTypeRepo& repo, const DataType &type, - ByteBuffer& buffer, int serializationVersion) +FieldPathUpdate::createInstance(const DocumentTypeRepo& repo, const DataType &type, ByteBuffer& buffer) { unsigned char updateType = 0; buffer.getByte(updateType); @@ -144,7 +143,7 @@ FieldPathUpdate::createInstance(const DocumentTypeRepo& repo, const DataType &ty default: throw DeserializeException(make_string("Unknown fieldpath update type: %d", updateType), VESPA_STRLOC); } - update->deserialize(repo, type, buffer, serializationVersion); + update->deserialize(repo, type, buffer); return update; } diff --git a/document/src/vespa/document/update/fieldpathupdate.h b/document/src/vespa/document/update/fieldpathupdate.h index 76d529fec68..bd2a70743cb 100644 --- a/document/src/vespa/document/update/fieldpathupdate.h +++ b/document/src/vespa/document/update/fieldpathupdate.h @@ -71,10 +71,7 @@ public: /** Deserializes and creates a new FieldPathUpdate instance. * Requires type id to be not yet read. */ - static std::unique_ptr<FieldPathUpdate> createInstance( - const DocumentTypeRepo& repo, - const DataType &type, ByteBuffer& buffer, - int serializationVersion); + static std::unique_ptr<FieldPathUpdate> createInstance(const DocumentTypeRepo& repo, const DataType &type, ByteBuffer& buffer); protected: FieldPathUpdate(stringref fieldPath, stringref whereClause = stringref()); @@ -87,8 +84,7 @@ protected: * @param buffer The byte buffer that contains the serialized object. * @param version The serialization version of the object to deserialize. */ - virtual void deserialize(const DocumentTypeRepo& repo, const DataType& type, - ByteBuffer& buffer, uint16_t version); + virtual void deserialize(const DocumentTypeRepo& repo, const DataType& type, ByteBuffer& buffer); /** @return the datatype of the last path element in the field path */ const DataType& getResultingDataType(const FieldPath & path) const; diff --git a/document/src/vespa/document/update/removefieldpathupdate.cpp b/document/src/vespa/document/update/removefieldpathupdate.cpp index c0ae2f869e4..709a5b37793 100644 --- a/document/src/vespa/document/update/removefieldpathupdate.cpp +++ b/document/src/vespa/document/update/removefieldpathupdate.cpp @@ -36,10 +36,9 @@ RemoveFieldPathUpdate::print(std::ostream& out, bool verbose, const std::string& } void -RemoveFieldPathUpdate::deserialize(const DocumentTypeRepo& repo, const DataType& type, - ByteBuffer& buffer, uint16_t version) +RemoveFieldPathUpdate::deserialize(const DocumentTypeRepo& repo, const DataType& type, ByteBuffer& buffer) { - FieldPathUpdate::deserialize(repo, type, buffer, version); + FieldPathUpdate::deserialize(repo, type, buffer); } namespace { diff --git a/document/src/vespa/document/update/removefieldpathupdate.h b/document/src/vespa/document/update/removefieldpathupdate.h index db7e234bfc8..d53a7787ea5 100644 --- a/document/src/vespa/document/update/removefieldpathupdate.h +++ b/document/src/vespa/document/update/removefieldpathupdate.h @@ -23,8 +23,7 @@ public: private: uint8_t getSerializedType() const override { return RemoveMagic; } - void deserialize(const DocumentTypeRepo& repo, const DataType& type, - ByteBuffer& buffer, uint16_t version) override; + void deserialize(const DocumentTypeRepo& repo, const DataType& type, ByteBuffer& buffer) override; std::unique_ptr<fieldvalue::IteratorHandler> getIteratorHandler(Document &, const DocumentTypeRepo &) const override; }; |