You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2013/04/17 09:08:31 UTC

svn commit: r1468768 - in /incubator/mesos/trunk/src/slave: slave.cpp slave.hpp

Author: vinodkone
Date: Wed Apr 17 07:08:31 2013
New Revision: 1468768

URL: http://svn.apache.org/r1468768
Log:
Used 'Owned' instead of shared_ptr and cleaned up some formatting.

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

Modified:
    incubator/mesos/trunk/src/slave/slave.cpp
    incubator/mesos/trunk/src/slave/slave.hpp

Modified: incubator/mesos/trunk/src/slave/slave.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/slave.cpp?rev=1468768&r1=1468767&r2=1468768&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/slave.cpp (original)
+++ incubator/mesos/trunk/src/slave/slave.cpp Wed Apr 17 07:08:31 2013
@@ -597,8 +597,8 @@ void Slave::runTask(
          info.id(),
          task.task_id(),
          TASK_LOST,
-         "Could not launch the task because the framework expects checkpointing"
-         ", but checkpointing is disabled on the slave");
+         "Could not launch the task because the framework expects "
+         "checkpointing, but checkpointing is disabled on the slave");
 
      statusUpdate(update);
      return;
@@ -1207,8 +1207,8 @@ void Slave::reregisterExecutorTimeout()
       // should have already been identified by the isolator (via
       // reaper) and cleaned up!
       if (!executor->pid) {
-        LOG(INFO) << "Shutting down un-reregistered executor " << executor->id
-                  << " of framework " << framework->id;
+        LOG(INFO) << "Shutting down un-reregistered executor "
+                  << executor->id << " of framework " << framework->id;
 
         // TODO(vinod): Call shutdownExecutor() when it supports
         // immediate shutdown of the executor.
@@ -1612,7 +1612,7 @@ void Slave::cleanup(Framework* framework
     frameworks.erase(framework->id);
 
     // Pass ownership of the framework pointer.
-    completedFrameworks.push_back(std::tr1::shared_ptr<Framework>(framework));
+    completedFrameworks.push_back(Owned<Framework>(framework));
   }
 
   // If this slave is in 'recover=cleanup' mode, exit after all

Modified: incubator/mesos/trunk/src/slave/slave.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/slave/slave.hpp?rev=1468768&r1=1468767&r2=1468768&view=diff
==============================================================================
--- incubator/mesos/trunk/src/slave/slave.hpp (original)
+++ incubator/mesos/trunk/src/slave/slave.hpp Wed Apr 17 07:08:31 2013
@@ -34,6 +34,7 @@
 #include <stout/hashmap.hpp>
 #include <stout/multihashmap.hpp>
 #include <stout/os.hpp>
+#include <stout/owned.hpp>
 #include <stout/path.hpp>
 #include <stout/uuid.hpp>
 
@@ -273,8 +274,7 @@ private:
 
   hashmap<FrameworkID, Framework*> frameworks;
 
-  // TODO(bmahler): Use the Owned abstraction.
-  boost::circular_buffer<std::tr1::shared_ptr<Framework> > completedFrameworks;
+  boost::circular_buffer<Owned<Framework> > completedFrameworks;
 
   Isolator* isolator;
   Files* files;
@@ -508,7 +508,7 @@ struct Framework
       executors.erase(executorId);
 
       // Pass ownership of the executor pointer.
-      completedExecutors.push_back(std::tr1::shared_ptr<Executor>(executor));
+      completedExecutors.push_back(Owned<Executor>(executor));
     }
   }
 
@@ -546,7 +546,7 @@ struct Framework
   hashmap<ExecutorID, Executor*> executors;
 
   // Up to MAX_COMPLETED_EXECUTORS_PER_FRAMEWORK completed executors.
-  boost::circular_buffer<std::tr1::shared_ptr<Executor> > completedExecutors;
+  boost::circular_buffer<Owned<Executor> > completedExecutors;
 private:
   Framework(const Framework&);              // No copying.
   Framework& operator = (const Framework&); // No assigning.