You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2017/08/24 20:11:13 UTC

[7/8] mesos git commit: Renamed Framework::pending to Framework::pendingTasks in agent.

Renamed Framework::pending to Framework::pendingTasks in agent.

Review: https://reviews.apache.org/r/61643


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/dbbd9c20
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/dbbd9c20
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/dbbd9c20

Branch: refs/heads/1.2.x
Commit: dbbd9c20fac634a839288a0cae526ff35c5d0bc0
Parents: 9957085
Author: Benjamin Mahler <bm...@apache.org>
Authored: Fri Aug 4 16:56:40 2017 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Thu Aug 24 13:10:29 2017 -0700

----------------------------------------------------------------------
 src/slave/http.cpp  |  2 +-
 src/slave/slave.cpp | 24 ++++++++++++------------
 src/slave/slave.hpp |  6 +++---
 3 files changed, 16 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/dbbd9c20/src/slave/http.cpp
----------------------------------------------------------------------
diff --git a/src/slave/http.cpp b/src/slave/http.cpp
index ccd489d..df64406 100644
--- a/src/slave/http.cpp
+++ b/src/slave/http.cpp
@@ -1606,7 +1606,7 @@ agent::Response::GetTasks Slave::Http::_getTasks(
   foreach (const Framework* framework, frameworks) {
     // Pending tasks.
     typedef hashmap<TaskID, TaskInfo> TaskMap;
-    foreachvalue (const TaskMap& taskInfos, framework->pending) {
+    foreachvalue (const TaskMap& taskInfos, framework->pendingTasks) {
       foreachvalue (const TaskInfo& taskInfo, taskInfos) {
         // Skip unauthorized tasks.
         if (!approveViewTaskInfo(tasksApprover, taskInfo, framework->info)) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/dbbd9c20/src/slave/slave.cpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.cpp b/src/slave/slave.cpp
index 754d463..0a57be5 100644
--- a/src/slave/slave.cpp
+++ b/src/slave/slave.cpp
@@ -1422,7 +1422,7 @@ void Slave::doReliableRegistration(Duration maxBackoff)
       // pending tasks, and we need to send exited events if they
       // cannot be launched, see MESOS-1715, MESOS-1720, MESOS-1800.
       typedef hashmap<TaskID, TaskInfo> TaskMap;
-      foreachvalue (const TaskMap& tasks, framework->pending) {
+      foreachvalue (const TaskMap& tasks, framework->pendingTasks) {
         foreachvalue (const TaskInfo& task, tasks) {
           message.add_tasks()->CopyFrom(protobuf::createTask(
               task, TASK_STAGING, framework->id()));
@@ -1732,7 +1732,7 @@ void Slave::run(
   // are not scheduled for deletion before '_run()' is called.
   CHECK_NOTNULL(framework);
   foreach (const TaskInfo& _task, tasks) {
-    framework->pending[executorId][_task.task_id()] = _task;
+    framework->pendingTasks[executorId][_task.task_id()] = _task;
   }
 
   // If we are about to create a new executor, unschedule the top
@@ -2462,7 +2462,7 @@ void Slave::killTask(
 
     // We send the TASK_KILLED status update in `_run()` as the
     // task being killed could be part of a task group and we
-    // don't store this information in `framework->pending`.
+    // don't store this information in `framework->pendingTasks`.
     // We don't invoke `removeFramework()` here since we need the
     // framework to be valid for sending the status update later.
     return;
@@ -4953,7 +4953,7 @@ void Slave::removeExecutor(Framework* framework, Executor* executor)
 
   // Schedule the top level executor work directory, only if the
   // framework doesn't have any 'pending' tasks for this executor.
-  if (!framework->pending.contains(executor->id)) {
+  if (!framework->pendingTasks.contains(executor->id)) {
     const string path = paths::getExecutorPath(
         flags.work_dir, info.id(), framework->id(), executor->id);
 
@@ -4975,7 +4975,7 @@ void Slave::removeExecutor(Framework* framework, Executor* executor)
 
     // Schedule the top level executor meta directory, only if the
     // framework doesn't have any 'pending' tasks for this executor.
-    if (!framework->pending.contains(executor->id)) {
+    if (!framework->pendingTasks.contains(executor->id)) {
       const string path = paths::getExecutorPath(
           metaDir, info.id(), framework->id(), executor->id);
 
@@ -6118,7 +6118,7 @@ double Slave::_tasks_staging()
   double count = 0.0;
   foreachvalue (Framework* framework, frameworks) {
     typedef hashmap<TaskID, TaskInfo> TaskMap;
-    foreachvalue (const TaskMap& tasks, framework->pending) {
+    foreachvalue (const TaskMap& tasks, framework->pendingTasks) {
       count += tasks.size();
     }
 
@@ -6476,7 +6476,7 @@ Framework::Framework(
 
 bool Framework::idle() const
 {
-  return executors.empty() && pending.empty();
+  return executors.empty() && pendingTasks.empty();
 }
 
 
@@ -6908,11 +6908,11 @@ void Framework::recoverExecutor(const ExecutorState& state)
 
 bool Framework::removePendingTask(const TaskID& taskId)
 {
-  foreachkey (const ExecutorID& executorId, pending) {
-    if (pending.at(executorId).contains(taskId)) {
-      pending.at(executorId).erase(taskId);
-      if (pending.at(executorId).empty()) {
-        pending.erase(executorId);
+  foreachkey (const ExecutorID& executorId, pendingTasks) {
+    if (pendingTasks.at(executorId).contains(taskId)) {
+      pendingTasks.at(executorId).erase(taskId);
+      if (pendingTasks.at(executorId).empty()) {
+        pendingTasks.erase(executorId);
       }
       return true;
     }

http://git-wip-us.apache.org/repos/asf/mesos/blob/dbbd9c20/src/slave/slave.hpp
----------------------------------------------------------------------
diff --git a/src/slave/slave.hpp b/src/slave/slave.hpp
index 495d5d1..1c4f625 100644
--- a/src/slave/slave.hpp
+++ b/src/slave/slave.hpp
@@ -1097,7 +1097,7 @@ struct Framework
   // being bypassed, and provide public views into them.
 
   // Executors with pending tasks.
-  hashmap<ExecutorID, hashmap<TaskID, TaskInfo>> pending;
+  hashmap<ExecutorID, hashmap<TaskID, TaskInfo>> pendingTasks;
 
   // Current running executors.
   hashmap<ExecutorID, Executor*> executors;
@@ -1106,8 +1106,8 @@ struct Framework
 
   bool hasTask(const TaskID& taskId)
   {
-    foreachkey (const ExecutorID& executorId, pending) {
-      if (pending[executorId].contains(taskId)) {
+    foreachkey (const ExecutorID& executorId, pendingTasks) {
+      if (pendingTasks[executorId].contains(taskId)) {
         return true;
       }
     }