You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2016/02/28 18:55:22 UTC
[04/10] mesos git commit: Renamed Connection to SubscribedResponse.
Renamed Connection to SubscribedResponse.
This change renames the `Connection` object that existed previously to
`SubscribedResponse`. This would be needed later in the review chain when we
implement pipelining.
Review: https://reviews.apache.org/r/43660/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d891d963
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d891d963
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d891d963
Branch: refs/heads/master
Commit: d891d963531673bb2649ec60ac940905a0576cf8
Parents: 5651e44
Author: Anand Mazumdar <ma...@gmail.com>
Authored: Sun Feb 28 09:51:53 2016 -0800
Committer: Vinod Kone <vi...@gmail.com>
Committed: Sun Feb 28 09:51:53 2016 -0800
----------------------------------------------------------------------
src/scheduler/scheduler.cpp | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/d891d963/src/scheduler/scheduler.cpp
----------------------------------------------------------------------
diff --git a/src/scheduler/scheduler.cpp b/src/scheduler/scheduler.cpp
index ec688d6..d39cf9d 100644
--- a/src/scheduler/scheduler.cpp
+++ b/src/scheduler/scheduler.cpp
@@ -341,7 +341,7 @@ protected:
Owned<Reader<Event>> decoder(
new Reader<Event>(Decoder<Event>(deserializer), reader));
- connection = Connection {reader, decoder};
+ subscribed = SubscribedResponse {reader, decoder};
read();
@@ -370,10 +370,10 @@ protected:
void read()
{
- connection.get().decoder->read()
+ subscribed->decoder->read()
.onAny(defer(self(),
&Self::_read,
- connection.get().reader,
+ subscribed->reader,
lambda::_1));
}
@@ -382,7 +382,7 @@ protected:
CHECK(!event.isDiscarded());
// Ignore enqueued events from the previous Subscribe call reader.
- if (!connection.isSome() || connection.get().reader != reader) {
+ if (!subscribed.isSome() || subscribed->reader != reader) {
VLOG(1) << "Ignoring event from old stale connection";
return;
}
@@ -443,23 +443,21 @@ protected:
void disconnect()
{
- if (connection.isSome()) {
- if (!connection.get().reader.close()) {
- LOG(WARNING) << "HTTP connection was already closed";
- }
+ if (subscribed.isSome()) {
+ subscribed->reader.close();
}
- connection = None();
+ subscribed = None();
}
private:
- struct Connection
+ struct SubscribedResponse
{
Pipe::Reader reader;
process::Owned<Reader<Event>> decoder;
};
- Option<Connection> connection;
+ Option<SubscribedResponse> subscribed;
ContentType contentType;