You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2011/06/05 10:21:45 UTC

svn commit: r1131998 - in /incubator/mesos/trunk/src/configurator: configurator.cpp configurator.hpp

Author: benh
Date: Sun Jun  5 08:21:44 2011
New Revision: 1131998

URL: http://svn.apache.org/viewvc?rev=1131998&view=rev
Log:
Reorganized configurator a little and added a call to dump config to Google Log

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

Modified: incubator/mesos/trunk/src/configurator/configurator.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/configurator/configurator.cpp?rev=1131998&r1=1131997&r2=1131998&view=diff
==============================================================================
--- incubator/mesos/trunk/src/configurator/configurator.cpp (original)
+++ incubator/mesos/trunk/src/configurator/configurator.cpp Sun Jun  5 08:21:44 2011
@@ -378,3 +378,29 @@ void Configurator::clearMesosEnvironment
     unsetenv(str.c_str());
   }
 }
+
+
+void Configurator::checkCommandLineParamFormat(const string& key, bool gotBool) 
+  throw(ConfigurationException)
+{
+  if (options.find(key) != options.end() && 
+      options[key].validator->isBool() != gotBool) {
+    string message = "Option '" + key + "' should ";
+    if (gotBool)
+      message += "not ";
+    message += "be a boolean.";
+
+    throw ConfigurationException(message.c_str());
+  }
+}
+
+
+void Configurator::dumpToGoogleLog()
+{
+  LOG(INFO) << "Dumping configuration options:";
+  const map<string, string>& paramsMap = params.getMap();
+  foreachpair (const string& key, const string& val, paramsMap) {
+    LOG(INFO) << "  " << key << " = " << val;
+  }
+  LOG(INFO) << "End configuration dump";
+}

Modified: incubator/mesos/trunk/src/configurator/configurator.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/configurator/configurator.hpp?rev=1131998&r1=1131997&r2=1131998&view=diff
==============================================================================
--- incubator/mesos/trunk/src/configurator/configurator.hpp (original)
+++ incubator/mesos/trunk/src/configurator/configurator.hpp Sun Jun  5 08:21:44 2011
@@ -332,18 +332,12 @@ private:
    * @param gotBool whether the option was passed as a bool
    */
   void checkCommandLineParamFormat(const string& key, bool gotBool) 
-    throw(ConfigurationException)
-  {
-    if (options.find(key) != options.end() && 
-        options[key].validator->isBool() != gotBool) {
-      string message = "Option '" + key + "' should ";
-      if (gotBool)
-        message += "not ";
-      message += "be a boolean.";
+    throw(ConfigurationException);
 
-      throw ConfigurationException(message.c_str());
-    }
-  }
+  /**
+   * Dump the values of all config options to Google Log
+   */
+  void dumpToGoogleLog();
 };
 
 } }   // end mesos :: internal namespace