diff options
author | Henning Baldersheim <balder@oath.com> | 2018-06-07 07:34:57 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-06-12 22:50:28 +0200 |
commit | 6c04171843d0d9ebc99f6b91303a76c62eb2aef4 (patch) | |
tree | 338ffa8e190c93ef4abab1ebd1ac79036c74cfd2 /storageapi | |
parent | 047ea0bed80966554e29a1db1b35361d946a3866 (diff) |
1 - Use a backing buffer for the DocumentUpdate that always is source of truth.
2 - Use this buffer for re-serialization.
3 - Make deserialization lazy where possible.
Currently lazy on replay and when arriving over the storageapi.
Still needs to eager over documentapi.
4 - Deserialize eagerly in the persistence thread since those are plentyfull and not bottlenecked,
instead of in the single master thread.
Use real repo.
Diffstat (limited to 'storageapi')
-rw-r--r-- | storageapi/src/tests/mbusprot/storageprotocoltest.cpp | 4 | ||||
-rw-r--r-- | storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp index a809d80e0f5..cfc69bcde45 100644 --- a/storageapi/src/tests/mbusprot/storageprotocoltest.cpp +++ b/storageapi/src/tests/mbusprot/storageprotocoltest.cpp @@ -294,7 +294,7 @@ void StorageProtocolTest::testUpdate51() { ScopedName test("testUpdate51"); - document::DocumentUpdate::SP update(new document::DocumentUpdate(*_testDoc->getDataType(), _testDoc->getId())); + document::DocumentUpdate::SP update(new document::DocumentUpdate(_docMan.getTypeRepo(), *_testDoc->getDataType(), _testDoc->getId())); std::shared_ptr<document::AssignValueUpdate> assignUpdate(new document::AssignValueUpdate(document::IntFieldValue(17))); document::FieldUpdate fieldUpdate(_testDoc->getField("headerval")); fieldUpdate.addUpdate(*assignUpdate); @@ -912,7 +912,7 @@ StorageProtocolTest::testUpdateCommand52() { ScopedName test("testUpdateCommand52"); - document::DocumentUpdate::SP update(new document::DocumentUpdate(*_testDoc->getDataType(), _testDoc->getId())); + document::DocumentUpdate::SP update(new document::DocumentUpdate(_docMan.getTypeRepo(), *_testDoc->getDataType(), _testDoc->getId())); UpdateCommand::SP cmd(new UpdateCommand(_bucket, update, 14)); cmd->setCondition(TestAndSetCondition(CONDITION_STRING)); diff --git a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp index 44050264484..47b77af74a5 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/protocolserialization5_0.cpp @@ -228,9 +228,8 @@ ProtocolSerialization5_0::onDecodeUpdateCommand(BBuf& buf) const uint32_t size = SH::getInt(buf); if (size != 0) { - document::ByteBuffer bbuf(buf.getBufferAtPos(), size); + update = document::DocumentUpdate::createHEAD(getTypeRepo(), vespalib::nbostream(buf.getBufferAtPos(), size)); buf.incPos(size); - update = document::DocumentUpdate::createHEAD(getTypeRepo(), bbuf); } document::Bucket bucket = getBucket(buf); |