diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2016-10-02 19:59:41 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2016-10-03 16:52:36 +0000 |
commit | 6a0ea2d5fce1967927cf1f4f319fb0209ac2eb1e (patch) | |
tree | cdf844359ac298e85d5ffc4e15f467964a8c7593 /storageapi | |
parent | 74d9d289d9b9ffd5f9f427a1fb7abf176bae4abe (diff) |
Checkpoint 1
Diffstat (limited to 'storageapi')
-rw-r--r-- | storageapi/src/vespa/storageapi/mbusprot/storagereply.cpp | 16 | ||||
-rw-r--r-- | storageapi/src/vespa/storageapi/mbusprot/storagereply.h | 2 | ||||
-rw-r--r-- | storageapi/src/vespa/storageapi/message/bucket.h | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/storageapi/src/vespa/storageapi/mbusprot/storagereply.cpp b/storageapi/src/vespa/storageapi/mbusprot/storagereply.cpp index b9fde51eaef..0165348968e 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storagereply.cpp +++ b/storageapi/src/vespa/storageapi/mbusprot/storagereply.cpp @@ -4,13 +4,17 @@ #include <vespa/storageapi/mbusprot/storagecommand.h> +using vespalib::DefaultAlloc; +using vespalib::alloc::Alloc; +using vespalib::IllegalStateException; + namespace storage { namespace mbusprot { StorageReply::StorageReply(const mbus::BlobRef& data, const ProtocolSerialization& serializer) : _serializer(&serializer), - _buffer(data.size()), + _buffer(DefaultAlloc::create(data.size())), _mbusType(0), _reply() { @@ -38,20 +42,16 @@ StorageReply::deserialize() const StorageReply& reply(const_cast<StorageReply&>(*this)); mbus::Message::UP msg(reply.getMessage()); if (msg.get() == 0) { - throw vespalib::IllegalStateException( - "Cannot deserialize storage reply before message have been set", - VESPA_STRLOC); + throw IllegalStateException("Cannot deserialize storage reply before message have been set", VESPA_STRLOC); } const StorageCommand* cmd(dynamic_cast<const StorageCommand*>(msg.get())); reply.setMessage(std::move(msg)); if (cmd == 0) { - throw vespalib::IllegalStateException( - "Storage reply get message did not return a storage command", - VESPA_STRLOC); + throw IllegalStateException("Storage reply get message did not return a storage command", VESPA_STRLOC); } mbus::BlobRef blobRef(static_cast<char *>(_buffer.get()), _buffer.size()); _reply = _serializer->decodeReply(blobRef, *cmd->getCommand())->getReply(); - vespalib::DefaultAlloc().swap(_buffer); + Alloc().swap(_buffer); } } // mbusprot diff --git a/storageapi/src/vespa/storageapi/mbusprot/storagereply.h b/storageapi/src/vespa/storageapi/mbusprot/storagereply.h index 52f7efc50cc..429833bf08b 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storagereply.h +++ b/storageapi/src/vespa/storageapi/mbusprot/storagereply.h @@ -11,7 +11,7 @@ namespace mbusprot { class StorageReply : public mbus::Reply, public StorageMessage { const ProtocolSerialization* _serializer; - mutable vespalib::DefaultAlloc _buffer; + mutable vespalib::alloc::Alloc _buffer; uint32_t _mbusType; mutable api::StorageReply::SP _reply; diff --git a/storageapi/src/vespa/storageapi/message/bucket.h b/storageapi/src/vespa/storageapi/message/bucket.h index 28b3ba36f30..b47aa01c63e 100644 --- a/storageapi/src/vespa/storageapi/message/bucket.h +++ b/storageapi/src/vespa/storageapi/message/bucket.h @@ -409,7 +409,7 @@ public: : _bucketId(id), _info(info) {} friend std::ostream& operator<<(std::ostream& os, const Entry&); }; - typedef vespalib::Array<Entry, vespalib::DefaultAlloc> EntryVector; + typedef vespalib::Array<Entry> EntryVector; private: EntryVector _buckets; |