You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2016/12/09 14:28:08 UTC

[2/3] mesos git commit: Do not assume std symbols are visible without using FQN.

Do not assume std symbols are visible without using FQN.

Some headers in libprocess contain using decls for names from the
standard namespace. This commit is a cleanup to allow us to remove
these globally visible using decls in a later commit.

In this commit we also add missing std includes for the touched
symbols.

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


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

Branch: refs/heads/master
Commit: 42b785182f337db18603c76bbb3bcf1df73caca5
Parents: 2d6e9d5
Author: Benjamin Bannier <be...@mesosphere.io>
Authored: Fri Dec 9 14:59:24 2016 +0100
Committer: Till Toenshoff <to...@me.com>
Committed: Fri Dec 9 15:27:20 2016 +0100

----------------------------------------------------------------------
 src/slave/containerizer/mesos/isolators/gpu/isolator.hpp       | 5 +++--
 src/tests/api_tests.cpp                                        | 3 +++
 src/tests/command_executor_tests.cpp                           | 2 ++
 src/tests/containerizer/appc_spec_tests.cpp                    | 4 ++++
 src/tests/containerizer/docker_tests.cpp                       | 5 +++++
 src/tests/containerizer/io_switchboard_tests.cpp               | 4 ++++
 src/tests/containerizer/nested_mesos_containerizer_tests.cpp   | 2 ++
 src/tests/containerizer/nvidia_gpu_isolator_tests.cpp          | 2 ++
 src/tests/containerizer/volume_image_isolator_tests.cpp        | 4 ++++
 src/tests/containerizer/volume_sandbox_path_isolator_tests.cpp | 4 ++++
 src/tests/default_executor_tests.cpp                           | 1 +
 src/tests/master_validation_tests.cpp                          | 2 ++
 src/tests/mesos.hpp                                            | 6 +++---
 src/tests/slave_authorization_tests.cpp                        | 2 ++
 src/tests/teardown_tests.cpp                                   | 4 ++++
 15 files changed, 45 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/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 cd79033..f3103a7 100644
--- a/src/slave/containerizer/mesos/isolators/gpu/isolator.hpp
+++ b/src/slave/containerizer/mesos/isolators/gpu/isolator.hpp
@@ -18,6 +18,7 @@
 #define __NVIDIA_GPU_ISOLATOR_HPP__
 
 #include <list>
+#include <map>
 #include <set>
 
 #include <process/future.hpp>
@@ -109,7 +110,7 @@ private:
       const std::string& hierarchy,
       const NvidiaGpuAllocator& _allocator,
       const NvidiaVolume& _volume,
-      const map<Path, cgroups::devices::Entry>& _controlDeviceEntries);
+      const std::map<Path, cgroups::devices::Entry>& _controlDeviceEntries);
 
   virtual process::Future<Option<mesos::slave::ContainerLaunchInfo>> _prepare(
       const mesos::slave::ContainerConfig& containerConfig);
@@ -139,7 +140,7 @@ private:
   NvidiaGpuAllocator allocator;
   NvidiaVolume volume;
 
-  const map<Path, cgroups::devices::Entry> controlDeviceEntries;
+  const std::map<Path, cgroups::devices::Entry> controlDeviceEntries;
 };
 
 } // namespace slave {

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/api_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/api_tests.cpp b/src/tests/api_tests.cpp
index 4bc2c74..7a22011 100644
--- a/src/tests/api_tests.cpp
+++ b/src/tests/api_tests.cpp
@@ -14,6 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <string>
 #include <tuple>
 
 #include <mesos/http.hpp>
@@ -87,7 +88,9 @@ using process::Promise;
 
 using recordio::Decoder;
 
+using std::string;
 using std::tuple;
+using std::vector;
 
 using testing::_;
 using testing::AtMost;

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/command_executor_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/command_executor_tests.cpp b/src/tests/command_executor_tests.cpp
index 6352786..f847f6a 100644
--- a/src/tests/command_executor_tests.cpp
+++ b/src/tests/command_executor_tests.cpp
@@ -14,6 +14,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <string>
 #include <vector>
 
 #include <gmock/gmock.h>
@@ -59,6 +60,7 @@ using process::Future;
 using process::Owned;
 using process::PID;
 
+using std::string;
 using std::vector;
 
 using ::testing::WithParamInterface;

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/containerizer/appc_spec_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/appc_spec_tests.cpp b/src/tests/containerizer/appc_spec_tests.cpp
index f8fef88..840dbde 100644
--- a/src/tests/containerizer/appc_spec_tests.cpp
+++ b/src/tests/containerizer/appc_spec_tests.cpp
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <string>
+
 #include <stout/gtest.hpp>
 #include <stout/json.hpp>
 #include <stout/os.hpp>
@@ -22,6 +24,8 @@
 
 #include "tests/mesos.hpp"
 
+using std::string;
+
 namespace spec = ::appc::spec;
 
 namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/containerizer/docker_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/docker_tests.cpp b/src/tests/containerizer/docker_tests.cpp
index 2f4e84a..9667d43 100644
--- a/src/tests/containerizer/docker_tests.cpp
+++ b/src/tests/containerizer/docker_tests.cpp
@@ -14,6 +14,10 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <list>
+#include <string>
+#include <vector>
+
 #include <gtest/gtest.h>
 
 #include <process/future.hpp>
@@ -37,6 +41,7 @@ using namespace process;
 
 using std::list;
 using std::string;
+using std::vector;
 
 namespace mesos {
 namespace internal {

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/containerizer/io_switchboard_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/io_switchboard_tests.cpp b/src/tests/containerizer/io_switchboard_tests.cpp
index 43f1ad6..7a90262 100644
--- a/src/tests/containerizer/io_switchboard_tests.cpp
+++ b/src/tests/containerizer/io_switchboard_tests.cpp
@@ -14,7 +14,9 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <map>
 #include <string>
+#include <vector>
 
 #include <process/address.hpp>
 #include <process/future.hpp>
@@ -72,7 +74,9 @@ using process::Owned;
 
 using testing::Eq;
 
+using std::map;
 using std::string;
+using std::vector;
 
 namespace mesos {
 namespace internal {

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/containerizer/nested_mesos_containerizer_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/nested_mesos_containerizer_tests.cpp b/src/tests/containerizer/nested_mesos_containerizer_tests.cpp
index 7744c83..9a6bcb5 100644
--- a/src/tests/containerizer/nested_mesos_containerizer_tests.cpp
+++ b/src/tests/containerizer/nested_mesos_containerizer_tests.cpp
@@ -16,6 +16,7 @@
 
 #include <sys/wait.h>
 
+#include <map>
 #include <sstream>
 #include <string>
 #include <vector>
@@ -67,6 +68,7 @@ using mesos::slave::ContainerTermination;
 using process::Future;
 using process::Owned;
 
+using std::map;
 using std::ostringstream;
 using std::string;
 using std::vector;

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/containerizer/nvidia_gpu_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/nvidia_gpu_isolator_tests.cpp b/src/tests/containerizer/nvidia_gpu_isolator_tests.cpp
index 74e06f0..9a78ae6 100644
--- a/src/tests/containerizer/nvidia_gpu_isolator_tests.cpp
+++ b/src/tests/containerizer/nvidia_gpu_isolator_tests.cpp
@@ -15,6 +15,7 @@
 // limitations under the License.
 
 #include <set>
+#include <string>
 #include <vector>
 
 #include <gmock/gmock.h>
@@ -61,6 +62,7 @@ using process::Future;
 using process::Owned;
 
 using std::set;
+using std::string;
 using std::vector;
 
 using testing::_;

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/containerizer/volume_image_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/volume_image_isolator_tests.cpp b/src/tests/containerizer/volume_image_isolator_tests.cpp
index f14a0bd..ad18844 100644
--- a/src/tests/containerizer/volume_image_isolator_tests.cpp
+++ b/src/tests/containerizer/volume_image_isolator_tests.cpp
@@ -14,6 +14,9 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <map>
+#include <string>
+
 #include <gtest/gtest.h>
 
 #include <stout/gtest.hpp>
@@ -38,6 +41,7 @@ using mesos::internal::slave::MesosContainerizer;
 
 using mesos::slave::ContainerTermination;
 
+using std::map;
 using std::string;
 
 namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/containerizer/volume_sandbox_path_isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/volume_sandbox_path_isolator_tests.cpp b/src/tests/containerizer/volume_sandbox_path_isolator_tests.cpp
index f873e28..5f4e382 100644
--- a/src/tests/containerizer/volume_sandbox_path_isolator_tests.cpp
+++ b/src/tests/containerizer/volume_sandbox_path_isolator_tests.cpp
@@ -14,6 +14,9 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <map>
+#include <string>
+
 #include <stout/gtest.hpp>
 
 #include <process/future.hpp>
@@ -32,6 +35,7 @@ using mesos::internal::slave::state::SlaveState;
 
 using mesos::slave::ContainerTermination;
 
+using std::map;
 using std::string;
 
 namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/default_executor_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/default_executor_tests.cpp b/src/tests/default_executor_tests.cpp
index e5a3374..a88796b 100644
--- a/src/tests/default_executor_tests.cpp
+++ b/src/tests/default_executor_tests.cpp
@@ -64,6 +64,7 @@ using process::http::Response;
 using std::pair;
 using std::set;
 using std::string;
+using std::vector;
 
 using testing::_;
 using testing::DoAll;

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/master_validation_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_validation_tests.cpp b/src/tests/master_validation_tests.cpp
index 42f566b..e5d55e0 100644
--- a/src/tests/master_validation_tests.cpp
+++ b/src/tests/master_validation_tests.cpp
@@ -16,6 +16,7 @@
 
 #include <google/protobuf/repeated_field.h>
 
+#include <string>
 #include <vector>
 
 #include <gmock/gmock.h>
@@ -59,6 +60,7 @@ using process::Future;
 using process::Owned;
 using process::PID;
 
+using std::string;
 using std::vector;
 
 using testing::_;

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/mesos.hpp
----------------------------------------------------------------------
diff --git a/src/tests/mesos.hpp b/src/tests/mesos.hpp
index f94882f..fa96515 100644
--- a/src/tests/mesos.hpp
+++ b/src/tests/mesos.hpp
@@ -559,7 +559,7 @@ inline TVolume createVolumeFromDockerImage(
 template <typename TContainerInfo, typename TVolume, typename TImage>
 inline TContainerInfo createContainerInfo(
     const Option<std::string> imageName = None(),
-    const vector<TVolume>& volumes = {})
+    const std::vector<TVolume>& volumes = {})
 {
   TContainerInfo info;
   info.set_type(TContainerInfo::MESOS);
@@ -1089,7 +1089,7 @@ inline Volume createVolumeFromDockerImage(Args&&... args)
 // We specify the argument to allow brace initialized construction.
 inline ContainerInfo createContainerInfo(
     const Option<std::string> imageName = None(),
-    const vector<Volume>& volumes = {})
+    const std::vector<Volume>& volumes = {})
 {
   return common::createContainerInfo<ContainerInfo, Volume, Image>(
       imageName,
@@ -1293,7 +1293,7 @@ inline mesos::v1::Volume createVolumeFromDockerImage(Args&&... args)
 // We specify the argument to allow brace initialized construction.
 inline mesos::v1::ContainerInfo createContainerInfo(
     const Option<std::string> imageName = None(),
-    const vector<mesos::v1::Volume>& volumes = {})
+    const std::vector<mesos::v1::Volume>& volumes = {})
 {
   return common::createContainerInfo<
       mesos::v1::ContainerInfo, mesos::v1::Volume, mesos::v1::Image>(

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/slave_authorization_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_authorization_tests.cpp b/src/tests/slave_authorization_tests.cpp
index 54b5d36..61c4446 100644
--- a/src/tests/slave_authorization_tests.cpp
+++ b/src/tests/slave_authorization_tests.cpp
@@ -15,6 +15,7 @@
 // limitations under the License.
 
 #include <string>
+#include <vector>
 
 #include <gmock/gmock.h>
 
@@ -56,6 +57,7 @@ using process::http::OK;
 using process::http::Response;
 
 using std::string;
+using std::vector;
 
 using testing::AtMost;
 using testing::DoAll;

http://git-wip-us.apache.org/repos/asf/mesos/blob/42b78518/src/tests/teardown_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/teardown_tests.cpp b/src/tests/teardown_tests.cpp
index 30c99f9..ce51d20 100644
--- a/src/tests/teardown_tests.cpp
+++ b/src/tests/teardown_tests.cpp
@@ -14,6 +14,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
+#include <vector>
+
 #include <gmock/gmock.h>
 
 #include <mesos/executor.hpp>
@@ -51,6 +53,8 @@ using process::http::OK;
 using process::http::Response;
 using process::http::Unauthorized;
 
+using std::vector;
+
 using testing::_;
 
 namespace mesos {