mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bmah...@apache.org
Subject [2/4] mesos git commit: Updated mesos to use vector instead of list where possible.
Date Thu, 31 May 2018 02:49:20 GMT
Updated mesos to use vector instead of list where possible.

This needs to be done due to the updates to collect and await
as well as hashmap and LinkedHashmap.

Other locations were updated as well since this was done as
a sweep.

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


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

Branch: refs/heads/master
Commit: a52e5288ea94ec7d84f82c6c01c1ce3c7a3902db
Parents: c694333
Author: Benjamin Mahler <bmahler@apache.org>
Authored: Thu May 24 19:38:25 2018 -0700
Committer: Benjamin Mahler <bmahler@apache.org>
Committed: Wed May 30 19:41:58 2018 -0700

----------------------------------------------------------------------
 CHANGELOG                                       |  3 +-
 docs/upgrades.md                                |  5 ++
 include/mesos/slave/isolator.hpp                |  4 +-
 src/common/http.cpp                             |  4 +-
 src/docker/docker.cpp                           | 27 +++++-----
 src/docker/docker.hpp                           | 14 ++---
 src/hook/manager.cpp                            |  7 ++-
 src/launcher/default_executor.cpp               | 28 +++++-----
 src/linux/cgroups.cpp                           | 14 +++--
 src/linux/ns.cpp                                |  2 +-
 src/log/network.hpp                             | 13 ++---
 src/master/master.cpp                           | 27 +++++-----
 src/master/master.hpp                           |  5 +-
 src/master/quota_handler.cpp                    |  7 ++-
 src/master/weights_handler.cpp                  | 15 +++---
 src/resource_provider/manager.cpp               |  5 +-
 src/resource_provider/storage/provider.cpp      | 22 ++++----
 src/slave/containerizer/composing.cpp           |  8 ++-
 src/slave/containerizer/docker.cpp              |  8 +--
 src/slave/containerizer/docker.hpp              |  5 +-
 src/slave/containerizer/fetcher.cpp             |  2 +-
 src/slave/containerizer/mesos/containerizer.cpp | 57 ++++++++++----------
 src/slave/containerizer/mesos/containerizer.hpp | 21 ++++----
 .../containerizer/mesos/io/switchboard.cpp      |  4 +-
 .../containerizer/mesos/io/switchboard.hpp      |  2 +-
 src/slave/containerizer/mesos/isolator.cpp      |  4 +-
 src/slave/containerizer/mesos/isolator.hpp      |  4 +-
 .../mesos/isolators/cgroups/cgroups.cpp         | 43 ++++++++-------
 .../mesos/isolators/cgroups/cgroups.hpp         | 18 +++----
 .../isolators/cgroups/subsystems/memory.cpp     | 11 ++--
 .../isolators/cgroups/subsystems/memory.hpp     |  6 +--
 .../mesos/isolators/docker/volume/isolator.cpp  | 11 ++--
 .../mesos/isolators/docker/volume/isolator.hpp  |  7 ++-
 .../mesos/isolators/environment_secret.cpp      |  8 +--
 .../mesos/isolators/filesystem/linux.cpp        |  7 ++-
 .../mesos/isolators/filesystem/linux.hpp        |  2 +-
 .../mesos/isolators/filesystem/posix.cpp        |  6 +--
 .../mesos/isolators/filesystem/posix.hpp        |  2 +-
 .../mesos/isolators/gpu/isolator.cpp            |  6 +--
 .../mesos/isolators/gpu/isolator.hpp            |  4 +-
 .../mesos/isolators/network/cni/cni.cpp         | 10 ++--
 .../mesos/isolators/network/cni/cni.hpp         |  6 +--
 .../containerizer/mesos/isolators/posix.hpp     |  2 +-
 .../mesos/isolators/posix/disk.cpp              |  3 +-
 .../mesos/isolators/posix/disk.hpp              |  2 +-
 .../mesos/isolators/volume/image.cpp            |  4 +-
 .../mesos/isolators/volume/image.hpp            |  3 +-
 .../mesos/isolators/volume/sandbox_path.cpp     |  4 +-
 .../mesos/isolators/volume/sandbox_path.hpp     |  2 +-
 .../mesos/isolators/volume/secret.cpp           |  8 +--
 .../mesos/isolators/windows/cpu.cpp             |  6 +--
 .../mesos/isolators/windows/cpu.hpp             |  4 +-
 .../mesos/isolators/windows/mem.cpp             |  4 +-
 .../mesos/isolators/windows/mem.hpp             |  4 +-
 src/slave/containerizer/mesos/launcher.cpp      |  3 +-
 src/slave/containerizer/mesos/launcher.hpp      |  6 +--
 .../containerizer/mesos/linux_launcher.cpp      |  7 ++-
 .../containerizer/mesos/linux_launcher.hpp      |  2 +-
 .../mesos/provisioner/appc/store.cpp            |  7 +--
 .../mesos/provisioner/backends/copy.cpp         |  5 +-
 .../mesos/provisioner/docker/local_puller.cpp   |  3 +-
 .../provisioner/docker/registry_puller.cpp      |  5 +-
 .../mesos/provisioner/docker/store.cpp          |  2 +-
 .../mesos/provisioner/provisioner.cpp           | 13 +++--
 .../mesos/provisioner/provisioner.hpp           |  4 +-
 src/slave/http.cpp                              | 15 +++---
 src/slave/slave.cpp                             | 38 +++++++------
 src/slave/slave.hpp                             |  8 +--
 .../docker_containerizer_tests.cpp              |  2 +-
 src/tests/containerizer/docker_tests.cpp        |  8 +--
 src/tests/containerizer/isolator.hpp            |  2 +-
 src/tests/containerizer/launcher.hpp            |  3 +-
 src/tests/fetcher_cache_tests.cpp               |  4 +-
 src/tests/health_check_tests.cpp                |  8 +--
 src/tests/hook_tests.cpp                        |  7 ++-
 src/tests/master_benchmarks.cpp                 |  8 ++-
 src/tests/mock_docker.hpp                       |  5 +-
 src/tests/mock_slave.cpp                        |  6 +--
 src/tests/mock_slave.hpp                        |  8 +--
 src/tests/slave_tests.cpp                       |  8 +--
 src/uri/fetchers/docker.cpp                     |  4 +-
 81 files changed, 343 insertions(+), 358 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/CHANGELOG
----------------------------------------------------------------------
diff --git a/CHANGELOG b/CHANGELOG
index 30b93e4..1c12cfc 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,7 +9,8 @@ This release contains the following new features:
 Additional API Changes:
   * Container logger module interface has been changed. The `prepare()` method
     now takes `ContainerID` and `ContainerConfig` instead.
-
+  * `Isolator::recover` interface has been changed to take an `std::vector`
+    instead of `std::list`.
 
 Release Notes - Mesos - Version 1.6.1 (WIP)
 -------------------------------------------

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/docs/upgrades.md
----------------------------------------------------------------------
diff --git a/docs/upgrades.md b/docs/upgrades.md
index 1a1705c..9e20681 100644
--- a/docs/upgrades.md
+++ b/docs/upgrades.md
@@ -65,6 +65,7 @@ We categorize the changes as follows:
   <td style="word-wrap: break-word; overflow-wrap: break-word;"><!--Module API-->
     <ul style="padding-left:10px;">
       <li>C <a href="#1-7-x-container-logger">ContainerLogger module interface changes</a></li>
+      <li>C <a href="#1-7-x-isolator-recover">Isolator::recover module interface change</a></li>
     </ul>
   </td>
 
@@ -441,6 +442,10 @@ We categorize the changes as follows:
 
 * `ContainerLogger` module interface has been changed. The `prepare()` method now takes `ContainerID` and `ContainerConfig` instead.
 
+<a name="1-7-x-isolator-recover"></a>
+
+* `Isolator::recover()` has been updated to take an `std::vector` instead of `std::list` of container states.
+
 ## Upgrading from 1.5.x to 1.6.x ##
 
 <a name="1-6-x-grpc-requirement"></a>

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/include/mesos/slave/isolator.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/slave/isolator.hpp b/include/mesos/slave/isolator.hpp
index f682e30..65893e1 100644
--- a/include/mesos/slave/isolator.hpp
+++ b/include/mesos/slave/isolator.hpp
@@ -17,8 +17,8 @@
 #ifndef __MESOS_SLAVE_ISOLATOR_HPP__
 #define __MESOS_SLAVE_ISOLATOR_HPP__
 
-#include <list>
 #include <string>
+#include <vector>
 
 #include <mesos/resources.hpp>
 
@@ -58,7 +58,7 @@ public:
   // (known to the launcher but not known to the slave) detected by
   // the launcher.
   virtual process::Future<Nothing> recover(
-      const std::list<ContainerState>& states,
+      const std::vector<ContainerState>& states,
       const hashset<ContainerID>& orphans)
   {
     return Nothing();

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/common/http.cpp
----------------------------------------------------------------------
diff --git a/src/common/http.cpp b/src/common/http.cpp
index 0098c14..9dfbfd1 100644
--- a/src/common/http.cpp
+++ b/src/common/http.cpp
@@ -888,12 +888,12 @@ Future<Owned<ObjectApprovers>> ObjectApprovers::create(
         new ObjectApprovers(std::move(approvers), principal));
   }
 
-  return process::collect(lambda::map<std::list>(
+  return process::collect(lambda::map<vector>(
       [&](authorization::Action action) -> Future<Owned<ObjectApprover>> {
         return authorizer.get()->getObjectApprover(subject, action);
       },
       _actions))
-    .then([=](const std::list<Owned<ObjectApprover>>& _approvers) {
+    .then([=](const vector<Owned<ObjectApprover>>& _approvers) {
       return Owned<ObjectApprovers>(
           new ObjectApprovers(lambda::zip(_actions, _approvers), principal));
     });

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/docker/docker.cpp
----------------------------------------------------------------------
diff --git a/src/docker/docker.cpp b/src/docker/docker.cpp
index d000a90..1332d4b 100644
--- a/src/docker/docker.cpp
+++ b/src/docker/docker.cpp
@@ -56,7 +56,6 @@ using namespace mesos::internal::slave;
 
 using namespace process;
 
-using std::list;
 using std::map;
 using std::mutex;
 using std::pair;
@@ -1440,7 +1439,7 @@ void Docker::___inspect(
 }
 
 
-Future<list<Docker::Container>> Docker::ps(
+Future<vector<Docker::Container>> Docker::ps(
     bool all,
     const Option<string>& prefix) const
 {
@@ -1468,7 +1467,7 @@ Future<list<Docker::Container>> Docker::ps(
 }
 
 
-Future<list<Docker::Container>> Docker::_ps(
+Future<vector<Docker::Container>> Docker::_ps(
     const Docker& docker,
     const string& cmd,
     const Subprocess& s,
@@ -1485,7 +1484,7 @@ Future<list<Docker::Container>> Docker::_ps(
     CHECK_SOME(s.err());
     return io::read(s.err().get())
       .then(lambda::bind(
-                failure<list<Docker::Container>>,
+                failure<vector<Docker::Container>>,
                 cmd,
                 status.get(),
                 lambda::_1));
@@ -1496,7 +1495,7 @@ Future<list<Docker::Container>> Docker::_ps(
 }
 
 
-Future<list<Docker::Container>> Docker::__ps(
+Future<vector<Docker::Container>> Docker::__ps(
     const Docker& docker,
     const Option<string>& prefix,
     const string& output)
@@ -1508,10 +1507,10 @@ Future<list<Docker::Container>> Docker::__ps(
   CHECK(!lines->empty());
   lines->erase(lines->begin());
 
-  Owned<list<Docker::Container>> containers(new list<Docker::Container>());
+  Owned<vector<Docker::Container>> containers(new vector<Docker::Container>());
 
-  Owned<Promise<list<Docker::Container>>> promise(
-    new Promise<list<Docker::Container>>());
+  Owned<Promise<vector<Docker::Container>>> promise(
+    new Promise<vector<Docker::Container>>());
 
   // Limit number of parallel calls to docker inspect at once to prevent
   // reaching system's open file descriptor limit.
@@ -1524,16 +1523,16 @@ Future<list<Docker::Container>> Docker::__ps(
 // TODO(chenlily): Generalize functionality into a concurrency limiter
 // within libprocess.
 void Docker::inspectBatches(
-    Owned<list<Docker::Container>> containers,
+    Owned<vector<Docker::Container>> containers,
     Owned<vector<string>> lines,
-    Owned<Promise<list<Docker::Container>>> promise,
+    Owned<Promise<vector<Docker::Container>>> promise,
     const Docker& docker,
     const Option<string>& prefix)
 {
-  list<Future<Docker::Container>> batch =
+  vector<Future<Docker::Container>> batch =
     createInspectBatch(lines, docker, prefix);
 
-  collect(batch).onAny([=](const Future<list<Docker::Container>>& c) {
+  collect(batch).onAny([=](const Future<vector<Docker::Container>>& c) {
     if (c.isReady()) {
       foreach (const Docker::Container& container, c.get()) {
         containers->push_back(container);
@@ -1556,12 +1555,12 @@ void Docker::inspectBatches(
 }
 
 
-list<Future<Docker::Container>> Docker::createInspectBatch(
+vector<Future<Docker::Container>> Docker::createInspectBatch(
     Owned<vector<string>> lines,
     const Docker& docker,
     const Option<string>& prefix)
 {
-  list<Future<Docker::Container>> batch;
+  vector<Future<Docker::Container>> batch;
 
   while (!lines->empty() && batch.size() < DOCKER_PS_MAX_INSPECT_CALLS) {
     string line = lines->back();

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/docker/docker.hpp
----------------------------------------------------------------------
diff --git a/src/docker/docker.hpp b/src/docker/docker.hpp
index 3c2ab6a..25d9ca6 100644
--- a/src/docker/docker.hpp
+++ b/src/docker/docker.hpp
@@ -17,11 +17,11 @@
 #ifndef __DOCKER_HPP__
 #define __DOCKER_HPP__
 
-#include <list>
 #include <map>
 #include <mutex>
 #include <string>
 #include <utility>
+#include <vector>
 
 #include <process/future.hpp>
 #include <process/owned.hpp>
@@ -298,7 +298,7 @@ public:
       const Option<Duration>& retryInterval = None()) const;
 
   // Performs 'docker ps (-a)'.
-  virtual process::Future<std::list<Container>> ps(
+  virtual process::Future<std::vector<Container>> ps(
       bool all = false,
       const Option<std::string>& prefix = None()) const;
 
@@ -368,26 +368,26 @@ private:
       std::shared_ptr<std::pair<lambda::function<void()>, std::mutex>>
         callback);
 
-  static process::Future<std::list<Container>> _ps(
+  static process::Future<std::vector<Container>> _ps(
       const Docker& docker,
       const std::string& cmd,
       const process::Subprocess& s,
       const Option<std::string>& prefix,
       process::Future<std::string> output);
 
-  static process::Future<std::list<Container>> __ps(
+  static process::Future<std::vector<Container>> __ps(
       const Docker& docker,
       const Option<std::string>& prefix,
       const std::string& output);
 
   static void inspectBatches(
-      process::Owned<std::list<Docker::Container>> containers,
+      process::Owned<std::vector<Docker::Container>> containers,
       process::Owned<std::vector<std::string>> lines,
-      process::Owned<process::Promise<std::list<Docker::Container>>> promise,
+      process::Owned<process::Promise<std::vector<Docker::Container>>> promise,
       const Docker& docker,
       const Option<std::string>& prefix);
 
-  static std::list<process::Future<Docker::Container>> createInspectBatch(
+  static std::vector<process::Future<Docker::Container>> createInspectBatch(
       process::Owned<std::vector<std::string>> lines,
       const Docker& docker,
       const Option<std::string>& prefix);

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/hook/manager.cpp
----------------------------------------------------------------------
diff --git a/src/hook/manager.cpp b/src/hook/manager.cpp
index 44c0c32..eaca93a 100644
--- a/src/hook/manager.cpp
+++ b/src/hook/manager.cpp
@@ -14,7 +14,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <list>
 #include <mutex>
 #include <string>
 #include <vector>
@@ -36,7 +35,6 @@
 #include "hook/manager.hpp"
 #include "module/manager.hpp"
 
-using std::list;
 using std::map;
 using std::string;
 using std::vector;
@@ -216,7 +214,8 @@ Future<DockerTaskExecutorPrepareInfo>
   // We execute these hooks according to their ordering so any conflicting
   // `DockerTaskExecutorPrepareInfo` can be deterministically resolved
   // (the last hook takes priority).
-  list<Future<Option<DockerTaskExecutorPrepareInfo>>> futures;
+  vector<Future<Option<DockerTaskExecutorPrepareInfo>>> futures;
+  futures.reserve(availableHooks.size());
 
   foreachvalue (Hook* hook, availableHooks) {
     // Chain together each hook.
@@ -231,7 +230,7 @@ Future<DockerTaskExecutorPrepareInfo>
   }
 
   return collect(futures)
-    .then([](const list<Option<DockerTaskExecutorPrepareInfo>>& results)
+    .then([](const vector<Option<DockerTaskExecutorPrepareInfo>>& results)
         -> Future<DockerTaskExecutorPrepareInfo> {
       DockerTaskExecutorPrepareInfo taskExecutorDecoratorInfo;
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/launcher/default_executor.cpp
----------------------------------------------------------------------
diff --git a/src/launcher/default_executor.cpp b/src/launcher/default_executor.cpp
index 76c6106..a70ba06 100644
--- a/src/launcher/default_executor.cpp
+++ b/src/launcher/default_executor.cpp
@@ -13,6 +13,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <deque>
 #include <iostream>
 #include <list>
 #include <queue>
@@ -76,6 +77,7 @@ using process::http::URL;
 
 using std::cerr;
 using std::cout;
+using std::deque;
 using std::endl;
 using std::list;
 using std::queue;
@@ -425,8 +427,8 @@ protected:
 
     LOG(INFO) << "Setting 'MESOS_CONTAINER_IP' to: " << containerIP.value();
 
-    list<ContainerID> containerIds;
-    list<Future<Response>> responses;
+    vector<ContainerID> containerIds;
+    vector<Future<Response>> responses;
 
     foreach (const TaskInfo& task, taskGroup.tasks()) {
       ContainerID containerId;
@@ -525,9 +527,9 @@ protected:
 
   void __launchGroup(
       const TaskGroupInfo& taskGroup,
-      const list<ContainerID>& containerIds,
+      const vector<ContainerID>& containerIds,
       const Connection& connection,
-      const Future<list<Response>>& responses)
+      const Future<vector<Response>>& responses)
   {
     if (shuttingDown) {
       LOG(WARNING) << "Ignoring the launch group operation as the "
@@ -651,7 +653,7 @@ protected:
     }
 
     auto taskIds = [&taskGroup]() {
-      list<TaskID> taskIds_;
+      vector<TaskID> taskIds_;
       foreach (const TaskInfo& task, taskGroup.tasks()) {
         taskIds_.push_back(task.task_id());
       }
@@ -676,7 +678,7 @@ protected:
     }
   }
 
-  void wait(const list<TaskID>& taskIds)
+  void wait(const vector<TaskID>& taskIds)
   {
     CHECK_EQ(SUBSCRIBED, state);
     CHECK(!containers.empty());
@@ -684,7 +686,7 @@ protected:
 
     LOG(INFO) << "Waiting on child containers of tasks " << stringify(taskIds);
 
-    list<Future<Connection>> connections;
+    vector<Future<Connection>> connections;
     for (size_t i = 0; i < taskIds.size(); i++) {
       connections.push_back(process::http::connect(agent));
     }
@@ -695,8 +697,8 @@ protected:
   }
 
   void _wait(
-      const Future<list<Connection>>& _connections,
-      const list<TaskID>& taskIds,
+      const Future<vector<Connection>>& _connections,
+      const vector<TaskID>& taskIds,
       const id::UUID& _connectionId)
   {
     // It is possible that the agent process failed in the interim.
@@ -718,7 +720,7 @@ protected:
     CHECK_EQ(SUBSCRIBED, state);
     CHECK_SOME(connectionId);
 
-    list<Connection> connections = _connections.get();
+    deque<Connection> connections(_connections->begin(), _connections->end());
 
     CHECK_EQ(taskIds.size(), connections.size());
     foreach (const TaskID& taskId, taskIds) {
@@ -962,7 +964,7 @@ protected:
         (taskState == TASK_FAILED || taskState == TASK_KILLED)) {
       // Needed for logging.
       auto taskIds = [container]() {
-        list<TaskID> taskIds_;
+        vector<TaskID> taskIds_;
         foreach (const TaskInfo& task, container->taskGroup.tasks()) {
           taskIds_.push_back(task.task_id());
         }
@@ -1037,7 +1039,7 @@ protected:
 
     CHECK_EQ(SUBSCRIBED, state);
 
-    list<Future<Nothing>> killResponses;
+    vector<Future<Nothing>> killResponses;
     foreachvalue (const Owned<Container>& container, containers) {
       // It is possible that we received a `killTask()` request
       // from the scheduler before and are waiting on the `waited()`
@@ -1054,7 +1056,7 @@ protected:
     collect(killResponses)
       .onAny(defer(
           self(),
-          [this](const Future<list<Nothing>>& future) {
+          [this](const Future<vector<Nothing>>& future) {
         if (future.isReady()) {
           return;
         }

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/linux/cgroups.cpp
----------------------------------------------------------------------
diff --git a/src/linux/cgroups.cpp b/src/linux/cgroups.cpp
index 847f116..b12e63c 100644
--- a/src/linux/cgroups.cpp
+++ b/src/linux/cgroups.cpp
@@ -35,7 +35,6 @@ extern "C" {
 #include <glog/logging.h>
 
 #include <fstream>
-#include <list>
 #include <map>
 #include <set>
 #include <sstream>
@@ -78,7 +77,6 @@ using std::dec;
 using std::getline;
 using std::ifstream;
 using std::istringstream;
-using std::list;
 using std::map;
 using std::ofstream;
 using std::ostream;
@@ -1555,13 +1553,13 @@ private:
     return cgroups::freezer::thaw(hierarchy, cgroup);
   }
 
-  Future<list<Option<int>>> reap()
+  Future<vector<Option<int>>> reap()
   {
     // Wait until we've reaped all processes.
     return collect(statuses);
   }
 
-  void finished(const Future<list<Option<int>>>& future)
+  void finished(const Future<vector<Option<int>>>& future)
   {
     if (future.isDiscarded()) {
       promise.fail("Unexpected discard of future");
@@ -1601,8 +1599,8 @@ private:
   const string hierarchy;
   const string cgroup;
   Promise<Nothing> promise;
-  list<Future<Option<int>>> statuses; // List of statuses for processes.
-  Future<list<Option<int>>> chain; // Used to discard all operations.
+  vector<Future<Option<int>>> statuses; // List of statuses for processes.
+  Future<vector<Option<int>>> chain; // Used to discard all operations.
 };
 
 
@@ -1648,7 +1646,7 @@ protected:
   }
 
 private:
-  void killed(const Future<list<Nothing>>& kill)
+  void killed(const Future<vector<Nothing>>& kill)
   {
     if (kill.isReady()) {
       remove();
@@ -1688,7 +1686,7 @@ private:
   Promise<Nothing> promise;
 
   // The killer processes used to atomically kill tasks in each cgroup.
-  list<Future<Nothing>> killers;
+  vector<Future<Nothing>> killers;
 };
 
 } // namespace internal {

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/linux/ns.cpp
----------------------------------------------------------------------
diff --git a/src/linux/ns.cpp b/src/linux/ns.cpp
index 64722c7..ffa9b65 100644
--- a/src/linux/ns.cpp
+++ b/src/linux/ns.cpp
@@ -325,7 +325,7 @@ Try<pid_t> clone(
   hashmap<int, int> fds = {};
 
   // Helper for closing a list of file descriptors.
-  auto close = [](const std::list<int>& fds) {
+  auto close = [](const std::vector<int>& fds) {
     foreach (int fd, fds) {
       ::close(fd); // Need to call the async-signal safe version.
     }

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/log/network.hpp
----------------------------------------------------------------------
diff --git a/src/log/network.hpp b/src/log/network.hpp
index 4aef8b3..317ae14 100644
--- a/src/log/network.hpp
+++ b/src/log/network.hpp
@@ -20,9 +20,10 @@
 // TODO(benh): Eventually move and associate this code with the
 // libprocess protobuf code rather than keep it here.
 
-#include <list>
+#include <deque>
 #include <set>
 #include <string>
+#include <vector>
 
 #include <mesos/zookeeper/group.hpp>
 
@@ -130,7 +131,7 @@ private:
 
   // Invoked when group members data has been collected.
   void collected(
-      const process::Future<std::list<Option<std::string>>>& datas);
+      const process::Future<std::vector<Option<std::string>>>& datas);
 
   zookeeper::Group group;
   process::Future<std::set<zookeeper::Group::Membership>> memberships;
@@ -320,7 +321,7 @@ private:
   }
 
   std::set<process::UPID> pids;
-  std::list<Watch*> watches;
+  std::deque<Watch*> watches;
 };
 
 
@@ -436,7 +437,7 @@ inline void ZooKeeperNetwork::watched(
   LOG(INFO) << "ZooKeeper group memberships changed";
 
   // Get data for each membership in order to convert them to PIDs.
-  std::list<process::Future<Option<std::string>>> futures;
+  std::vector<process::Future<Option<std::string>>> futures;
 
   foreach (const zookeeper::Group::Membership& membership, memberships.get()) {
     futures.push_back(group.data(membership));
@@ -444,7 +445,7 @@ inline void ZooKeeperNetwork::watched(
 
   process::collect(futures)
     .after(Seconds(5),
-           [](process::Future<std::list<Option<std::string>>> datas) {
+           [](process::Future<std::vector<Option<std::string>>> datas) {
              // Handling time outs when collecting membership
              // data. For now, a timeout is treated as a failure.
              datas.discard();
@@ -455,7 +456,7 @@ inline void ZooKeeperNetwork::watched(
 
 
 inline void ZooKeeperNetwork::collected(
-    const process::Future<std::list<Option<std::string>>>& datas)
+    const process::Future<std::vector<Option<std::string>>>& datas)
 {
   if (datas.isFailed()) {
     LOG(WARNING) << "Failed to get data for ZooKeeper group members: "

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/master/master.cpp
----------------------------------------------------------------------
diff --git a/src/master/master.cpp b/src/master/master.cpp
index 41862db..ba3f874 100644
--- a/src/master/master.cpp
+++ b/src/master/master.cpp
@@ -3570,7 +3570,7 @@ Future<bool> Master::authorizeReserveResources(
   // reservations for all roles included in `reserve.resources`.
   // Add an element to `request.roles` for each unique role in the resources.
   hashset<string> roles;
-  list<Future<bool>> authorizations;
+  vector<Future<bool>> authorizations;
   foreach (const Resource& resource, resources) {
     // NOTE: Since authorization happens __before__ validation and resource
     // format conversion, we must look for roles that may appear in both
@@ -3613,7 +3613,7 @@ Future<bool> Master::authorizeReserveResources(
   }
 
   return await(authorizations)
-      .then([](const list<Future<bool>>& authorizations)
+      .then([](const vector<Future<bool>>& authorizations)
             -> Future<bool> {
         // Compute a disjunction.
         foreach (const Future<bool>& authorization, authorizations) {
@@ -3642,7 +3642,7 @@ Future<bool> Master::authorizeUnreserveResources(
     request.mutable_subject()->CopyFrom(subject.get());
   }
 
-  list<Future<bool>> authorizations;
+  vector<Future<bool>> authorizations;
   foreach (const Resource& resource, unreserve.resources()) {
     // NOTE: Since authorization happens __before__ validation and resource
     // format conversion, we must look for the principal that may appear in
@@ -3676,7 +3676,7 @@ Future<bool> Master::authorizeUnreserveResources(
   }
 
   return await(authorizations)
-      .then([](const list<Future<bool>>& authorizations)
+      .then([](const vector<Future<bool>>& authorizations)
             -> Future<bool> {
         // Compute a disjunction.
         foreach (const Future<bool>& authorization, authorizations) {
@@ -3709,7 +3709,7 @@ Future<bool> Master::authorizeCreateVolume(
   // volumes for all roles included in `create.volumes`.
   // Add an element to `request.roles` for each unique role in the volumes.
   hashset<string> roles;
-  list<Future<bool>> authorizations;
+  vector<Future<bool>> authorizations;
   foreach (const Resource& volume, create.volumes()) {
     string role;
     if (volume.reservations_size() > 0) {
@@ -3743,7 +3743,7 @@ Future<bool> Master::authorizeCreateVolume(
   }
 
   return await(authorizations)
-      .then([](const list<Future<bool>>& authorizations)
+      .then([](const vector<Future<bool>>& authorizations)
             -> Future<bool> {
         // Compute a disjunction.
         foreach (const Future<bool>& authorization, authorizations) {
@@ -3772,7 +3772,7 @@ Future<bool> Master::authorizeDestroyVolume(
     request.mutable_subject()->CopyFrom(subject.get());
   }
 
-  list<Future<bool>> authorizations;
+  vector<Future<bool>> authorizations;
   foreach (const Resource& volume, destroy.volumes()) {
     // NOTE: Since validation of this operation may be performed after
     // authorization, we must check here that this resource is a persistent
@@ -3795,7 +3795,7 @@ Future<bool> Master::authorizeDestroyVolume(
   }
 
   return await(authorizations)
-      .then([](const list<Future<bool>>& authorizations)
+      .then([](const vector<Future<bool>>& authorizations)
             -> Future<bool> {
         // Compute a disjunction.
         foreach (const Future<bool>& authorization, authorizations) {
@@ -3853,7 +3853,7 @@ Future<bool> Master::authorizeSlave(
     return true;
   }
 
-  list<Future<bool>> authorizations;
+  vector<Future<bool>> authorizations;
 
   // First authorize whether the agent can register.
   LOG(INFO) << "Authorizing agent providing resources "
@@ -3888,7 +3888,7 @@ Future<bool> Master::authorizeSlave(
   }
 
   return collect(authorizations)
-    .then([](const list<bool>& results)
+    .then([](const vector<bool>& results)
           -> Future<bool> {
       return std::find(results.begin(), results.end(), false) == results.end();
     });
@@ -4362,7 +4362,7 @@ void Master::accept(
   LOG(INFO) << "Processing ACCEPT call for offers: " << accept.offer_ids()
             << " on agent " << *slave << " for framework " << *framework;
 
-  list<Future<bool>> futures;
+  vector<Future<bool>> futures;
   foreach (const Offer::Operation& operation, accept.operations()) {
     switch (operation.type()) {
       case Offer::Operation::LAUNCH:
@@ -4530,7 +4530,7 @@ void Master::_accept(
     const SlaveID& slaveId,
     const Resources& offeredResources,
     scheduler::Call::Accept&& accept,
-    const Future<list<Future<bool>>>& _authorizations)
+    const Future<vector<Future<bool>>>& _authorizations)
 {
   Framework* framework = getFramework(frameworkId);
 
@@ -4657,7 +4657,8 @@ void Master::_accept(
   // The order of `authorizations` must match the order of the operations in
   // `accept.operations()`, as they are iterated through simultaneously.
   CHECK_READY(_authorizations);
-  list<Future<bool>> authorizations = _authorizations.get();
+  std::deque<Future<bool>> authorizations(
+      _authorizations->begin(), _authorizations->end());
 
   foreach (const Offer::Operation& operation, accept.operations()) {
     switch (operation.type()) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/master/master.hpp
----------------------------------------------------------------------
diff --git a/src/master/master.hpp b/src/master/master.hpp
index 5ec764b..4180341 100644
--- a/src/master/master.hpp
+++ b/src/master/master.hpp
@@ -1060,7 +1060,8 @@ private:
       const SlaveID& slaveId,
       const Resources& offeredResources,
       scheduler::Call::Accept&& accept,
-      const process::Future<std::list<process::Future<bool>>>& authorizations);
+      const process::Future<
+          std::vector<process::Future<bool>>>& authorizations);
 
   void acceptInverseOffers(
       Framework* framework,
@@ -1312,7 +1313,7 @@ private:
 
     process::Future<std::vector<WeightInfo>> _filterWeights(
         const std::vector<WeightInfo>& weightInfos,
-        const std::list<bool>& roleAuthorizations) const;
+        const std::vector<bool>& roleAuthorizations) const;
 
     process::Future<std::vector<WeightInfo>> _getWeights(
         const Option<process::http::authentication::Principal>&

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/master/quota_handler.cpp
----------------------------------------------------------------------
diff --git a/src/master/quota_handler.cpp b/src/master/quota_handler.cpp
index 21bafd0..a4975fd 100644
--- a/src/master/quota_handler.cpp
+++ b/src/master/quota_handler.cpp
@@ -17,7 +17,6 @@
 #include "master/master.hpp"
 
 #include <memory>
-#include <list>
 #include <vector>
 
 #include <mesos/resources.hpp>
@@ -62,7 +61,6 @@ using process::Owned;
 
 using process::http::authentication::Principal;
 
-using std::list;
 using std::string;
 using std::unique_ptr;
 using std::vector;
@@ -384,7 +382,8 @@ Future<QuotaStatus> Master::QuotaHandler::_status(
   // Create a list of authorization actions for each role we may return.
   //
   // TODO(alexr): Use an authorization filter here once they are available.
-  list<Future<bool>> authorizedRoles;
+  vector<Future<bool>> authorizedRoles;
+  authorizedRoles.reserve(quotaInfos.size());
   foreach (const QuotaInfo& info, quotaInfos) {
     authorizedRoles.push_back(authorizeGetQuota(principal, info));
   }
@@ -392,7 +391,7 @@ Future<QuotaStatus> Master::QuotaHandler::_status(
   return process::collect(authorizedRoles)
     .then(defer(
         master->self(),
-        [=](const list<bool>& authorizedRolesCollected)
+        [=](const vector<bool>& authorizedRolesCollected)
             -> Future<QuotaStatus> {
       CHECK(quotaInfos.size() == authorizedRolesCollected.size());
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/master/weights_handler.cpp
----------------------------------------------------------------------
diff --git a/src/master/weights_handler.cpp b/src/master/weights_handler.cpp
index 1053652..222ec75 100644
--- a/src/master/weights_handler.cpp
+++ b/src/master/weights_handler.cpp
@@ -16,8 +16,6 @@
 
 #include "master/master.hpp"
 
-#include <list>
-
 #include <mesos/roles.hpp>
 
 #include <mesos/authorizer/authorizer.hpp>
@@ -38,7 +36,6 @@ using google::protobuf::RepeatedPtrField;
 
 using mesos::authorization::createSubject;
 
-using std::list;
 using std::string;
 using std::vector;
 
@@ -120,7 +117,8 @@ Future<vector<WeightInfo>> Master::WeightsHandler::_getWeights(
 
   // Create a list of authorization actions for each role we may return.
   // TODO(alexr): Batch these actions once we have BatchRequest in authorizer.
-  list<Future<bool>> roleAuthorizations;
+  vector<Future<bool>> roleAuthorizations;
+  roleAuthorizations.reserve(weightInfos.size());
   foreach (const WeightInfo& info, weightInfos) {
     roleAuthorizations.push_back(authorizeGetWeight(principal, info));
   }
@@ -128,7 +126,7 @@ Future<vector<WeightInfo>> Master::WeightsHandler::_getWeights(
   return process::collect(roleAuthorizations)
     .then(defer(
         master->self(),
-        [=](const list<bool>& roleAuthorizationsCollected)
+        [=](const vector<bool>& roleAuthorizationsCollected)
           -> Future<vector<WeightInfo>> {
       return _filterWeights(weightInfos, roleAuthorizationsCollected);
   }));
@@ -137,7 +135,7 @@ Future<vector<WeightInfo>> Master::WeightsHandler::_getWeights(
 
 Future<vector<WeightInfo>> Master::WeightsHandler::_filterWeights(
     const vector<WeightInfo>& weightInfos,
-    const list<bool>& roleAuthorizations) const
+    const vector<bool>& roleAuthorizations) const
 {
   CHECK(weightInfos.size() == roleAuthorizations.size());
 
@@ -336,7 +334,8 @@ Future<bool> Master::WeightsHandler::authorizeUpdateWeights(
     request.mutable_subject()->CopyFrom(subject.get());
   }
 
-  list<Future<bool>> authorizations;
+  vector<Future<bool>> authorizations;
+  authorizations.reserve(roles.size());
   foreach (const string& role, roles) {
     request.mutable_object()->set_value(role);
     authorizations.push_back(master->authorizer.get()->authorized(request));
@@ -347,7 +346,7 @@ Future<bool> Master::WeightsHandler::authorizeUpdateWeights(
   }
 
   return await(authorizations)
-      .then([](const list<Future<bool>>& authorizations)
+      .then([](const vector<Future<bool>>& authorizations)
             -> Future<bool> {
         // Compute a disjunction.
         foreach (const Future<bool>& authorization, authorizations) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/resource_provider/manager.cpp
----------------------------------------------------------------------
diff --git a/src/resource_provider/manager.cpp b/src/resource_provider/manager.cpp
index aff1ca5..6400e70 100644
--- a/src/resource_provider/manager.cpp
+++ b/src/resource_provider/manager.cpp
@@ -18,6 +18,7 @@
 
 #include <string>
 #include <utility>
+#include <vector>
 
 #include <glog/logging.h>
 
@@ -53,8 +54,8 @@
 
 namespace http = process::http;
 
-using std::list;
 using std::string;
+using std::vector;
 
 using mesos::internal::resource_provider::validation::call::validate;
 
@@ -613,7 +614,7 @@ Future<Nothing> ResourceProviderManagerProcess::publishResources(
     providedResources[resourceProviderId] += resource;
   }
 
-  list<Future<Nothing>> futures;
+  vector<Future<Nothing>> futures;
 
   foreachpair (const ResourceProviderID& resourceProviderId,
                const Resources& resources,

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/resource_provider/storage/provider.cpp
----------------------------------------------------------------------
diff --git a/src/resource_provider/storage/provider.cpp b/src/resource_provider/storage/provider.cpp
index 63b5d7e..2c7dd8d 100644
--- a/src/resource_provider/storage/provider.cpp
+++ b/src/resource_provider/storage/provider.cpp
@@ -705,7 +705,7 @@ Future<Nothing> StorageLocalResourceProviderProcess::recoverServices()
         containerPaths.error());
   }
 
-  list<Future<Nothing>> futures;
+  vector<Future<Nothing>> futures;
 
   foreach (const string& path, containerPaths.get()) {
     Try<csi::paths::ContainerPath> containerPath =
@@ -810,7 +810,7 @@ Future<Nothing> StorageLocalResourceProviderProcess::recoverVolumes()
         info.storage().plugin().name() + ": " + volumePaths.error());
   }
 
-  list<Future<Nothing>> futures;
+  vector<Future<Nothing>> futures;
 
   foreach (const string& path, volumePaths.get()) {
     Try<csi::paths::VolumePath> volumePath =
@@ -1063,8 +1063,8 @@ StorageLocalResourceProviderProcess::reconcileResourceProviderState()
 {
   return reconcileOperationStatuses()
     .then(defer(self(), [=] {
-      return collect(list<Future<Resources>>{listVolumes(), getCapacities()})
-        .then(defer(self(), [=](const list<Resources>& discovered) {
+      return collect(vector<Future<Resources>>{listVolumes(), getCapacities()})
+        .then(defer(self(), [=](const vector<Resources>& discovered) {
           ResourceConversion conversion = reconcileResources(
               totalResources,
               accumulate(discovered.begin(), discovered.end(), Resources()));
@@ -1205,7 +1205,7 @@ StorageLocalResourceProviderProcess::reconcileOperationStatuses()
       // We replay all pending operations here, so that if a volume is
       // created or deleted before the last failover, the result will be
       // reflected in the total resources before reconciliation.
-      list<Future<Nothing>> futures;
+      vector<Future<Nothing>> futures;
 
       foreachpair (const id::UUID& uuid,
                    const Operation& operation,
@@ -1285,7 +1285,7 @@ Future<Nothing> StorageLocalResourceProviderProcess::updateProfiles()
   LOG(INFO)
     << "Updating metadata for profiles: " << stringify(knownProfiles);
 
-  list<Future<Nothing>> futures;
+  vector<Future<Nothing>> futures;
   foreach (const string& profile, knownProfiles) {
     // Since profiles are immutable after creation and cannot be
     // deleted, we do not need to update any profile that is already in
@@ -1512,12 +1512,12 @@ void StorageLocalResourceProviderProcess::publishResources(
     }
   }
 
-  Future<list<Nothing>> allPublished;
+  Future<vector<Nothing>> allPublished;
 
   if (error.isSome()) {
     allPublished = Failure(error.get());
   } else {
-    list<Future<Nothing>> futures;
+    vector<Future<Nothing>> futures;
 
     foreach (const string& volumeId, volumeIds) {
       // We check the state of the volume along with the CSI calls
@@ -1607,7 +1607,7 @@ void StorageLocalResourceProviderProcess::publishResources(
   }
 
   allPublished
-    .onAny(defer(self(), [=](const Future<list<Nothing>>& future) {
+    .onAny(defer(self(), [=](const Future<vector<Nothing>>& future) {
       // TODO(chhsiao): Currently there is no way to reply to the
       // resource provider manager with a failure message, so we log the
       // failure here.
@@ -2746,7 +2746,7 @@ Future<Resources> StorageLocalResourceProviderProcess::getCapacities()
 
   return getService(controllerContainerId.get())
     .then(defer(self(), [=](csi::v0::Client client) {
-      list<Future<Resources>> futures;
+      vector<Future<Resources>> futures;
 
       foreach (const string& profile, knownProfiles) {
         CHECK(profileInfos.contains(profile));
@@ -2775,7 +2775,7 @@ Future<Resources> StorageLocalResourceProviderProcess::getCapacities()
       }
 
       return collect(futures)
-        .then([](const list<Resources>& resources) {
+        .then([](const vector<Resources>& resources) {
           return accumulate(resources.begin(), resources.end(), Resources());
         });
     }));

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/composing.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/composing.cpp b/src/slave/containerizer/composing.cpp
index 7144ba7..1180eb4 100644
--- a/src/slave/containerizer/composing.cpp
+++ b/src/slave/containerizer/composing.cpp
@@ -14,7 +14,6 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <list>
 #include <vector>
 
 #include <process/collect.hpp>
@@ -37,7 +36,6 @@
 
 using namespace process;
 
-using std::list;
 using std::map;
 using std::string;
 using std::vector;
@@ -287,7 +285,7 @@ Future<Nothing> ComposingContainerizerProcess::recover(
     const Option<state::SlaveState>& state)
 {
   // Recover each containerizer in parallel.
-  list<Future<Nothing>> futures;
+  vector<Future<Nothing>> futures;
   foreach (Containerizer* containerizer, containerizers_) {
     futures.push_back(containerizer->recover(state));
   }
@@ -300,7 +298,7 @@ Future<Nothing> ComposingContainerizerProcess::recover(
 Future<Nothing> ComposingContainerizerProcess::_recover()
 {
   // Now collect all the running containers in order to multiplex.
-  list<Future<Nothing>> futures;
+  vector<Future<Nothing>> futures;
   foreach (Containerizer* containerizer, containerizers_) {
     Future<Nothing> future = containerizer->containers()
       .then(defer(self(), &Self::__recover, containerizer, lambda::_1));
@@ -673,7 +671,7 @@ Future<Nothing> ComposingContainerizerProcess::remove(
 Future<Nothing> ComposingContainerizerProcess::pruneImages(
     const vector<Image>& excludedImages)
 {
-  list<Future<Nothing>> futures;
+  vector<Future<Nothing>> futures;
 
   foreach (Containerizer* containerizer, containerizers_) {
     futures.push_back(containerizer->pruneImages(excludedImages));

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp b/src/slave/containerizer/docker.cpp
index fc03236..36ec3ec 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -908,7 +908,7 @@ Future<Nothing> DockerContainerizerProcess::recover(
 
 Future<Nothing> DockerContainerizerProcess::_recover(
     const Option<SlaveState>& state,
-    const list<Docker::Container>& _containers)
+    const vector<Docker::Container>& _containers)
 {
   LOG(INFO) << "Got the list of Docker containers";
 
@@ -1101,10 +1101,10 @@ Future<Nothing> DockerContainerizerProcess::_recover(
 
 
 Future<Nothing> DockerContainerizerProcess::__recover(
-    const list<Docker::Container>& _containers)
+    const vector<Docker::Container>& _containers)
 {
-  list<ContainerID> containerIds;
-  list<Future<Nothing>> futures;
+  vector<ContainerID> containerIds;
+  vector<Future<Nothing>> futures;
   foreach (const Docker::Container& container, _containers) {
     VLOG(1) << "Checking if Docker container named '"
             << container.name << "' was started by Mesos";

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/docker.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.hpp b/src/slave/containerizer/docker.hpp
index 6bdf4c7..1ed47c8 100644
--- a/src/slave/containerizer/docker.hpp
+++ b/src/slave/containerizer/docker.hpp
@@ -17,7 +17,6 @@
 #ifndef __DOCKER_CONTAINERIZER_HPP__
 #define __DOCKER_CONTAINERIZER_HPP__
 
-#include <list>
 #include <map>
 #include <set>
 #include <string>
@@ -186,10 +185,10 @@ private:
 
   process::Future<Nothing> _recover(
       const Option<state::SlaveState>& state,
-      const std::list<Docker::Container>& containers);
+      const std::vector<Docker::Container>& containers);
 
   process::Future<Nothing> __recover(
-      const std::list<Docker::Container>& containers);
+      const std::vector<Docker::Container>& containers);
 
   // Starts the executor in a Docker container.
   process::Future<Docker::Container> launchExecutorContainer(

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/fetcher.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/fetcher.cpp b/src/slave/containerizer/fetcher.cpp
index 7de57c2..d6b4270 100644
--- a/src/slave/containerizer/fetcher.cpp
+++ b/src/slave/containerizer/fetcher.cpp
@@ -462,7 +462,7 @@ Future<Nothing> FetcherProcess::_fetch(
 {
   // Get out all of the futures we need to wait for so we can wait on
   // them together via 'await'.
-  list<Future<shared_ptr<Cache::Entry>>> futures;
+  vector<Future<shared_ptr<Cache::Entry>>> futures;
 
   foreachvalue (const Option<Future<shared_ptr<Cache::Entry>>>& entry,
                 entries) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.cpp b/src/slave/containerizer/mesos/containerizer.cpp
index 93197b0..17a1a37 100644
--- a/src/slave/containerizer/mesos/containerizer.cpp
+++ b/src/slave/containerizer/mesos/containerizer.cpp
@@ -132,7 +132,6 @@ using process::Subprocess;
 
 using process::http::Connection;
 
-using std::list;
 using std::map;
 using std::pair;
 using std::set;
@@ -718,7 +717,7 @@ Future<Nothing> MesosContainerizerProcess::recover(
   LOG(INFO) << "Recovering Mesos containers";
 
   // Gather the container states that we will attempt to recover.
-  list<ContainerState> recoverable;
+  vector<ContainerState> recoverable;
   if (state.isSome()) {
     // Gather the latest run of checkpointed executors.
     foreachvalue (const FrameworkState& framework, state->frameworks) {
@@ -1007,7 +1006,7 @@ Future<Nothing> MesosContainerizerProcess::recover(
 
 
 Future<Nothing> MesosContainerizerProcess::_recover(
-    const list<ContainerState>& recoverable,
+    const vector<ContainerState>& recoverable,
     const hashset<ContainerID>& orphans)
 {
   // Recover isolators first then recover the provisioner, because of
@@ -1018,17 +1017,17 @@ Future<Nothing> MesosContainerizerProcess::_recover(
 }
 
 
-Future<list<Nothing>> MesosContainerizerProcess::recoverIsolators(
-    const list<ContainerState>& recoverable,
+Future<vector<Nothing>> MesosContainerizerProcess::recoverIsolators(
+    const vector<ContainerState>& recoverable,
     const hashset<ContainerID>& orphans)
 {
   LOG(INFO) << "Recovering isolators";
 
-  list<Future<Nothing>> futures;
+  vector<Future<Nothing>> futures;
 
   // Then recover the isolators.
   foreach (const Owned<Isolator>& isolator, isolators) {
-    list<ContainerState> _recoverable;
+    vector<ContainerState> _recoverable;
     hashset<ContainerID> _orphans;
 
     foreach (const ContainerState& state, recoverable) {
@@ -1058,7 +1057,7 @@ Future<list<Nothing>> MesosContainerizerProcess::recoverIsolators(
 
 
 Future<Nothing> MesosContainerizerProcess::recoverProvisioner(
-    const list<ContainerState>& recoverable,
+    const vector<ContainerState>& recoverable,
     const hashset<ContainerID>& orphans)
 {
   LOG(INFO) << "Recovering provisioner";
@@ -1076,7 +1075,7 @@ Future<Nothing> MesosContainerizerProcess::recoverProvisioner(
 
 
 Future<Nothing> MesosContainerizerProcess::__recover(
-    const list<ContainerState>& recovered,
+    const vector<ContainerState>& recovered,
     const hashset<ContainerID>& orphans)
 {
   // Recover containers' launch information.
@@ -1422,8 +1421,8 @@ Future<Nothing> MesosContainerizerProcess::prepare(
   // We prepare the isolators sequentially according to their ordering
   // to permit basic dependency specification, e.g., preparing a
   // filesystem isolator before other isolators.
-  Future<list<Option<ContainerLaunchInfo>>> f =
-    list<Option<ContainerLaunchInfo>>();
+  Future<vector<Option<ContainerLaunchInfo>>> f =
+    vector<Option<ContainerLaunchInfo>>();
 
   foreach (const Owned<Isolator>& isolator, isolators) {
     if (!isSupportedByIsolator(
@@ -1434,7 +1433,7 @@ Future<Nothing> MesosContainerizerProcess::prepare(
     }
 
     // Chain together preparing each isolator.
-    f = f.then([=](list<Option<ContainerLaunchInfo>> launchInfos) {
+    f = f.then([=](vector<Option<ContainerLaunchInfo>> launchInfos) {
       return isolator->prepare(containerId, containerConfig)
         .then([=](const Option<ContainerLaunchInfo>& launchInfo) mutable {
           launchInfos.push_back(launchInfo);
@@ -2084,7 +2083,7 @@ Future<Nothing> MesosContainerizerProcess::isolate(
   // NOTE: This is done is parallel and is not sequenced like prepare
   // or destroy because we assume there are no dependencies in
   // isolation.
-  list<Future<Nothing>> futures;
+  vector<Future<Nothing>> futures;
   foreach (const Owned<Isolator>& isolator, isolators) {
     if (!isSupportedByIsolator(
             containerId,
@@ -2097,7 +2096,7 @@ Future<Nothing> MesosContainerizerProcess::isolate(
   }
 
   // Wait for all isolators to complete.
-  Future<list<Nothing>> future = collect(futures);
+  Future<vector<Nothing>> future = collect(futures);
 
   container->isolation = future;
 
@@ -2219,7 +2218,7 @@ Future<Nothing> MesosContainerizerProcess::update(
   container->resources = resources;
 
   // Update each isolator.
-  list<Future<Nothing>> futures;
+  vector<Future<Nothing>> futures;
   foreach (const Owned<Isolator>& isolator, isolators) {
     if (!isSupportedByIsolator(
             containerId,
@@ -2243,7 +2242,7 @@ Future<Nothing> MesosContainerizerProcess::update(
 Future<ResourceStatistics> _usage(
     const ContainerID& containerId,
     const Option<Resources>& resources,
-    const list<Future<ResourceStatistics>>& statistics)
+    const vector<Future<ResourceStatistics>>& statistics)
 {
   ResourceStatistics result;
 
@@ -2285,7 +2284,7 @@ Future<ResourceStatistics> MesosContainerizerProcess::usage(
     return Failure("Unknown container " + stringify(containerId));
   }
 
-  list<Future<ResourceStatistics>> futures;
+  vector<Future<ResourceStatistics>> futures;
   foreach (const Owned<Isolator>& isolator, isolators) {
     if (!isSupportedByIsolator(
             containerId,
@@ -2316,7 +2315,7 @@ Future<ContainerStatus> MesosContainerizerProcess::status(
     return Failure("Unknown container: " + stringify(containerId));
   }
 
-  list<Future<ContainerStatus>> futures;
+  vector<Future<ContainerStatus>> futures;
   foreach (const Owned<Isolator>& isolator, isolators) {
     if (!isSupportedByIsolator(
             containerId,
@@ -2339,7 +2338,7 @@ Future<ContainerStatus> MesosContainerizerProcess::status(
   return containers_.at(containerId)->sequence.add<ContainerStatus>(
       [=]() -> Future<ContainerStatus> {
         return await(futures)
-          .then([containerId](const list<Future<ContainerStatus>>& statuses) {
+          .then([containerId](const vector<Future<ContainerStatus>>& statuses) {
             ContainerStatus result;
             result.mutable_container_id()->CopyFrom(containerId);
 
@@ -2413,13 +2412,13 @@ Future<Option<ContainerTermination>> MesosContainerizerProcess::destroy(
 
   transition(containerId, DESTROYING);
 
-  list<Future<Option<ContainerTermination>>> destroys;
+  vector<Future<Option<ContainerTermination>>> destroys;
   foreach (const ContainerID& child, container->children) {
     destroys.push_back(destroy(child, termination));
   }
 
   await(destroys).then(defer(
-    self(), [=](const list<Future<Option<ContainerTermination>>>& futures) {
+    self(), [=](const vector<Future<Option<ContainerTermination>>>& futures) {
       _destroy(containerId, termination, previousState, futures);
       return Nothing();
     }));
@@ -2438,7 +2437,7 @@ void MesosContainerizerProcess::_destroy(
     const ContainerID& containerId,
     const Option<ContainerTermination>& termination,
     const State& previousState,
-    const list<Future<Option<ContainerTermination>>>& destroys)
+    const vector<Future<Option<ContainerTermination>>>& destroys)
 {
   CHECK(containers_.contains(containerId));
 
@@ -2476,7 +2475,7 @@ void MesosContainerizerProcess::_destroy(
           &Self::_____destroy,
           containerId,
           termination,
-          list<Future<Nothing>>()));
+          vector<Future<Nothing>>()));
 
     return;
   }
@@ -2595,7 +2594,7 @@ void MesosContainerizerProcess::____destroy(
 void MesosContainerizerProcess::_____destroy(
     const ContainerID& containerId,
     const Option<ContainerTermination>& termination,
-    const Future<list<Future<Nothing>>>& cleanups)
+    const Future<vector<Future<Nothing>>>& cleanups)
 {
   // This should not occur because we only use the Future<list> to
   // facilitate chaining.
@@ -2971,10 +2970,10 @@ MesosContainerizerProcess::Metrics::~Metrics()
 }
 
 
-Future<list<Future<Nothing>>> MesosContainerizerProcess::cleanupIsolators(
+Future<vector<Future<Nothing>>> MesosContainerizerProcess::cleanupIsolators(
     const ContainerID& containerId)
 {
-  Future<list<Future<Nothing>>> f = list<Future<Nothing>>();
+  Future<vector<Future<Nothing>>> f = vector<Future<Nothing>>();
 
   // NOTE: We clean up each isolator in the reverse order they were
   // prepared (see comment in prepare()).
@@ -2990,7 +2989,7 @@ Future<list<Future<Nothing>>> MesosContainerizerProcess::cleanupIsolators(
     // complete and continuing if one fails.
     // TODO(jieyu): Technically, we cannot bind 'isolator' here
     // because the ownership will be transferred after the bind.
-    f = f.then([=](list<Future<Nothing>> cleanups) {
+    f = f.then([=](vector<Future<Nothing>> cleanups) {
       // Accumulate but do not propagate any failure.
       Future<Nothing> cleanup = isolator->cleanup(containerId);
       cleanups.push_back(cleanup);
@@ -2998,8 +2997,8 @@ Future<list<Future<Nothing>>> MesosContainerizerProcess::cleanupIsolators(
       // Wait for the cleanup to complete/fail before returning the
       // list. We use await here to asynchronously wait for the
       // isolator to complete then return cleanups.
-      return await(list<Future<Nothing>>({cleanup}))
-        .then([cleanups]() -> Future<list<Future<Nothing>>> {
+      return await(vector<Future<Nothing>>({cleanup}))
+        .then([cleanups]() -> Future<vector<Future<Nothing>>> {
           return cleanups;
         });
     });

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/containerizer.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/containerizer.hpp b/src/slave/containerizer/mesos/containerizer.hpp
index 22405e6..c814d8f 100644
--- a/src/slave/containerizer/mesos/containerizer.hpp
+++ b/src/slave/containerizer/mesos/containerizer.hpp
@@ -17,7 +17,6 @@
 #ifndef __MESOS_CONTAINERIZER_HPP__
 #define __MESOS_CONTAINERIZER_HPP__
 
-#include <list>
 #include <vector>
 
 #include <mesos/secret/resolver.hpp>
@@ -208,19 +207,19 @@ private:
   friend std::ostream& operator<<(std::ostream& stream, const State& state);
 
   process::Future<Nothing> _recover(
-      const std::list<mesos::slave::ContainerState>& recoverable,
+      const std::vector<mesos::slave::ContainerState>& recoverable,
       const hashset<ContainerID>& orphans);
 
-  process::Future<std::list<Nothing>> recoverIsolators(
-      const std::list<mesos::slave::ContainerState>& recoverable,
+  process::Future<std::vector<Nothing>> recoverIsolators(
+      const std::vector<mesos::slave::ContainerState>& recoverable,
       const hashset<ContainerID>& orphans);
 
   process::Future<Nothing> recoverProvisioner(
-      const std::list<mesos::slave::ContainerState>& recoverable,
+      const std::vector<mesos::slave::ContainerState>& recoverable,
       const hashset<ContainerID>& orphans);
 
   process::Future<Nothing> __recover(
-      const std::list<mesos::slave::ContainerState>& recovered,
+      const std::vector<mesos::slave::ContainerState>& recovered,
       const hashset<ContainerID>& orphans);
 
   process::Future<Nothing> prepare(
@@ -245,7 +244,7 @@ private:
       const ContainerID& containerId,
       const Option<mesos::slave::ContainerTermination>& termination,
       const State& previousState,
-      const std::list<
+      const std::vector<
         process::Future<Option<mesos::slave::ContainerTermination>>>& destroys);
 
   // Continues '_destroy()' once isolators has completed.
@@ -270,7 +269,7 @@ private:
   void _____destroy(
       const ContainerID& containerId,
       const Option<mesos::slave::ContainerTermination>& termination,
-      const process::Future<std::list<process::Future<Nothing>>>& cleanups);
+      const process::Future<std::vector<process::Future<Nothing>>>& cleanups);
 
   // Continues '_____destroy()' once provisioner have completed destroy.
   void ______destroy(
@@ -295,7 +294,7 @@ private:
 
   // TODO(jieyu): Consider introducing an Isolators struct and moving
   // all isolator related operations to that struct.
-  process::Future<std::list<process::Future<Nothing>>> cleanupIsolators(
+  process::Future<std::vector<process::Future<Nothing>>> cleanupIsolators(
       const ContainerID& containerId);
 
   const Flags flags;
@@ -344,13 +343,13 @@ private:
     // We keep track of the future that is waiting for all the
     // 'isolator->prepare' to finish so that destroy will only start
     // calling cleanup after all isolators have finished preparing.
-    process::Future<std::list<Option<mesos::slave::ContainerLaunchInfo>>>
+    process::Future<std::vector<Option<mesos::slave::ContainerLaunchInfo>>>
       launchInfos;
 
     // We keep track of the future that is waiting for all the
     // 'isolator->isolate' futures so that destroy will only start
     // calling cleanup after all isolators have finished isolating.
-    process::Future<std::list<Nothing>> isolation;
+    process::Future<std::vector<Nothing>> isolation;
 
     // We keep track of the resources for each container so we can set
     // the ResourceStatistics limits in usage().

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/io/switchboard.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/io/switchboard.cpp b/src/slave/containerizer/mesos/io/switchboard.cpp
index 17e8745..9c6b8a4 100644
--- a/src/slave/containerizer/mesos/io/switchboard.cpp
+++ b/src/slave/containerizer/mesos/io/switchboard.cpp
@@ -163,7 +163,7 @@ bool IOSwitchboard::supportsStandalone()
 
 
 Future<Nothing> IOSwitchboard::recover(
-    const list<ContainerState>& states,
+    const vector<ContainerState>& states,
     const hashset<ContainerID>& orphans)
 {
 #ifdef __WINDOWS__
@@ -815,7 +815,7 @@ Future<Nothing> IOSwitchboard::cleanup(
 
   // NOTE: We use 'await' here so that we can handle the FAILED and
   // DISCARDED cases as well.
-  return await(list<Future<Option<int>>>{status}).then(
+  return await(vector<Future<Option<int>>>{status}).then(
       defer(self(), [this, containerId]() -> Future<Nothing> {
         // We need to call `_extractContainerIO` here in case the
         // `IOSwitchboard` still holds a reference to the container's

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/io/switchboard.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/io/switchboard.hpp b/src/slave/containerizer/mesos/io/switchboard.hpp
index 8a16b15..e52dfe3 100644
--- a/src/slave/containerizer/mesos/io/switchboard.hpp
+++ b/src/slave/containerizer/mesos/io/switchboard.hpp
@@ -63,7 +63,7 @@ public:
   virtual bool supportsStandalone();
 
   virtual process::Future<Nothing> recover(
-    const std::list<mesos::slave::ContainerState>& states,
+    const std::vector<mesos::slave::ContainerState>& states,
     const hashset<ContainerID>& orphans);
 
   virtual process::Future<Option<mesos::slave::ContainerLaunchInfo>> prepare(

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolator.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolator.cpp b/src/slave/containerizer/mesos/isolator.cpp
index 7a32936..ac33398 100644
--- a/src/slave/containerizer/mesos/isolator.cpp
+++ b/src/slave/containerizer/mesos/isolator.cpp
@@ -21,7 +21,7 @@
 using namespace process;
 
 using std::string;
-using std::list;
+using std::vector;
 
 using mesos::slave::ContainerConfig;
 using mesos::slave::ContainerLaunchInfo;
@@ -59,7 +59,7 @@ bool MesosIsolator::supportsStandalone()
 
 
 Future<Nothing> MesosIsolator::recover(
-    const list<ContainerState>& state,
+    const vector<ContainerState>& state,
     const hashset<ContainerID>& orphans)
 {
   return dispatch(process.get(),

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolator.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolator.hpp b/src/slave/containerizer/mesos/isolator.hpp
index b7af394..d56440c 100644
--- a/src/slave/containerizer/mesos/isolator.hpp
+++ b/src/slave/containerizer/mesos/isolator.hpp
@@ -45,7 +45,7 @@ public:
   virtual bool supportsStandalone();
 
   virtual process::Future<Nothing> recover(
-      const std::list<mesos::slave::ContainerState>& states,
+      const std::vector<mesos::slave::ContainerState>& states,
       const hashset<ContainerID>& orphans);
 
   virtual process::Future<Option<mesos::slave::ContainerLaunchInfo>> prepare(
@@ -93,7 +93,7 @@ public:
   }
 
   virtual process::Future<Nothing> recover(
-      const std::list<mesos::slave::ContainerState>& states,
+      const std::vector<mesos::slave::ContainerState>& states,
       const hashset<ContainerID>& orphans)
   {
     return Nothing();

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp b/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
index 6d663a5..215e324 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups/cgroups.cpp
@@ -46,7 +46,6 @@ using process::Future;
 using process::Owned;
 using process::PID;
 
-using std::list;
 using std::string;
 using std::vector;
 
@@ -158,11 +157,11 @@ bool CgroupsIsolatorProcess::supportsStandalone()
 
 
 Future<Nothing> CgroupsIsolatorProcess::recover(
-    const list<ContainerState>& states,
+    const vector<ContainerState>& states,
     const hashset<ContainerID>& orphans)
 {
   // Recover active containers first.
-  list<Future<Nothing>> recovers;
+  vector<Future<Nothing>> recovers;
   foreach (const ContainerState& state, states) {
     // If we are a nested container, we do not need to recover
     // anything since only top-level containers will have cgroups
@@ -185,7 +184,7 @@ Future<Nothing> CgroupsIsolatorProcess::recover(
 
 Future<Nothing> CgroupsIsolatorProcess::_recover(
     const hashset<ContainerID>& orphans,
-    const list<Future<Nothing>>& futures)
+    const vector<Future<Nothing>>& futures)
 {
   vector<string> errors;
   foreach (const Future<Nothing>& future, futures) {
@@ -241,7 +240,7 @@ Future<Nothing> CgroupsIsolatorProcess::_recover(
     }
   }
 
-  list<Future<Nothing>> recovers;
+  vector<Future<Nothing>> recovers;
 
   foreach (const ContainerID& containerId, knownOrphans) {
     recovers.push_back(___recover(containerId));
@@ -262,7 +261,7 @@ Future<Nothing> CgroupsIsolatorProcess::_recover(
 
 Future<Nothing> CgroupsIsolatorProcess::__recover(
     const hashset<ContainerID>& unknownOrphans,
-    const list<Future<Nothing>>& futures)
+    const vector<Future<Nothing>>& futures)
 {
   vector<string> errors;
   foreach (const Future<Nothing>& future, futures) {
@@ -295,7 +294,7 @@ Future<Nothing> CgroupsIsolatorProcess::___recover(
 {
   const string cgroup = path::join(flags.cgroups_root, containerId.value());
 
-  list<Future<Nothing>> recovers;
+  vector<Future<Nothing>> recovers;
   hashset<string> recoveredSubsystems;
 
   // TODO(haosdent): Use foreachkey once MESOS-5037 is resolved.
@@ -340,7 +339,7 @@ Future<Nothing> CgroupsIsolatorProcess::___recover(
 Future<Nothing> CgroupsIsolatorProcess::____recover(
     const ContainerID& containerId,
     const hashset<string>& recoveredSubsystems,
-    const list<Future<Nothing>>& futures)
+    const vector<Future<Nothing>>& futures)
 {
   vector<string> errors;
   foreach (const Future<Nothing>& future, futures) {
@@ -390,7 +389,7 @@ Future<Option<ContainerLaunchInfo>> CgroupsIsolatorProcess::prepare(
       containerId,
       path::join(flags.cgroups_root, containerId.value())));
 
-  list<Future<Nothing>> prepares;
+  vector<Future<Nothing>> prepares;
 
   // TODO(haosdent): Use foreachkey once MESOS-5037 is resolved.
   foreach (const string& hierarchy, subsystems.keys()) {
@@ -489,7 +488,7 @@ Future<Option<ContainerLaunchInfo>> CgroupsIsolatorProcess::prepare(
 Future<Option<ContainerLaunchInfo>> CgroupsIsolatorProcess::_prepare(
     const ContainerID& containerId,
     const ContainerConfig& containerConfig,
-    const list<Future<Nothing>>& futures)
+    const vector<Future<Nothing>>& futures)
 {
   vector<string> errors;
   foreach (const Future<Nothing>& future, futures) {
@@ -558,7 +557,7 @@ Future<Nothing> CgroupsIsolatorProcess::isolate(
     return Nothing();
   }
 
-  list<Future<Nothing>> isolates;
+  vector<Future<Nothing>> isolates;
   foreachvalue (const Owned<Subsystem>& subsystem, subsystems) {
     isolates.push_back(subsystem->isolate(
         containerId,
@@ -575,7 +574,7 @@ Future<Nothing> CgroupsIsolatorProcess::isolate(
 
 
 Future<Nothing> CgroupsIsolatorProcess::_isolate(
-    const list<Future<Nothing>>& futures)
+    const vector<Future<Nothing>>& futures)
 {
   vector<string> errors;
   foreach (const Future<Nothing>& future, futures) {
@@ -651,7 +650,7 @@ Future<Nothing> CgroupsIsolatorProcess::update(
     return Failure("Unknown container");
   }
 
-  list<Future<Nothing>> updates;
+  vector<Future<Nothing>> updates;
   foreachvalue (const Owned<Subsystem>& subsystem, subsystems) {
     if (infos[containerId]->subsystems.contains(subsystem->name())) {
       updates.push_back(subsystem->update(
@@ -670,7 +669,7 @@ Future<Nothing> CgroupsIsolatorProcess::update(
 
 
 Future<Nothing> CgroupsIsolatorProcess::_update(
-    const list<Future<Nothing>>& futures)
+    const vector<Future<Nothing>>& futures)
 {
   vector<string> errors;
   foreach (const Future<Nothing>& future, futures) {
@@ -702,7 +701,7 @@ Future<ResourceStatistics> CgroupsIsolatorProcess::usage(
     return Failure("Unknown container");
   }
 
-  list<Future<ResourceStatistics>> usages;
+  vector<Future<ResourceStatistics>> usages;
   foreachvalue (const Owned<Subsystem>& subsystem, subsystems) {
     if (infos[containerId]->subsystems.contains(subsystem->name())) {
       usages.push_back(subsystem->usage(
@@ -712,7 +711,7 @@ Future<ResourceStatistics> CgroupsIsolatorProcess::usage(
   }
 
   return await(usages)
-    .then([containerId](const list<Future<ResourceStatistics>>& _usages) {
+    .then([containerId](const vector<Future<ResourceStatistics>>& _usages) {
       ResourceStatistics result;
 
       foreach (const Future<ResourceStatistics>& statistics, _usages) {
@@ -745,7 +744,7 @@ Future<ContainerStatus> CgroupsIsolatorProcess::status(
     return Failure("Unknown container");
   }
 
-  list<Future<ContainerStatus>> statuses;
+  vector<Future<ContainerStatus>> statuses;
   foreachvalue (const Owned<Subsystem>& subsystem, subsystems) {
     if (infos[containerId]->subsystems.contains(subsystem->name())) {
       statuses.push_back(subsystem->status(
@@ -755,7 +754,7 @@ Future<ContainerStatus> CgroupsIsolatorProcess::status(
   }
 
   return await(statuses)
-    .then([containerId](const list<Future<ContainerStatus>>& _statuses) {
+    .then([containerId](const vector<Future<ContainerStatus>>& _statuses) {
       ContainerStatus result;
 
       foreach (const Future<ContainerStatus>& status, _statuses) {
@@ -788,7 +787,7 @@ Future<Nothing> CgroupsIsolatorProcess::cleanup(
     return Nothing();
   }
 
-  list<Future<Nothing>> cleanups;
+  vector<Future<Nothing>> cleanups;
   foreachvalue (const Owned<Subsystem>& subsystem, subsystems) {
     if (infos[containerId]->subsystems.contains(subsystem->name())) {
       cleanups.push_back(subsystem->cleanup(
@@ -808,7 +807,7 @@ Future<Nothing> CgroupsIsolatorProcess::cleanup(
 
 Future<Nothing> CgroupsIsolatorProcess::_cleanup(
     const ContainerID& containerId,
-    const list<Future<Nothing>>& futures)
+    const vector<Future<Nothing>>& futures)
 {
   CHECK(infos.contains(containerId));
 
@@ -827,7 +826,7 @@ Future<Nothing> CgroupsIsolatorProcess::_cleanup(
         strings::join(";", errors));
   }
 
-  list<Future<Nothing>> destroys;
+  vector<Future<Nothing>> destroys;
 
   // TODO(haosdent): Use foreachkey once MESOS-5037 is resolved.
   foreach (const string& hierarchy, subsystems.keys()) {
@@ -854,7 +853,7 @@ Future<Nothing> CgroupsIsolatorProcess::_cleanup(
 
 Future<Nothing> CgroupsIsolatorProcess::__cleanup(
     const ContainerID& containerId,
-    const list<Future<Nothing>>& futures)
+    const vector<Future<Nothing>>& futures)
 {
   CHECK(infos.contains(containerId));
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/cgroups/cgroups.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/cgroups.hpp b/src/slave/containerizer/mesos/isolators/cgroups/cgroups.hpp
index f47b16e..81c9343 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups/cgroups.hpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups/cgroups.hpp
@@ -54,7 +54,7 @@ public:
   virtual bool supportsStandalone();
 
   virtual process::Future<Nothing> recover(
-      const std::list<mesos::slave::ContainerState>& states,
+      const std::vector<mesos::slave::ContainerState>& states,
       const hashset<ContainerID>& orphans);
 
   virtual process::Future<Option<mesos::slave::ContainerLaunchInfo>> prepare(
@@ -107,11 +107,11 @@ private:
 
   process::Future<Nothing> _recover(
       const hashset<ContainerID>& orphans,
-      const std::list<process::Future<Nothing>>& futures);
+      const std::vector<process::Future<Nothing>>& futures);
 
   process::Future<Nothing> __recover(
       const hashset<ContainerID>& unknownOrphans,
-      const std::list<process::Future<Nothing>>& futures);
+      const std::vector<process::Future<Nothing>>& futures);
 
   process::Future<Nothing> ___recover(
     const ContainerID& containerId);
@@ -119,30 +119,30 @@ private:
   process::Future<Nothing> ____recover(
     const ContainerID& containerId,
     const hashset<std::string>& recoveredSubsystems,
-    const std::list<process::Future<Nothing>>& futures);
+    const std::vector<process::Future<Nothing>>& futures);
 
   process::Future<Option<mesos::slave::ContainerLaunchInfo>> _prepare(
       const ContainerID& containerId,
       const mesos::slave::ContainerConfig& containerConfig,
-      const std::list<process::Future<Nothing>>& futures);
+      const std::vector<process::Future<Nothing>>& futures);
 
   process::Future<Nothing> _isolate(
-      const std::list<process::Future<Nothing>>& futures);
+      const std::vector<process::Future<Nothing>>& futures);
 
   void _watch(
       const ContainerID& containerId,
       const process::Future<mesos::slave::ContainerLimitation>& future);
 
   process::Future<Nothing> _update(
-      const std::list<process::Future<Nothing>>& futures);
+      const std::vector<process::Future<Nothing>>& futures);
 
   process::Future<Nothing> _cleanup(
       const ContainerID& containerId,
-      const std::list<process::Future<Nothing>>& futures);
+      const std::vector<process::Future<Nothing>>& futures);
 
   process::Future<Nothing> __cleanup(
       const ContainerID& containerId,
-      const std::list<process::Future<Nothing>>& futures);
+      const std::vector<process::Future<Nothing>>& futures);
 
   const Flags flags;
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp
index 33dd6d9..f4ed833 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.cpp
@@ -43,7 +43,6 @@ using process::Future;
 using process::Owned;
 using process::PID;
 
-using std::list;
 using std::ostringstream;
 using std::string;
 using std::vector;
@@ -379,8 +378,8 @@ Future<ResourceStatistics> MemorySubsystemProcess::usage(
   }
 
   // Get pressure counter readings.
-  list<Level> levels;
-  list<Future<uint64_t>> values;
+  vector<Level> levels;
+  vector<Future<uint64_t>> values;
   foreachpair (Level level,
                const Owned<Counter>& counter,
                info->pressureCounters) {
@@ -401,8 +400,8 @@ Future<ResourceStatistics> MemorySubsystemProcess::usage(
 Future<ResourceStatistics> MemorySubsystemProcess::_usage(
     const ContainerID& containerId,
     ResourceStatistics result,
-    const list<Level>& levels,
-    const list<Future<uint64_t>>& values)
+    const vector<Level>& levels,
+    const vector<Future<uint64_t>>& values)
 {
   if (!infos.contains(containerId)) {
     return Failure(
@@ -410,7 +409,7 @@ Future<ResourceStatistics> MemorySubsystemProcess::_usage(
         ": Unknown container");
   }
 
-  list<Level>::const_iterator iterator = levels.begin();
+  vector<Level>::const_iterator iterator = levels.begin();
   foreach (const Future<uint64_t>& value, values) {
     if (value.isReady()) {
       switch (*iterator) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.hpp b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.hpp
index 1d49cef..27d88e9 100644
--- a/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.hpp
+++ b/src/slave/containerizer/mesos/isolators/cgroups/subsystems/memory.hpp
@@ -17,8 +17,8 @@
 #ifndef __CGROUPS_ISOLATOR_SUBSYSTEMS_MEMORY_HPP__
 #define __CGROUPS_ISOLATOR_SUBSYSTEMS_MEMORY_HPP__
 
-#include <list>
 #include <string>
+#include <vector>
 
 #include <process/future.hpp>
 #include <process/owned.hpp>
@@ -98,8 +98,8 @@ private:
   process::Future<ResourceStatistics> _usage(
       const ContainerID& containerId,
       ResourceStatistics result,
-      const std::list<cgroups::memory::pressure::Level>& levels,
-      const std::list<process::Future<uint64_t>>& values);
+      const std::vector<cgroups::memory::pressure::Level>& levels,
+      const std::vector<process::Future<uint64_t>>& values);
 
   // Start listening on OOM events. This function will create an
   // eventfd and start polling on it.

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/docker/volume/isolator.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/docker/volume/isolator.cpp b/src/slave/containerizer/mesos/isolators/docker/volume/isolator.cpp
index fd86ad1..ab749be 100644
--- a/src/slave/containerizer/mesos/isolators/docker/volume/isolator.cpp
+++ b/src/slave/containerizer/mesos/isolators/docker/volume/isolator.cpp
@@ -155,7 +155,7 @@ Try<Isolator*> DockerVolumeIsolatorProcess::_create(
 
 
 Future<Nothing> DockerVolumeIsolatorProcess::recover(
-    const list<ContainerState>& states,
+    const vector<ContainerState>& states,
     const hashset<ContainerID>& orphans)
 {
   if (!os::exists(rootDir)) {
@@ -490,7 +490,8 @@ Future<Option<ContainerLaunchInfo>> DockerVolumeIsolatorProcess::prepare(
   infos.put(containerId, Owned<Info>(new Info(volumes)));
 
   // Invoke driver client to create the mount.
-  list<Future<string>> futures;
+  vector<Future<string>> futures;
+  futures.reserve(mounts.size());
   foreach (const Mount& mount, mounts) {
     futures.push_back(this->mount(
         mount.volume.driver(),
@@ -514,7 +515,7 @@ Future<Option<ContainerLaunchInfo>> DockerVolumeIsolatorProcess::prepare(
 Future<Option<ContainerLaunchInfo>> DockerVolumeIsolatorProcess::_prepare(
     const ContainerID& containerId,
     const vector<string>& targets,
-    const list<Future<string>>& futures)
+    const vector<Future<string>>& futures)
 {
   ContainerLaunchInfo launchInfo;
   launchInfo.add_clone_namespaces(CLONE_NEWNS);
@@ -585,7 +586,7 @@ Future<Nothing> DockerVolumeIsolatorProcess::cleanup(
     }
   }
 
-  list<Future<Nothing>> futures;
+  vector<Future<Nothing>> futures;
 
   foreach (const DockerVolume& volume, infos[containerId]->volumes) {
     if (references.contains(volume) && references[volume] > 1) {
@@ -615,7 +616,7 @@ Future<Nothing> DockerVolumeIsolatorProcess::cleanup(
 
 Future<Nothing> DockerVolumeIsolatorProcess::_cleanup(
     const ContainerID& containerId,
-    const list<Future<Nothing>>& futures)
+    const vector<Future<Nothing>>& futures)
 {
   CHECK(infos.contains(containerId));
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/docker/volume/isolator.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/docker/volume/isolator.hpp b/src/slave/containerizer/mesos/isolators/docker/volume/isolator.hpp
index 0e1761d..70f7ed2 100644
--- a/src/slave/containerizer/mesos/isolators/docker/volume/isolator.hpp
+++ b/src/slave/containerizer/mesos/isolators/docker/volume/isolator.hpp
@@ -17,7 +17,6 @@
 #ifndef __DOCKER_VOLUME_ISOLATOR_HPP__
 #define __DOCKER_VOLUME_ISOLATOR_HPP__
 
-#include <list>
 #include <string>
 #include <vector>
 
@@ -56,7 +55,7 @@ public:
   virtual bool supportsStandalone();
 
   virtual process::Future<Nothing> recover(
-      const std::list<mesos::slave::ContainerState>& states,
+      const std::vector<mesos::slave::ContainerState>& states,
       const hashset<ContainerID>& orphans);
 
   virtual process::Future<Option<mesos::slave::ContainerLaunchInfo>> prepare(
@@ -83,11 +82,11 @@ private:
   process::Future<Option<mesos::slave::ContainerLaunchInfo>> _prepare(
       const ContainerID& containerId,
       const std::vector<std::string>& targets,
-      const std::list<process::Future<std::string>>& futures);
+      const std::vector<process::Future<std::string>>& futures);
 
   process::Future<Nothing> _cleanup(
       const ContainerID& containerId,
-      const std::list<process::Future<Nothing>>& futures);
+      const std::vector<process::Future<Nothing>>& futures);
 
   Try<Nothing> _recover(const ContainerID& containerId);
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/environment_secret.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/environment_secret.cpp b/src/slave/containerizer/mesos/isolators/environment_secret.cpp
index 77c1ba5..824b502 100644
--- a/src/slave/containerizer/mesos/isolators/environment_secret.cpp
+++ b/src/slave/containerizer/mesos/isolators/environment_secret.cpp
@@ -16,7 +16,7 @@
 
 #include "slave/containerizer/mesos/isolators/environment_secret.hpp"
 
-#include <list>
+#include <vector>
 
 #include <mesos/secret/resolver.hpp>
 
@@ -29,7 +29,7 @@
 
 #include "common/validation.hpp"
 
-using std::list;
+using std::vector;
 
 using process::collect;
 using process::Failure;
@@ -92,7 +92,7 @@ Future<Option<ContainerLaunchInfo>> EnvironmentSecretIsolatorProcess::prepare(
 
   Environment environment;
 
-  list<Future<Environment::Variable>> futures;
+  vector<Future<Environment::Variable>> futures;
   foreach (const Environment::Variable& variable,
            containerConfig.command_info().environment().variables()) {
     if (variable.type() != Environment::Variable::SECRET) {
@@ -127,7 +127,7 @@ Future<Option<ContainerLaunchInfo>> EnvironmentSecretIsolatorProcess::prepare(
   }
 
   return collect(futures)
-    .then([](const list<Environment::Variable>& variables)
+    .then([](const vector<Environment::Variable>& variables)
         -> Future<Option<ContainerLaunchInfo>> {
       ContainerLaunchInfo launchInfo;
       Environment* environment = launchInfo.mutable_environment();

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp b/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp
index 2844327..a47899c 100644
--- a/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp
+++ b/src/slave/containerizer/mesos/isolators/filesystem/linux.cpp
@@ -16,9 +16,9 @@
 
 #include <sys/mount.h>
 
-#include <list>
 #include <sstream>
 #include <string>
+#include <vector>
 
 #include <glog/logging.h>
 
@@ -51,7 +51,6 @@
 
 using namespace process;
 
-using std::list;
 using std::ostringstream;
 using std::string;
 using std::vector;
@@ -233,7 +232,7 @@ bool LinuxFilesystemIsolatorProcess::supportsStandalone()
 
 
 Future<Nothing> LinuxFilesystemIsolatorProcess::recover(
-    const list<ContainerState>& states,
+    const vector<ContainerState>& states,
     const hashset<ContainerID>& orphans)
 {
   foreach (const ContainerState& state, states) {
@@ -255,7 +254,7 @@ Future<Nothing> LinuxFilesystemIsolatorProcess::recover(
     return Failure("Failed to get mount table: " + table.error());
   }
 
-  list<Future<Nothing>> cleanups;
+  vector<Future<Nothing>> cleanups;
 
   foreach (const fs::MountInfoTable::Entry& entry, table->entries) {
     // Check for mounts inside an executor's run path. These are

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/filesystem/linux.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/filesystem/linux.hpp b/src/slave/containerizer/mesos/isolators/filesystem/linux.hpp
index 99a6f0d..5510263 100644
--- a/src/slave/containerizer/mesos/isolators/filesystem/linux.hpp
+++ b/src/slave/containerizer/mesos/isolators/filesystem/linux.hpp
@@ -50,7 +50,7 @@ public:
   virtual bool supportsStandalone();
 
   virtual process::Future<Nothing> recover(
-      const std::list<mesos::slave::ContainerState>& states,
+      const std::vector<mesos::slave::ContainerState>& states,
       const hashset<ContainerID>& orphans);
 
   virtual process::Future<Option<mesos::slave::ContainerLaunchInfo>> prepare(

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/filesystem/posix.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/filesystem/posix.cpp b/src/slave/containerizer/mesos/isolators/filesystem/posix.cpp
index 9ac41af..f91a2ee 100644
--- a/src/slave/containerizer/mesos/isolators/filesystem/posix.cpp
+++ b/src/slave/containerizer/mesos/isolators/filesystem/posix.cpp
@@ -14,8 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <list>
 #include <string>
+#include <vector>
 
 #include <process/id.hpp>
 
@@ -31,8 +31,8 @@
 
 using namespace process;
 
-using std::list;
 using std::string;
+using std::vector;
 
 using mesos::slave::ContainerConfig;
 using mesos::slave::ContainerLaunchInfo;
@@ -63,7 +63,7 @@ Try<Isolator*> PosixFilesystemIsolatorProcess::create(const Flags& flags)
 
 
 Future<Nothing> PosixFilesystemIsolatorProcess::recover(
-    const list<ContainerState>& states,
+    const vector<ContainerState>& states,
     const hashset<ContainerID>& orphans)
 {
   foreach (const ContainerState& state, states) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/filesystem/posix.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/filesystem/posix.hpp b/src/slave/containerizer/mesos/isolators/filesystem/posix.hpp
index 794b6e5..b624a60 100644
--- a/src/slave/containerizer/mesos/isolators/filesystem/posix.hpp
+++ b/src/slave/containerizer/mesos/isolators/filesystem/posix.hpp
@@ -35,7 +35,7 @@ public:
   virtual ~PosixFilesystemIsolatorProcess();
 
   virtual process::Future<Nothing> recover(
-      const std::list<mesos::slave::ContainerState>& states,
+      const std::vector<mesos::slave::ContainerState>& states,
       const hashset<ContainerID>& orphans);
 
   virtual process::Future<Option<mesos::slave::ContainerLaunchInfo>> prepare(

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp b/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp
index f5e8860..d79c940 100644
--- a/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp
+++ b/src/slave/containerizer/mesos/isolators/gpu/isolator.cpp
@@ -27,7 +27,6 @@ extern "C" {
 }
 
 #include <algorithm>
-#include <list>
 #include <map>
 #include <set>
 #include <string>
@@ -76,7 +75,6 @@ using process::Failure;
 using process::Future;
 using process::PID;
 
-using std::list;
 using std::map;
 using std::set;
 using std::string;
@@ -237,10 +235,10 @@ bool NvidiaGpuIsolatorProcess::supportsStandalone()
 
 
 Future<Nothing> NvidiaGpuIsolatorProcess::recover(
-    const list<ContainerState>& states,
+    const vector<ContainerState>& states,
     const hashset<ContainerID>& orphans)
 {
-  list<Future<Nothing>> futures;
+  vector<Future<Nothing>> futures;
 
   foreach (const ContainerState& state, states) {
     const ContainerID& containerId = state.container_id();

http://git-wip-us.apache.org/repos/asf/mesos/blob/a52e5288/src/slave/containerizer/mesos/isolators/gpu/isolator.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/isolators/gpu/isolator.hpp b/src/slave/containerizer/mesos/isolators/gpu/isolator.hpp
index 5d1bc7b..7b29254 100644
--- a/src/slave/containerizer/mesos/isolators/gpu/isolator.hpp
+++ b/src/slave/containerizer/mesos/isolators/gpu/isolator.hpp
@@ -17,9 +17,9 @@
 #ifndef __NVIDIA_GPU_ISOLATOR_HPP__
 #define __NVIDIA_GPU_ISOLATOR_HPP__
 
-#include <list>
 #include <map>
 #include <set>
+#include <vector>
 
 #include <process/future.hpp>
 
@@ -88,7 +88,7 @@ public:
   virtual bool supportsStandalone();
 
   virtual process::Future<Nothing> recover(
-      const std::list<mesos::slave::ContainerState>& states,
+      const std::vector<mesos::slave::ContainerState>& states,
       const hashset<ContainerID>& orphans);
 
   virtual process::Future<Option<mesos::slave::ContainerLaunchInfo>> prepare(


Mime
View raw message