You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by al...@apache.org on 2017/08/10 16:32:22 UTC

[4/6] mesos git commit: Cleaned up style in example frameworks.

Cleaned up style in example frameworks.

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


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

Branch: refs/heads/master
Commit: d5a7c2229d2aba23f62599b25c651cd2ca669eb7
Parents: 4b9a543
Author: Armand Grillet <ag...@mesosphere.io>
Authored: Thu Aug 10 17:08:32 2017 +0200
Committer: Alexander Rukletsov <al...@apache.org>
Committed: Thu Aug 10 18:26:07 2017 +0200

----------------------------------------------------------------------
 src/examples/balloon_framework.cpp             | 35 ++++++---------
 src/examples/disk_full_framework.cpp           |  6 +--
 src/examples/docker_no_executor_framework.cpp  |  4 +-
 src/examples/dynamic_reservation_framework.cpp |  1 +
 src/examples/load_generator_framework.cpp      |  3 +-
 src/examples/long_lived_framework.cpp          | 34 +++++++--------
 src/examples/no_executor_framework.cpp         | 47 +++++++--------------
 src/examples/persistent_volume_framework.cpp   | 45 +++++++++-----------
 src/examples/test_framework.cpp                | 31 ++++++++------
 src/examples/test_http_framework.cpp           | 42 +++++++++---------
 10 files changed, 108 insertions(+), 140 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/d5a7c222/src/examples/balloon_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/balloon_framework.cpp b/src/examples/balloon_framework.cpp
index 08cf566..1a97f56 100644
--- a/src/examples/balloon_framework.cpp
+++ b/src/examples/balloon_framework.cpp
@@ -67,6 +67,7 @@ constexpr char EXECUTOR_BINARY[] = "balloon-executor";
 constexpr char FRAMEWORK_PRINCIPAL[] = "balloon-framework-cpp";
 constexpr char FRAMEWORK_METRICS_PREFIX[] = "balloon_framework";
 
+
 class Flags : public virtual flags::FlagsBase
 {
 public:
@@ -240,8 +241,8 @@ public:
       task.set_data(stringify(flags.task_memory_usage_limit));
 
       task.mutable_executor()->CopyFrom(executor);
-      task.mutable_executor()->mutable_executor_id()
-        ->set_value(stringify(taskId));
+      task.mutable_executor()->mutable_executor_id()->set_value(
+          stringify(taskId));
 
       driver->launchTasks(offer.id(), {task});
 
@@ -397,27 +398,21 @@ public:
   {
     LOG(INFO) << "Registered with framework ID: " << frameworkId;
 
-    process::dispatch(
-        &process,
-        &BalloonSchedulerProcess::registered);
+    process::dispatch(&process, &BalloonSchedulerProcess::registered);
   }
 
   virtual void reregistered(SchedulerDriver*, const MasterInfo& masterInfo)
   {
     LOG(INFO) << "Reregistered";
 
-    process::dispatch(
-        &process,
-        &BalloonSchedulerProcess::registered);
+    process::dispatch(&process, &BalloonSchedulerProcess::registered);
   }
 
   virtual void disconnected(SchedulerDriver* driver)
   {
     LOG(INFO) << "Disconnected";
 
-    process::dispatch(
-        &process,
-        &BalloonSchedulerProcess::disconnected);
+    process::dispatch(&process, &BalloonSchedulerProcess::disconnected);
   }
 
   virtual void resourceOffers(
@@ -433,21 +428,18 @@ public:
         offers);
   }
 
-  virtual void offerRescinded(
-      SchedulerDriver* driver,
-      const OfferID& offerId)
+  virtual void offerRescinded(SchedulerDriver* driver, const OfferID& offerId)
   {
     LOG(INFO) << "Offer rescinded";
   }
 
   virtual void statusUpdate(SchedulerDriver* driver, const TaskStatus& status)
   {
-    LOG(INFO)
-      << "Task " << status.task_id() << " in state "
-      << TaskState_Name(status.state())
-      << ", Source: " << status.source()
-      << ", Reason: " << status.reason()
-      << (status.has_message() ? ", Message: " + status.message() : "");
+    LOG(INFO) << "Task " << status.task_id() << " in state "
+              << TaskState_Name(status.state())
+              << ", Source: " << status.source()
+              << ", Reason: " << status.reason()
+              << (status.has_message() ? ", Message: " + status.message() : "");
 
     process::dispatch(
         &process,
@@ -601,8 +593,7 @@ int main(int argc, char** argv)
   } else {
     framework.set_principal(FRAMEWORK_PRINCIPAL);
 
-    driver = new MesosSchedulerDriver(
-        &scheduler, framework, flags.master);
+    driver = new MesosSchedulerDriver(&scheduler, framework, flags.master);
   }
 
   int status = driver->run() == DRIVER_STOPPED ? 0 : 1;

http://git-wip-us.apache.org/repos/asf/mesos/blob/d5a7c222/src/examples/disk_full_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/disk_full_framework.cpp b/src/examples/disk_full_framework.cpp
index 5eacc81..f9d5af5 100644
--- a/src/examples/disk_full_framework.cpp
+++ b/src/examples/disk_full_framework.cpp
@@ -40,7 +40,6 @@
 #include <stout/os.hpp>
 #include <stout/try.hpp>
 
-
 using namespace mesos;
 
 using std::string;
@@ -51,7 +50,6 @@ using process::defer;
 using process::metrics::Gauge;
 using process::metrics::Counter;
 
-
 const double CPUS_PER_TASK = 0.1;
 const int MEMORY_PER_TASK = 16;
 const Bytes DISK_PER_TASK = Megabytes(5);
@@ -59,6 +57,7 @@ const Bytes DISK_PER_TASK = Megabytes(5);
 constexpr char FRAMEWORK_PRINCIPAL[] = "disk-full-framework-cpp";
 constexpr char FRAMEWORK_METRICS_PREFIX[] = "disk_full_framework";
 
+
 class Flags : public virtual flags::FlagsBase
 {
 public:
@@ -485,8 +484,7 @@ int main(int argc, char** argv)
   } else {
     framework.set_principal(FRAMEWORK_PRINCIPAL);
 
-    driver = new MesosSchedulerDriver(
-        &scheduler, framework, flags.master);
+    driver = new MesosSchedulerDriver(&scheduler, framework, flags.master);
   }
 
   int status = driver->run() == DRIVER_STOPPED ? 0 : 1;

http://git-wip-us.apache.org/repos/asf/mesos/blob/d5a7c222/src/examples/docker_no_executor_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/docker_no_executor_framework.cpp b/src/examples/docker_no_executor_framework.cpp
index 312d281..8e1844e 100644
--- a/src/examples/docker_no_executor_framework.cpp
+++ b/src/examples/docker_no_executor_framework.cpp
@@ -42,6 +42,7 @@ const int32_t MEM_PER_TASK = 32;
 constexpr char FRAMEWORK_NAME[] = "Docker No Executor Framework (C++)";
 constexpr char FRAMEWORK_PRINCIPAL[] = "no-executor-framework-cpp";
 
+
 class DockerNoExecutorScheduler : public Scheduler
 {
 public:
@@ -214,8 +215,7 @@ int main(int argc, char** argv)
   } else {
     framework.set_principal(FRAMEWORK_PRINCIPAL);
 
-    driver = new MesosSchedulerDriver(
-        &scheduler, framework, argv[1]);
+    driver = new MesosSchedulerDriver(&scheduler, framework, argv[1]);
   }
 
   int status = driver->run() == DRIVER_STOPPED ? 0 : 1;

http://git-wip-us.apache.org/repos/asf/mesos/blob/d5a7c222/src/examples/dynamic_reservation_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/dynamic_reservation_framework.cpp b/src/examples/dynamic_reservation_framework.cpp
index f378479..bb6f58b 100644
--- a/src/examples/dynamic_reservation_framework.cpp
+++ b/src/examples/dynamic_reservation_framework.cpp
@@ -44,6 +44,7 @@ const int32_t MEM_PER_TASK = 128;
 
 constexpr char FRAMEWORK_NAME[] = "Dynamic Reservation Framework (C++)";
 
+
 // The framework reserves resources to run at most one task at a time
 // on each agent; the resources are reserved when they are offered to
 // the framework for the first time, and are unreserved when all tasks

http://git-wip-us.apache.org/repos/asf/mesos/blob/d5a7c222/src/examples/load_generator_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/load_generator_framework.cpp b/src/examples/load_generator_framework.cpp
index f30895b..653ae81 100644
--- a/src/examples/load_generator_framework.cpp
+++ b/src/examples/load_generator_framework.cpp
@@ -43,6 +43,7 @@ using std::vector;
 
 constexpr char FRAMEWORK_NAME[] = "Load Generator Framework (C++)";
 
+
 // Generate load towards the master (by repeatedly sending
 // ReconcileTasksMessages) at the specified rate and for the
 // specified duration.
@@ -66,7 +67,7 @@ private:
     watch.start();
 
     while (true) {
-      Duration elapsed =  watch.elapsed();
+      Duration elapsed = watch.elapsed();
 
       if (duration.isSome() && elapsed >= duration.get()) {
         LOG(INFO) << "LoadGenerator generated " << messages

http://git-wip-us.apache.org/repos/asf/mesos/blob/d5a7c222/src/examples/long_lived_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/long_lived_framework.cpp b/src/examples/long_lived_framework.cpp
index 61ea64f..3de4a02 100644
--- a/src/examples/long_lived_framework.cpp
+++ b/src/examples/long_lived_framework.cpp
@@ -84,7 +84,6 @@ using process::http::OK;
 using process::metrics::Gauge;
 using process::metrics::Counter;
 
-
 // NOTE: Per-task resources are nominal because all of the resources for the
 // container are provisioned when the executor is created. The executor can
 // run multiple tasks at once, but uses a constant amount of resources
@@ -100,6 +99,7 @@ constexpr char EXECUTOR_NAME[] = "Long Lived Executor (C++)";
 constexpr char FRAMEWORK_NAME[] = "Long Lived Framework (C++)";
 constexpr char FRAMEWORK_METRICS_PREFIX[] = "long_lived_framework";
 
+
 // This scheduler picks one agent and repeatedly launches sleep tasks on it,
 // using a single multi-task executor. If the agent or executor fails, the
 // scheduler will pick another agent and continue launching sleep tasks.
@@ -136,13 +136,14 @@ protected:
   {
     // We initialize the library here to ensure that callbacks are only invoked
     // after the process has spawned.
-    mesos.reset(new Mesos(
-      master,
-      mesos::ContentType::PROTOBUF,
-      process::defer(self(), &Self::connected),
-      process::defer(self(), &Self::disconnected),
-      process::defer(self(), &Self::received, lambda::_1),
-      credential));
+    mesos.reset(
+        new Mesos(
+            master,
+            mesos::ContentType::PROTOBUF,
+            process::defer(self(), &Self::connected),
+            process::defer(self(), &Self::disconnected),
+            process::defer(self(), &Self::received, lambda::_1),
+            credential));
   }
 
   void connected()
@@ -190,8 +191,7 @@ protected:
 
       switch (event.type()) {
         case Event::SUBSCRIBED: {
-          framework.mutable_id()->
-            CopyFrom(event.subscribed().framework_id());
+          framework.mutable_id()->CopyFrom(event.subscribed().framework_id());
 
           LOG(INFO) << "Subscribed with ID '" << framework.id() << "'";
 
@@ -263,11 +263,11 @@ protected:
         // No active executor running in the cluster.
         // Launch a new task with executor.
 
-        if (Resources(offer.resources()).toUnreserved()
-            .contains(taskResources + executorResources)) {
-          LOG(INFO)
-            << "Starting executor and task " << tasksLaunched
-            << " on " << offer.hostname();
+        if (Resources(offer.resources())
+              .toUnreserved()
+              .contains(taskResources + executorResources)) {
+          LOG(INFO) << "Starting executor and task " << tasksLaunched << " on "
+                    << offer.hostname();
 
           launch(offer);
 
@@ -282,8 +282,8 @@ protected:
         if (Resources(offer.resources())
               .toUnreserved()
               .contains(taskResources)) {
-          LOG(INFO)
-            << "Starting task " << tasksLaunched << " on " << offer.hostname();
+          LOG(INFO) << "Starting task " << tasksLaunched << " on "
+                    << offer.hostname();
 
           launch(offer);
         } else {

http://git-wip-us.apache.org/repos/asf/mesos/blob/d5a7c222/src/examples/no_executor_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/no_executor_framework.cpp b/src/examples/no_executor_framework.cpp
index 8d31db3..2ca240b 100644
--- a/src/examples/no_executor_framework.cpp
+++ b/src/examples/no_executor_framework.cpp
@@ -93,8 +93,7 @@ public:
     LOG(INFO) << "Reregistered with master " << masterInfo;
   }
 
-  virtual void disconnected(
-      SchedulerDriver* driver)
+  virtual void disconnected(SchedulerDriver* driver)
   {
     LOG(INFO) << "Disconnected!";
   }
@@ -132,16 +131,12 @@ public:
     }
   }
 
-  virtual void offerRescinded(
-      SchedulerDriver* driver,
-      const OfferID& offerId)
+  virtual void offerRescinded(SchedulerDriver* driver, const OfferID& offerId)
   {
     LOG(INFO) << "Offer " << offerId << " has been rescinded";
   }
 
-  virtual void statusUpdate(
-      SchedulerDriver* driver,
-      const TaskStatus& status)
+  virtual void statusUpdate(SchedulerDriver* driver, const TaskStatus& status)
   {
     if (!activeTasks.contains(status.task_id())) {
       LOG(WARNING) << "Unknown task '" << status.task_id() << "'"
@@ -194,9 +189,7 @@ public:
                << "' on agent " << slaveId << ": '" << data << "'";
   }
 
-  virtual void slaveLost(
-      SchedulerDriver* driver,
-      const SlaveID& slaveId)
+  virtual void slaveLost(SchedulerDriver* driver, const SlaveID& slaveId)
   {
     LOG(INFO) << "Lost agent " << slaveId;
   }
@@ -211,9 +204,7 @@ public:
               << slaveId << ", " << WSTRINGIFY(status);
   }
 
-  virtual void error(
-      SchedulerDriver* driver,
-      const string& message)
+  virtual void error(SchedulerDriver* driver, const string& message)
   {
     LOG(ERROR) << message;
   }
@@ -302,8 +293,7 @@ int main(int argc, char** argv)
   Try<flags::Warnings> load = flags.load("MESOS_", argc, argv);
 
   if (load.isError()) {
-    EXIT(EXIT_FAILURE)
-      << flags.usage(load.error());
+    EXIT(EXIT_FAILURE) << flags.usage(load.error());
   }
 
   // Log any flag warnings.
@@ -312,19 +302,17 @@ int main(int argc, char** argv)
   }
 
   if (flags.help) {
-    EXIT(EXIT_SUCCESS)
-      << flags.usage();
+    EXIT(EXIT_SUCCESS) << flags.usage();
   }
 
   if (flags.master.isNone()) {
-    EXIT(EXIT_FAILURE)
-      << flags.usage("Missing required option --master");
+    EXIT(EXIT_FAILURE) << flags.usage("Missing required option --master");
   }
 
   if (flags.principal.isSome() != flags.secret.isSome()) {
-    EXIT(EXIT_FAILURE)
-      << flags.usage("Both --principal and --secret are required"
-                     " to enable authentication");
+    EXIT(EXIT_FAILURE) << flags.usage(
+        "Both --principal and --secret are required"
+        " to enable authentication");
   }
 
   FrameworkInfo framework;
@@ -343,13 +331,11 @@ int main(int argc, char** argv)
     framework.set_principal(flags.principal.get());
   }
 
-  Try<Resources> resources =
-    Resources::parse(flags.task_resources);
+  Try<Resources> resources = Resources::parse(flags.task_resources);
 
   if (resources.isError()) {
-    EXIT(EXIT_FAILURE)
-      << flags.usage("Invalid --task_resources: " +
-                     resources.error());
+    EXIT(EXIT_FAILURE) << flags.usage(
+        "Invalid --task_resources: " + resources.error());
   }
 
   Resources taskResources = resources.get();
@@ -359,9 +345,8 @@ int main(int argc, char** argv)
       Resources::parse(flags.task_revocable_resources.get());
 
     if (revocableResources.isError()) {
-      EXIT(EXIT_FAILURE)
-        << flags.usage("Invalid --task_revocable_resources: " +
-                       revocableResources.error());
+      EXIT(EXIT_FAILURE) << flags.usage(
+          "Invalid --task_revocable_resources: " + revocableResources.error());
     }
 
     foreach (Resource revocable, revocableResources.get()) {

http://git-wip-us.apache.org/repos/asf/mesos/blob/d5a7c222/src/examples/persistent_volume_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/persistent_volume_framework.cpp b/src/examples/persistent_volume_framework.cpp
index 46add06..bce2a2d 100644
--- a/src/examples/persistent_volume_framework.cpp
+++ b/src/examples/persistent_volume_framework.cpp
@@ -54,6 +54,7 @@ using std::vector;
 
 constexpr char FRAMEWORK_NAME[] = "Persistent Volume Framework (C++)";
 
+
 // TODO(jieyu): Currently, persistent volume is only allowed for
 // reserved resources.
 static Resources SHARD_INITIAL_RESOURCES(const string& role)
@@ -145,20 +146,22 @@ public:
   {
     // Initialize the shards using regular persistent volume.
     for (size_t i = 0; i < numShards; i++) {
-      shards.push_back(Shard(
-          "shard-" + stringify(i),
-          frameworkInfo.role(),
-          tasksPerShard,
-          false));
+      shards.push_back(
+          Shard(
+              "shard-" + stringify(i),
+              frameworkInfo.role(),
+              tasksPerShard,
+              false));
     }
 
     // Initialize the shards using shared persistent volume.
     for (size_t i = 0; i < numSharedShards; i++) {
-      shards.push_back(Shard(
-          "shared-shard-" + stringify(i),
-          frameworkInfo.role(),
-          tasksPerShard,
-          true));
+      shards.push_back(
+          Shard(
+              "shared-shard-" + stringify(i),
+              frameworkInfo.role(),
+              tasksPerShard,
+              true));
     }
   }
 
@@ -180,8 +183,7 @@ public:
     LOG(INFO) << "Reregistered with master " << masterInfo;
   }
 
-  virtual void disconnected(
-      SchedulerDriver* driver)
+  virtual void disconnected(SchedulerDriver* driver)
   {
     LOG(INFO) << "Disconnected!";
   }
@@ -343,16 +345,12 @@ public:
     }
   }
 
-  virtual void offerRescinded(
-      SchedulerDriver* driver,
-      const OfferID& offerId)
+  virtual void offerRescinded(SchedulerDriver* driver, const OfferID& offerId)
   {
     LOG(INFO) << "Offer " << offerId << " has been rescinded";
   }
 
-  virtual void statusUpdate(
-      SchedulerDriver* driver,
-      const TaskStatus& status)
+  virtual void statusUpdate(SchedulerDriver* driver, const TaskStatus& status)
   {
     LOG(INFO) << "Task '" << status.task_id() << "' is in state "
               << status.state();
@@ -402,9 +400,7 @@ public:
               << "' on agent " << slaveId << ": '" << data << "'";
   }
 
-  virtual void slaveLost(
-      SchedulerDriver* driver,
-      const SlaveID& slaveId)
+  virtual void slaveLost(SchedulerDriver* driver, const SlaveID& slaveId)
   {
     LOG(INFO) << "Lost agent " << slaveId;
   }
@@ -419,9 +415,7 @@ public:
               << slaveId << ", " << WSTRINGIFY(status);
   }
 
-  virtual void error(
-      SchedulerDriver* driver,
-      const string& message)
+  virtual void error(SchedulerDriver* driver, const string& message)
   {
     LOG(ERROR) << message;
   }
@@ -458,8 +452,7 @@ private:
     // The persistent volume associated with this shard.
     struct Volume
     {
-      explicit Volume(bool _isShared)
-        : isShared(_isShared) {}
+      explicit Volume(bool _isShared) : isShared(_isShared) {}
 
       // `Resource` object for this volume.
       Option<Resource> resource;

http://git-wip-us.apache.org/repos/asf/mesos/blob/d5a7c222/src/examples/test_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/test_framework.cpp b/src/examples/test_framework.cpp
index 0f2f97d..a6b38f0 100644
--- a/src/examples/test_framework.cpp
+++ b/src/examples/test_framework.cpp
@@ -56,6 +56,7 @@ constexpr char EXECUTOR_NAME[] = "Test Executor (C++)";
 constexpr char FRAMEWORK_NAME[] = "Test Framework (C++)";
 constexpr char FRAMEWORK_PRINCIPAL[] = "test-framework-cpp";
 
+
 class TestScheduler : public Scheduler
 {
 public:
@@ -135,8 +136,8 @@ public:
     }
   }
 
-  virtual void offerRescinded(SchedulerDriver* driver,
-                              const OfferID& offerId) {}
+  virtual void offerRescinded(SchedulerDriver* driver, const OfferID& offerId)
+  {}
 
   virtual void statusUpdate(SchedulerDriver* driver, const TaskStatus& status)
   {
@@ -155,8 +156,7 @@ public:
            << " is in unexpected state " << status.state()
            << " with reason " << status.reason()
            << " from source " << status.source()
-           << " with message '" << status.message() << "'"
-           << endl;
+           << " with message '" << status.message() << "'" << endl;
       driver->abort();
     }
 
@@ -169,17 +169,21 @@ public:
     }
   }
 
-  virtual void frameworkMessage(SchedulerDriver* driver,
-                                const ExecutorID& executorId,
-                                const SlaveID& slaveId,
-                                const string& data) {}
+  virtual void frameworkMessage(
+      SchedulerDriver* driver,
+      const ExecutorID& executorId,
+      const SlaveID& slaveId,
+      const string& data)
+  {}
 
   virtual void slaveLost(SchedulerDriver* driver, const SlaveID& sid) {}
 
-  virtual void executorLost(SchedulerDriver* driver,
-                            const ExecutorID& executorID,
-                            const SlaveID& slaveID,
-                            int status) {}
+  virtual void executorLost(
+      SchedulerDriver* driver,
+      const ExecutorID& executorID,
+      const SlaveID& slaveID,
+      int status)
+  {}
 
   virtual void error(SchedulerDriver* driver, const string& message)
   {
@@ -266,8 +270,7 @@ int main(int argc, char** argv)
 
   value = os::getenv("MESOS_CHECKPOINT");
   if (value.isSome()) {
-    framework.set_checkpoint(
-        numify<bool>(value.get()).get());
+    framework.set_checkpoint(numify<bool>(value.get()).get());
   }
 
   bool implicitAcknowledgements = true;

http://git-wip-us.apache.org/repos/asf/mesos/blob/d5a7c222/src/examples/test_http_framework.cpp
----------------------------------------------------------------------
diff --git a/src/examples/test_http_framework.cpp b/src/examples/test_http_framework.cpp
index 7000897..693dd47 100644
--- a/src/examples/test_http_framework.cpp
+++ b/src/examples/test_http_framework.cpp
@@ -15,8 +15,8 @@
 // limitations under the License.
 
 #include <iostream>
-#include <string>
 #include <queue>
+#include <string>
 
 #include <boost/lexical_cast.hpp>
 
@@ -39,7 +39,6 @@
 #include <stout/numify.hpp>
 #include <stout/option.hpp>
 #include <stout/os.hpp>
-#include <stout/option.hpp>
 #include <stout/path.hpp>
 #include <stout/stringify.hpp>
 
@@ -69,6 +68,7 @@ constexpr char EXECUTOR_BINARY[] = "test-http-executor";
 constexpr char EXECUTOR_NAME[] = "Test Executor (C++)";
 constexpr char FRAMEWORK_NAME[] = "Event Call Scheduler using libprocess (C++)";
 
+
 class HTTPScheduler : public process::Process<HTTPScheduler>
 {
 public:
@@ -205,26 +205,26 @@ public:
   }
 
 protected:
-virtual void initialize()
-{
-  // We initialize the library here to ensure that callbacks are only invoked
-  // after the process has spawned.
-  mesos.reset(new scheduler::Mesos(
-      master,
-      mesos::ContentType::PROTOBUF,
-      process::defer(self(), &Self::connected),
-      process::defer(self(), &Self::disconnected),
-      process::defer(self(), &Self::received, lambda::_1),
-      None()));
-}
+  virtual void initialize()
+  {
+    // We initialize the library here to ensure that callbacks are only invoked
+    // after the process has spawned.
+    mesos.reset(
+        new scheduler::Mesos(
+            master,
+            mesos::ContentType::PROTOBUF,
+            process::defer(self(), &Self::connected),
+            process::defer(self(), &Self::disconnected),
+            process::defer(self(), &Self::received, lambda::_1),
+            None()));
+  }
 
 private:
   void resourceOffers(const vector<Offer>& offers)
   {
     foreach (const Offer& offer, offers) {
       cout << "Received offer " << offer.id() << " with "
-           << Resources(offer.resources())
-           << endl;
+           << Resources(offer.resources()) << endl;
 
       Resources taskResources = Resources::parse(
           "cpus:" + stringify(CPUS_PER_TASK) +
@@ -244,8 +244,7 @@ private:
 
         TaskInfo task;
         task.set_name("Task " + lexical_cast<string>(taskId));
-        task.mutable_task_id()->set_value(
-            lexical_cast<string>(taskId));
+        task.mutable_task_id()->set_value(lexical_cast<string>(taskId));
         task.mutable_agent_id()->MergeFrom(offer.agent_id());
         task.mutable_executor()->MergeFrom(executor);
 
@@ -348,9 +347,7 @@ private:
 
     mesos->send(call);
 
-    process::delay(Seconds(1),
-                   self(),
-                   &Self::doReliableRegistration);
+    process::delay(Seconds(1), self(), &Self::doReliableRegistration);
   }
 
   void finalize()
@@ -451,8 +448,7 @@ int main(int argc, char** argv)
 
   value = os::getenv("MESOS_CHECKPOINT");
   if (value.isSome()) {
-    framework.set_checkpoint(
-        numify<bool>(value.get()).get());
+    framework.set_checkpoint(numify<bool>(value.get()).get());
   }
 
   ExecutorInfo executor;