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 2015/04/26 21:43:43 UTC
[10/10] mesos git commit: Switched from 'tuples::' to 'std::' in
Mesos.
Switched from 'tuples::' to 'std::' in Mesos.
Review: https://reviews.apache.org/r/33569
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/d3dfbd9b
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/d3dfbd9b
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/d3dfbd9b
Branch: refs/heads/master
Commit: d3dfbd9bcf41105abfab5306b309c2a772167323
Parents: 6b8d326
Author: Michael Park <mc...@gmail.com>
Authored: Sun Apr 26 12:26:34 2015 -0700
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Sun Apr 26 12:26:35 2015 -0700
----------------------------------------------------------------------
.../containerizer/external_containerizer.cpp | 10 ++++----
.../containerizer/external_containerizer.hpp | 8 +++---
.../containerizer/isolators/posix/disk.cpp | 10 ++++----
src/zookeeper/zookeeper.cpp | 26 +++++++++-----------
4 files changed, 26 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/d3dfbd9b/src/slave/containerizer/external_containerizer.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/external_containerizer.cpp b/src/slave/containerizer/external_containerizer.cpp
index 9a72acb..33fc010 100644
--- a/src/slave/containerizer/external_containerizer.cpp
+++ b/src/slave/containerizer/external_containerizer.cpp
@@ -19,6 +19,7 @@
#include <iostream>
#include <iomanip>
#include <list>
+#include <tuple>
#include <errno.h>
#include <poll.h>
@@ -58,10 +59,9 @@ using std::map;
using std::set;
using std::string;
using std::stringstream;
+using std::tuple;
using std::vector;
-using tuples::tuple;
-
using namespace process;
namespace mesos {
@@ -113,12 +113,12 @@ static Try<T> result(
return Error("Could not receive any result");
}
- Option<Error> error = validate(tuples::get<1>(future.get()));
+ Option<Error> error = validate(std::get<1>(future.get()));
if (error.isSome()) {
return error.get();
}
- Future<Result<T>> result = tuples::get<0>(future.get());
+ Future<Result<T>> result = std::get<0>(future.get());
if (result.isFailed()) {
return Error("Could not receive any result: " + result.failure());
}
@@ -670,7 +670,7 @@ void ExternalContainerizerProcess::__wait(
// the result validation below will return an error due to a non 0
// exit status.
if (actives[containerId]->destroying && future.isReady()) {
- Future<Option<int>> statusFuture = tuples::get<1>(future.get());
+ Future<Option<int>> statusFuture = std::get<1>(future.get());
if (statusFuture.isReady()) {
Option<int> status = statusFuture.get();
if (status.isSome()) {
http://git-wip-us.apache.org/repos/asf/mesos/blob/d3dfbd9b/src/slave/containerizer/external_containerizer.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/external_containerizer.hpp b/src/slave/containerizer/external_containerizer.hpp
index 726a97f..c00cebb 100644
--- a/src/slave/containerizer/external_containerizer.hpp
+++ b/src/slave/containerizer/external_containerizer.hpp
@@ -22,6 +22,7 @@
#include <list>
#include <sstream>
#include <string>
+#include <tuple>
#include <process/owned.hpp>
#include <process/subprocess.hpp>
@@ -29,7 +30,6 @@
#include <stout/hashmap.hpp>
#include <stout/protobuf.hpp>
#include <stout/try.hpp>
-#include <stout/tuple.hpp>
#include "slave/state.hpp"
@@ -235,7 +235,7 @@ private:
void __wait(
const ContainerID& containerId,
- const process::Future<tuples::tuple<
+ const process::Future<std::tuple<
process::Future<Result<containerizer::Termination>>,
process::Future<Option<int>>>>& future);
@@ -252,7 +252,7 @@ private:
process::Future<ResourceStatistics> __usage(
const ContainerID& containerId,
- const process::Future<tuples::tuple<
+ const process::Future<std::tuple<
process::Future<Result<ResourceStatistics>>,
process::Future<Option<int>>>>& future);
@@ -263,7 +263,7 @@ private:
const process::Future<Option<int>>& future);
process::Future<hashset<ContainerID>> _containers(
- const process::Future<tuples::tuple<
+ const process::Future<std::tuple<
process::Future<Result<containerizer::Containers>>,
process::Future<Option<int>>>>& future);
http://git-wip-us.apache.org/repos/asf/mesos/blob/d3dfbd9b/src/slave/containerizer/isolators/posix/disk.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/isolators/posix/disk.cpp b/src/slave/containerizer/isolators/posix/disk.cpp
index 73059bd..caf81e8 100644
--- a/src/slave/containerizer/isolators/posix/disk.cpp
+++ b/src/slave/containerizer/isolators/posix/disk.cpp
@@ -24,6 +24,7 @@
#include <sys/types.h>
#include <deque>
+#include <tuple>
#include <glog/logging.h>
@@ -39,7 +40,6 @@
#include <stout/lambda.hpp>
#include <stout/numify.hpp>
#include <stout/strings.hpp>
-#include <stout/tuple.hpp>
#include <stout/os/exists.hpp>
#include <stout/os/killtree.hpp>
@@ -430,7 +430,7 @@ private:
.onAny(defer(self(), &Self::_schedule, lambda::_1));
}
- void _schedule(const Future<tuples::tuple<
+ void _schedule(const Future<std::tuple<
Future<Option<int>>,
Future<string>,
Future<string>>>& future)
@@ -441,7 +441,7 @@ private:
const Owned<Entry>& entry = entries.front();
CHECK_SOME(entry->du);
- Future<Option<int>> status = tuples::get<0>(future.get());
+ Future<Option<int>> status = std::get<0>(future.get());
if (!status.isReady()) {
entry->promise.fail(
@@ -450,7 +450,7 @@ private:
} else if (status.get().isNone()) {
entry->promise.fail("Failed to reap the status of 'du'");
} else if (status.get().get() != 0) {
- Future<string> error = tuples::get<2>(future.get());
+ Future<string> error = std::get<2>(future.get());
if (!error.isReady()) {
entry->promise.fail(
"Failed to perform 'du'. Reading stderr failed: " +
@@ -459,7 +459,7 @@ private:
entry->promise.fail("Failed to perform 'du': " + error.get());
}
} else {
- Future<string> output = tuples::get<1>(future.get());
+ Future<string> output = std::get<1>(future.get());
if (!output.isReady()) {
entry->promise.fail(
"Failed to read stdout from 'du': " +
http://git-wip-us.apache.org/repos/asf/mesos/blob/d3dfbd9b/src/zookeeper/zookeeper.cpp
----------------------------------------------------------------------
diff --git a/src/zookeeper/zookeeper.cpp b/src/zookeeper/zookeeper.cpp
index d4c24cd..11ace5a 100644
--- a/src/zookeeper/zookeeper.cpp
+++ b/src/zookeeper/zookeeper.cpp
@@ -22,6 +22,7 @@
#include <iostream>
#include <map>
+#include <tuple>
#include <process/defer.hpp>
#include <process/dispatch.hpp>
@@ -34,7 +35,6 @@
#include <stout/foreach.hpp>
#include <stout/path.hpp>
#include <stout/strings.hpp>
-#include <stout/tuple.hpp>
#include <stout/unreachable.hpp>
#include "zookeeper/zookeeper.hpp"
@@ -43,11 +43,9 @@ using namespace process;
using std::map;
using std::string;
+using std::tuple;
using std::vector;
-using tuples::tuple;
-
-
class ZooKeeperProcess : public Process<ZooKeeperProcess>
{
public:
@@ -408,7 +406,7 @@ private:
const tuple<Promise<int>*>* args =
reinterpret_cast<const tuple<Promise<int>*>*>(data);
- Promise<int>* promise = tuples::get<0>(*args);
+ Promise<int>* promise = std::get<0>(*args);
promise->set(ret);
@@ -421,8 +419,8 @@ private:
const tuple<Promise<int>*, string*> *args =
reinterpret_cast<const tuple<Promise<int>*, string*>*>(data);
- Promise<int>* promise = tuples::get<0>(*args);
- string* result = tuples::get<1>(*args);
+ Promise<int>* promise = std::get<0>(*args);
+ string* result = std::get<1>(*args);
if (ret == 0) {
if (result != NULL) {
@@ -441,8 +439,8 @@ private:
const tuple<Promise<int>*, Stat*>* args =
reinterpret_cast<const tuple<Promise<int>*, Stat*>*>(data);
- Promise<int>* promise = tuples::get<0>(*args);
- Stat *stat_result = tuples::get<1>(*args);
+ Promise<int>* promise = std::get<0>(*args);
+ Stat *stat_result = std::get<1>(*args);
if (ret == 0) {
if (stat_result != NULL) {
@@ -466,9 +464,9 @@ private:
const tuple<Promise<int>*, string*, Stat*>* args =
reinterpret_cast<const tuple<Promise<int>*, string*, Stat*>*>(data);
- Promise<int>* promise = tuples::get<0>(*args);
- string* result = tuples::get<1>(*args);
- Stat* stat_result = tuples::get<2>(*args);
+ Promise<int>* promise = std::get<0>(*args);
+ string* result = std::get<1>(*args);
+ Stat* stat_result = std::get<2>(*args);
if (ret == 0) {
if (result != NULL) {
@@ -494,8 +492,8 @@ private:
const tuple<Promise<int>*, vector<string>*>* args =
reinterpret_cast<const tuple<Promise<int>*, vector<string>*>*>(data);
- Promise<int>* promise = tuples::get<0>(*args);
- vector<string>* results = tuples::get<1>(*args);
+ Promise<int>* promise = std::get<0>(*args);
+ vector<string>* results = std::get<1>(*args);
if (ret == 0) {
if (results != NULL) {