mesos-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject mesos git commit: Addes status method to DockerContainerizer.
Date Wed, 23 Nov 2016 06:07:26 GMT
Repository: mesos
Updated Branches:
  refs/heads/master 505b8293e -> 21b999f04


Addes status method to DockerContainerizer.

This patch added the implementation of the 'status' method to
DockerContainerizer. Previously, this method is missing. Currently,
the only status the DockerContainerizer reports is the ContainerID.

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


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

Branch: refs/heads/master
Commit: 21b999f04669486ca41a38524793a92fb6b3821b
Parents: 505b829
Author: Jie Yu <yujie.jay@gmail.com>
Authored: Tue Nov 22 13:46:21 2016 -0800
Committer: Jie Yu <yujie.jay@gmail.com>
Committed: Tue Nov 22 22:07:10 2016 -0800

----------------------------------------------------------------------
 src/slave/containerizer/docker.cpp | 19 +++++++++++++++++++
 src/slave/containerizer/docker.hpp |  6 ++++++
 2 files changed, 25 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/21b999f0/src/slave/containerizer/docker.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.cpp b/src/slave/containerizer/docker.cpp
index c2ed524..ccabf99 100644
--- a/src/slave/containerizer/docker.cpp
+++ b/src/slave/containerizer/docker.cpp
@@ -819,6 +819,16 @@ Future<ResourceStatistics> DockerContainerizer::usage(
 }
 
 
+Future<ContainerStatus> DockerContainerizer::status(
+    const ContainerID& containerId)
+{
+  return dispatch(
+      process.get(),
+      &DockerContainerizerProcess::status,
+      containerId);
+}
+
+
 Future<Option<ContainerTermination>> DockerContainerizer::wait(
     const ContainerID& containerId)
 {
@@ -1938,6 +1948,15 @@ Try<ResourceStatistics> DockerContainerizerProcess::cgroupsStatistics(
 }
 
 
+Future<ContainerStatus> DockerContainerizerProcess::status(
+    const ContainerID& containerId)
+{
+  ContainerStatus result;
+  result.mutable_container_id()->CopyFrom(containerId);
+  return result;
+}
+
+
 Future<Option<ContainerTermination>> DockerContainerizerProcess::wait(
     const ContainerID& containerId)
 {

http://git-wip-us.apache.org/repos/asf/mesos/blob/21b999f0/src/slave/containerizer/docker.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/docker.hpp b/src/slave/containerizer/docker.hpp
index 006f929..44efa44 100644
--- a/src/slave/containerizer/docker.hpp
+++ b/src/slave/containerizer/docker.hpp
@@ -102,6 +102,9 @@ public:
   virtual process::Future<ResourceStatistics> usage(
       const ContainerID& containerId);
 
+  virtual process::Future<ContainerStatus> status(
+      const ContainerID& containerId);
+
   virtual process::Future<Option<mesos::slave::ContainerTermination>> wait(
       const ContainerID& containerId);
 
@@ -154,6 +157,9 @@ public:
   virtual process::Future<ResourceStatistics> usage(
       const ContainerID& containerId);
 
+  virtual process::Future<ContainerStatus> status(
+      const ContainerID& containerId);
+
   virtual process::Future<Option<mesos::slave::ContainerTermination>> wait(
       const ContainerID& containerId);
 


Mime
View raw message