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 2013/08/14 20:07:37 UTC
[14/18] git commit: Fixed executor driver to store tasks and updates
in LinkedHashMap.
Fixed executor driver to store tasks and updates in LinkedHashMap.
Review: https://reviews.apache.org/r/13486
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/755308dc
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/755308dc
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/755308dc
Branch: refs/heads/master
Commit: 755308dca1976b2df08ef264108fff0e7fdc6aa9
Parents: 010fa31
Author: Vinod Kone <vi...@twitter.com>
Authored: Sun Aug 11 17:58:50 2013 -0700
Committer: Vinod Kone <vi...@twitter.com>
Committed: Wed Aug 14 10:57:40 2013 -0700
----------------------------------------------------------------------
src/exec/exec.cpp | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/755308dc/src/exec/exec.cpp
----------------------------------------------------------------------
diff --git a/src/exec/exec.cpp b/src/exec/exec.cpp
index d467724..1a0dd07 100644
--- a/src/exec/exec.cpp
+++ b/src/exec/exec.cpp
@@ -33,7 +33,7 @@
#include <process/protobuf.hpp>
#include <stout/duration.hpp>
-#include <stout/hashmap.hpp>
+#include <stout/linkedhashmap.hpp>
#include <stout/hashset.hpp>
#include <stout/fatal.hpp>
#include <stout/numify.hpp>
@@ -246,12 +246,16 @@ protected:
message.mutable_framework_id()->MergeFrom(frameworkId);
// Send all unacknowledged updates.
- foreachvalue (const StatusUpdate& update, updates) {
+ // TODO(vinod): Use foreachvalue instead once LinkedHashmap
+ // supports it.
+ foreach (const StatusUpdate& update, updates.values()) {
message.add_updates()->MergeFrom(update);
}
// Send all unacknowledged tasks.
- foreachvalue (const TaskInfo& task, tasks) {
+ // TODO(vinod): Use foreachvalue instead once LinkedHashmap
+ // supports it.
+ foreach (const TaskInfo& task, tasks.values()) {
message.add_tasks()->MergeFrom(task);
}
@@ -494,13 +498,13 @@ private:
const string directory;
bool checkpoint;
- hashmap<UUID, StatusUpdate> updates; // Unacknowledged updates.
+ LinkedHashMap<UUID, StatusUpdate> updates; // Unacknowledged updates.
// We store tasks that have not been acknowledged
// (via status updates) by the slave. This ensures that, during
// recovery, the slave relaunches only those tasks that have
// never reached this executor.
- hashmap<TaskID, TaskInfo> tasks; // Unacknowledged tasks.
+ LinkedHashMap<TaskID, TaskInfo> tasks; // Unacknowledged tasks.
};
} // namespace internal {