You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2015/09/17 00:54:39 UTC

[5/6] mesos git commit: Renamed provisioners::path to provisioner::path.

Renamed provisioners::path to provisioner::path.

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


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

Branch: refs/heads/master
Commit: c027c82b994b30e1a4bdbf6b4b3511dc8ed12f9e
Parents: cc1f8f5
Author: Jie Yu <yu...@gmail.com>
Authored: Tue Sep 15 11:33:23 2015 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Wed Sep 16 15:45:50 2015 -0700

----------------------------------------------------------------------
 .../provisioner/appc/provisioner.cpp            |  8 +++----
 src/slave/containerizer/provisioner/paths.cpp   |  4 ++--
 src/slave/containerizer/provisioner/paths.hpp   | 20 +++++++++---------
 src/slave/paths.cpp                             | 22 ++++++++++----------
 src/slave/paths.hpp                             | 12 +++++------
 src/tests/paths_tests.cpp                       |  2 +-
 6 files changed, 34 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c027c82b/src/slave/containerizer/provisioner/appc/provisioner.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/provisioner/appc/provisioner.cpp b/src/slave/containerizer/provisioner/appc/provisioner.cpp
index 929e42a..2e77747 100644
--- a/src/slave/containerizer/provisioner/appc/provisioner.cpp
+++ b/src/slave/containerizer/provisioner/appc/provisioner.cpp
@@ -217,7 +217,7 @@ Future<Nothing> AppcProvisionerProcess::recover(
   // be destroyed by the containerizer using the normal cleanup path. See
   // MESOS-2367 for details.
   Try<hashmap<ContainerID, string>> containers =
-    provisioners::paths::listContainers(root);
+    provisioner::paths::listContainers(root);
 
   if (containers.isError()) {
     return Failure("Failed to list the containers managed by Appc "
@@ -231,7 +231,7 @@ Future<Nothing> AppcProvisionerProcess::recover(
     Owned<Info> info = Owned<Info>(new Info());
 
     Try<hashmap<string, hashmap<string, string>>> rootfses =
-      provisioners::paths::listContainerRootfses(root, containerId);
+      provisioner::paths::listContainerRootfses(root, containerId);
 
     if (rootfses.isError()) {
       return Failure("Unable to list rootfses belonged to container '" +
@@ -305,7 +305,7 @@ Future<string> AppcProvisionerProcess::provision(
   }
 
   string rootfsId = UUID::random().toString();
-  string rootfs = provisioners::paths::getContainerRootfsDir(
+  string rootfs = provisioner::paths::getContainerRootfsDir(
       root, containerId, flags.appc_provisioner_backend, rootfsId);
 
   if (!infos.contains(containerId)) {
@@ -368,7 +368,7 @@ Future<bool> AppcProvisionerProcess::destroy(const ContainerID& containerId)
   // NOTE: We calculate 'containerDir' here so that the following
   // lambda does not need to bind 'this'.
   string containerDir =
-    provisioners::paths::getContainerDir(root, containerId);
+    provisioner::paths::getContainerDir(root, containerId);
 
   // TODO(xujyan): Revisit the usefulness of this return value.
   return collect(futures)

http://git-wip-us.apache.org/repos/asf/mesos/blob/c027c82b/src/slave/containerizer/provisioner/paths.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/provisioner/paths.cpp b/src/slave/containerizer/provisioner/paths.cpp
index cb2690e..601c51f 100644
--- a/src/slave/containerizer/provisioner/paths.cpp
+++ b/src/slave/containerizer/provisioner/paths.cpp
@@ -37,7 +37,7 @@ using std::string;
 namespace mesos {
 namespace internal {
 namespace slave {
-namespace provisioners {
+namespace provisioner {
 namespace paths {
 
 static string getContainersDir(const string& provisionerDir)
@@ -186,7 +186,7 @@ Try<hashmap<string, hashmap<string, string>>> listContainerRootfses(
 }
 
 } // namespace paths {
-} // namespace provisioners {
+} // namespace provisioner {
 } // namespace slave {
 } // namespace internal {
 } // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c027c82b/src/slave/containerizer/provisioner/paths.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/provisioner/paths.hpp b/src/slave/containerizer/provisioner/paths.hpp
index 4ea47e3..7ec8fee 100644
--- a/src/slave/containerizer/provisioner/paths.hpp
+++ b/src/slave/containerizer/provisioner/paths.hpp
@@ -29,13 +29,13 @@
 namespace mesos {
 namespace internal {
 namespace slave {
-namespace provisioners {
+namespace provisioner {
 namespace paths {
 
 // The provisioner rootfs directory is as follows:
 // <work_dir> ('--work_dir' flag)
-// |-- provisioners
-//     |-- <provisioner_type> (APPC, DOCKER, etc.)
+// |-- provisioner
+//     |-- <image_type> (APPC, DOCKER, etc.)
 //         |-- containers
 //             |-- <container_id>
 //                 |-- backends
@@ -43,12 +43,12 @@ namespace paths {
 //                         |-- rootfses
 //                             |-- <rootfs_id> (the rootfs)
 //
-// NOTE: Each container could have multiple image types, therefore there
-// can be the same <container_id> directory under other provisioners e.g.,
-// <work_dir>/provisioners/DOCKER, <work_dir>/provisioners/APPC, etc.
-// Under each provisioner + container there can be multiple backends
-// due to the change of backend flags. Under each backend a rootfs is
-// identified by the 'rootfs_id' which is a UUID.
+// NOTE: Each container could have multiple image types, therefore the
+// same <container_id> directory can be under other directories (e.g.,
+// <work_dir>/provisioner/DOCKER, <work_dir>/provisioner/APPC, etc.).
+// There can be multiple backends due to the change of backend flags.
+// Under each backend a rootfs is identified by the 'rootfs_id' which
+// is a UUID.
 
 std::string getContainerDir(
     const std::string& provisionerDir,
@@ -75,7 +75,7 @@ Try<hashmap<ContainerID, std::string>> listContainers(
     const std::string& provisionerDir);
 
 } // namespace paths {
-} // namespace provisioners {
+} // namespace provisioner {
 } // namespace slave {
 } // namespace internal {
 } // namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c027c82b/src/slave/paths.cpp
----------------------------------------------------------------------
diff --git a/src/slave/paths.cpp b/src/slave/paths.cpp
index f104ecd..26b7f88 100644
--- a/src/slave/paths.cpp
+++ b/src/slave/paths.cpp
@@ -369,6 +369,17 @@ string getPersistentVolumePath(
 }
 
 
+string getProvisionerDir(
+    const string& rootDir,
+    const Image::Type& imageType)
+{
+  return path::join(
+      rootDir,
+      "provisioner",
+      stringify(imageType));
+}
+
+
 string createExecutorDirectory(
     const string& rootDir,
     const SlaveID& slaveId,
@@ -452,17 +463,6 @@ string createSlaveDirectory(
   return directory;
 }
 
-
-string getProvisionerDir(
-    const string& rootDir,
-    const Image::Type& imageType)
-{
-  return path::join(
-      rootDir,
-      "provisioners",
-      stringify(imageType));
-}
-
 } // namespace paths {
 } // namespace slave {
 } // namespace internal {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c027c82b/src/slave/paths.hpp
----------------------------------------------------------------------
diff --git a/src/slave/paths.hpp b/src/slave/paths.hpp
index 43c65af..8873e78 100644
--- a/src/slave/paths.hpp
+++ b/src/slave/paths.hpp
@@ -264,6 +264,12 @@ std::string getPersistentVolumePath(
     const std::string& persistenceId);
 
 
+// Contents of the provisioner directory are managed by the provisioner itself.
+std::string getProvisionerDir(
+    const std::string& rootDir,
+    const Image::Type& imageType);
+
+
 std::string createExecutorDirectory(
     const std::string& rootDir,
     const SlaveID& slaveId,
@@ -277,12 +283,6 @@ std::string createSlaveDirectory(
     const std::string& rootDir,
     const SlaveID& slaveId);
 
-
-// Contents of the provisioner directory are managed by the provisioner itself.
-std::string getProvisionerDir(
-    const std::string& rootDir,
-    const Image::Type& imageType);
-
 } // namespace paths {
 } // namespace slave {
 } // namespace internal {

http://git-wip-us.apache.org/repos/asf/mesos/blob/c027c82b/src/tests/paths_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/paths_tests.cpp b/src/tests/paths_tests.cpp
index 1ccc5c7..efdc2c0 100644
--- a/src/tests/paths_tests.cpp
+++ b/src/tests/paths_tests.cpp
@@ -221,7 +221,7 @@ TEST_F(PathsTest, PersistentVolume)
 
 TEST_F(PathsTest, ProvisionerDir)
 {
-  string dir = path::join(rootDir, "provisioners", "APPC");
+  string dir = path::join(rootDir, "provisioner", "APPC");
 
   EXPECT_EQ(dir, paths::getProvisionerDir(rootDir, imageType));
 }