diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-07-09 10:09:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-09 10:09:40 +0200 |
commit | 66fa206a9e95fc5a0888b3a2949d70a9ab46d430 (patch) | |
tree | afa6a43ee22ccdd366e8d508f019053f40473734 | |
parent | f45cb2ddf0537001d017a84f44a84eeaf4cd7a39 (diff) | |
parent | ced4d4579207a48e0e8f0ff14c5d58789c17a7f9 (diff) |
Merge pull request #13843 from vespa-engine/balder/non-semantic-changes-prior-2-sequencer
Remove non-semantic changes prior to using a sequenced threadpool in …
4 files changed, 9 insertions, 12 deletions
diff --git a/messagebus/src/tests/bucketsequence/bucketsequence.cpp b/messagebus/src/tests/bucketsequence/bucketsequence.cpp index 57d1f99e5c3..671f50efc03 100644 --- a/messagebus/src/tests/bucketsequence/bucketsequence.cpp +++ b/messagebus/src/tests/bucketsequence/bucketsequence.cpp @@ -11,19 +11,13 @@ using namespace mbus; -TEST_SETUP(Test); - class MyMessage : public SimpleMessage { public: MyMessage() : SimpleMessage("foo") { } - bool hasBucketSequence() override { return true; } + bool hasBucketSequence() const override { return true; } }; -int -Test::Main() -{ - TEST_INIT("bucketsequence_test"); - +TEST("bucketsequence_test") { Slobrok slobrok; TestServer server(MessageBusParams() .addProtocol(std::make_shared<SimpleProtocol>()) @@ -37,9 +31,10 @@ Test::Main() msg->setRoute(Route::parse("foo")); ASSERT_TRUE(session->send(std::move(msg)).isAccepted()); Reply::UP reply = receptor.getReply(); - ASSERT_TRUE(reply.get() != nullptr); + ASSERT_TRUE(reply); EXPECT_EQUAL(1u, reply->getNumErrors()); EXPECT_EQUAL((uint32_t)ErrorCode::SEQUENCE_ERROR, reply->getError(0).getCode()); - TEST_DONE(); } + +TEST_MAIN() { TEST_RUN_ALL(); } diff --git a/messagebus/src/vespa/messagebus/message.h b/messagebus/src/vespa/messagebus/message.h index 15e7384707c..22fb1e282b6 100644 --- a/messagebus/src/vespa/messagebus/message.h +++ b/messagebus/src/vespa/messagebus/message.h @@ -135,7 +135,7 @@ public: * * @return True to enable bucket sequencing. */ - virtual bool hasBucketSequence() { return false; } + virtual bool hasBucketSequence() const { return false; } /** * Obtain the approximate size of this message object in bytes. This enables diff --git a/messagebus/src/vespa/messagebus/network/rpcsend.cpp b/messagebus/src/vespa/messagebus/network/rpcsend.cpp index 2422638dc05..dca7f0c997f 100644 --- a/messagebus/src/vespa/messagebus/network/rpcsend.cpp +++ b/messagebus/src/vespa/messagebus/network/rpcsend.cpp @@ -114,7 +114,7 @@ RPCSend::send(RoutingNode &recipient, const vespalib::Version &version, const PayLoadFiller & payload, duration timeRemaining) { auto ctx = std::make_unique<SendContext>(recipient, timeRemaining); - RPCServiceAddress &address = static_cast<RPCServiceAddress&>(recipient.getServiceAddress()); + auto &address = static_cast<RPCServiceAddress&>(recipient.getServiceAddress()); const Message &msg = recipient.getMessage(); Route route = recipient.getRoute(); Hop hop = route.removeHop(0); diff --git a/storageapi/src/vespa/storageapi/mbusprot/storagecommand.h b/storageapi/src/vespa/storageapi/mbusprot/storagecommand.h index 88af61509d5..26c9ef00752 100644 --- a/storageapi/src/vespa/storageapi/mbusprot/storagecommand.h +++ b/storageapi/src/vespa/storageapi/mbusprot/storagecommand.h @@ -21,6 +21,8 @@ public: api::StorageMessage::SP getInternalMessage() override { return _cmd; } api::StorageMessage::CSP getInternalMessage() const override { return _cmd; } + bool hasBucketSequence() const override { return false; } + uint8_t priority() const override { return ((getInternalMessage()->getPriority()) / 255) * 16; } |