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 2012/07/12 22:46:55 UTC
svn commit: r1360924 [2/2] - in /incubator/mesos/trunk: src/ src/common/
src/configurator/ src/detector/ src/exec/ src/flags/ src/java/jni/ src/jvm/
src/launcher/ src/linux/ src/local/ src/log/ src/logging/ src/master/
src/mesos/ src/sched/ src/slave/ ...
Modified: incubator/mesos/trunk/src/tests/log_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/log_tests.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/log_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/log_tests.cpp Thu Jul 12 20:46:50 2012
@@ -24,9 +24,10 @@
#include <process/future.hpp>
#include <process/protobuf.hpp>
-#include "common/option.hpp"
+#include <stout/option.hpp>
+#include <stout/os.hpp>
+
#include "common/type_utils.hpp"
-#include "common/utils.hpp"
#include "log/coordinator.hpp"
#include "log/log.hpp"
@@ -50,9 +51,9 @@ using testing::Return;
TEST(ReplicaTest, Promise)
{
- const std::string path = utils::os::getcwd() + "/.log";
+ const std::string path = os::getcwd() + "/.log";
- utils::os::rmdir(path);
+ os::rmdir(path);
Replica replica(path);
@@ -101,15 +102,15 @@ TEST(ReplicaTest, Promise)
EXPECT_EQ(0, response.position());
EXPECT_FALSE(response.has_action());
- utils::os::rmdir(path);
+ os::rmdir(path);
}
TEST(ReplicaTest, Append)
{
- const std::string path = utils::os::getcwd() + "/.log";
+ const std::string path = os::getcwd() + "/.log";
- utils::os::rmdir(path);
+ os::rmdir(path);
Replica replica(path);
@@ -166,15 +167,15 @@ TEST(ReplicaTest, Append)
EXPECT_FALSE(action.has_truncate());
EXPECT_EQ("hello world", action.append().bytes());
- utils::os::rmdir(path);
+ os::rmdir(path);
}
TEST(ReplicaTest, Recover)
{
- const std::string path = utils::os::getcwd() + "/.log";
+ const std::string path = os::getcwd() + "/.log";
- utils::os::rmdir(path);
+ os::rmdir(path);
Replica replica1(path);
@@ -255,17 +256,17 @@ TEST(ReplicaTest, Recover)
EXPECT_EQ("hello world", action.append().bytes());
}
- utils::os::rmdir(path);
+ os::rmdir(path);
}
TEST(CoordinatorTest, Elect)
{
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
Replica replica1(path1);
Replica replica2(path2);
@@ -293,18 +294,18 @@ TEST(CoordinatorTest, Elect)
ASSERT_EQ(Action::NOP, actions.get().front().type());
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
}
TEST(CoordinatorTest, AppendRead)
{
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
Replica replica1(path1);
Replica replica2(path2);
@@ -342,18 +343,18 @@ TEST(CoordinatorTest, AppendRead)
EXPECT_EQ("hello world", actions.get().front().append().bytes());
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
}
TEST(CoordinatorTest, AppendReadError)
{
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
Replica replica1(path1);
Replica replica2(path2);
@@ -388,8 +389,8 @@ TEST(CoordinatorTest, AppendReadError)
EXPECT_EQ("Bad read range (past end of log)", actions.failure());
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
}
@@ -411,9 +412,9 @@ TEST(CoordinatorTest, AppendReadError)
TEST(CoordinatorTest, DISABLED_ElectNoQuorum)
{
- const std::string path = utils::os::getcwd() + "/.log";
+ const std::string path = os::getcwd() + "/.log";
- utils::os::rmdir(path);
+ os::rmdir(path);
Replica replica(path);
@@ -428,17 +429,17 @@ TEST(CoordinatorTest, DISABLED_ElectNoQu
ASSERT_TRUE(result.isNone());
}
- utils::os::rmdir(path);
+ os::rmdir(path);
}
TEST(CoordinatorTest, DISABLED_AppendNoQuorum)
{
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
Replica replica1(path1);
Replica replica2(path2);
@@ -463,18 +464,18 @@ TEST(CoordinatorTest, DISABLED_AppendNoQ
ASSERT_TRUE(result.isNone());
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
}
TEST(CoordinatorTest, Failover)
{
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
Replica replica1(path1);
Replica replica2(path2);
@@ -525,18 +526,18 @@ TEST(CoordinatorTest, Failover)
EXPECT_EQ("hello world", actions.get().front().append().bytes());
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
}
TEST(CoordinatorTest, Demoted)
{
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
Replica replica1(path1);
Replica replica2(path2);
@@ -600,20 +601,20 @@ TEST(CoordinatorTest, Demoted)
EXPECT_EQ("hello hello", actions.get().front().append().bytes());
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
}
TEST(CoordinatorTest, Fill)
{
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
- const std::string path3 = utils::os::getcwd() + "/.log3";
-
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
- utils::os::rmdir(path3);
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
+ const std::string path3 = os::getcwd() + "/.log3";
+
+ os::rmdir(path1);
+ os::rmdir(path2);
+ os::rmdir(path3);
Replica replica1(path1);
Replica replica2(path2);
@@ -668,9 +669,9 @@ TEST(CoordinatorTest, Fill)
EXPECT_EQ("hello world", actions.get().front().append().bytes());
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
- utils::os::rmdir(path3);
+ os::rmdir(path1);
+ os::rmdir(path2);
+ os::rmdir(path3);
}
@@ -685,13 +686,13 @@ TEST(CoordinatorTest, NotLearnedFill)
EXPECT_MESSAGE(filter, Eq(LearnedMessage().GetTypeName()), _, _)
.WillRepeatedly(Return(true));
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
- const std::string path3 = utils::os::getcwd() + "/.log3";
-
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
- utils::os::rmdir(path3);
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
+ const std::string path3 = os::getcwd() + "/.log3";
+
+ os::rmdir(path1);
+ os::rmdir(path2);
+ os::rmdir(path3);
Replica replica1(path1);
Replica replica2(path2);
@@ -746,9 +747,9 @@ TEST(CoordinatorTest, NotLearnedFill)
EXPECT_EQ("hello world", actions.get().front().append().bytes());
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
- utils::os::rmdir(path3);
+ os::rmdir(path1);
+ os::rmdir(path2);
+ os::rmdir(path3);
process::filter(NULL);
}
@@ -756,11 +757,11 @@ TEST(CoordinatorTest, NotLearnedFill)
TEST(CoordinatorTest, MultipleAppends)
{
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
Replica replica1(path1);
Replica replica2(path2);
@@ -797,8 +798,8 @@ TEST(CoordinatorTest, MultipleAppends)
}
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
}
@@ -813,13 +814,13 @@ TEST(CoordinatorTest, MultipleAppendsNot
EXPECT_MESSAGE(filter, Eq(LearnedMessage().GetTypeName()), _, _)
.WillRepeatedly(Return(true));
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
- const std::string path3 = utils::os::getcwd() + "/.log3";
-
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
- utils::os::rmdir(path3);
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
+ const std::string path3 = os::getcwd() + "/.log3";
+
+ os::rmdir(path1);
+ os::rmdir(path2);
+ os::rmdir(path3);
Replica replica1(path1);
Replica replica2(path2);
@@ -873,9 +874,9 @@ TEST(CoordinatorTest, MultipleAppendsNot
}
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
- utils::os::rmdir(path3);
+ os::rmdir(path1);
+ os::rmdir(path2);
+ os::rmdir(path3);
process::filter(NULL);
}
@@ -883,11 +884,11 @@ TEST(CoordinatorTest, MultipleAppendsNot
TEST(CoordinatorTest, Truncate)
{
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
Replica replica1(path1);
Replica replica2(path2);
@@ -937,8 +938,8 @@ TEST(CoordinatorTest, Truncate)
}
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
}
@@ -953,13 +954,13 @@ TEST(CoordinatorTest, TruncateNotLearned
EXPECT_MESSAGE(filter, Eq(LearnedMessage().GetTypeName()), _, _)
.WillRepeatedly(Return(true));
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
- const std::string path3 = utils::os::getcwd() + "/.log3";
-
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
- utils::os::rmdir(path3);
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
+ const std::string path3 = os::getcwd() + "/.log3";
+
+ os::rmdir(path1);
+ os::rmdir(path2);
+ os::rmdir(path3);
Replica replica1(path1);
Replica replica2(path2);
@@ -1026,9 +1027,9 @@ TEST(CoordinatorTest, TruncateNotLearned
}
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
- utils::os::rmdir(path3);
+ os::rmdir(path1);
+ os::rmdir(path2);
+ os::rmdir(path3);
process::filter(NULL);
}
@@ -1036,13 +1037,13 @@ TEST(CoordinatorTest, TruncateNotLearned
TEST(CoordinatorTest, TruncateLearnedFill)
{
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
- const std::string path3 = utils::os::getcwd() + "/.log3";
-
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
- utils::os::rmdir(path3);
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
+ const std::string path3 = os::getcwd() + "/.log3";
+
+ os::rmdir(path1);
+ os::rmdir(path2);
+ os::rmdir(path3);
Replica replica1(path1);
Replica replica2(path2);
@@ -1109,19 +1110,19 @@ TEST(CoordinatorTest, TruncateLearnedFil
}
}
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
- utils::os::rmdir(path3);
+ os::rmdir(path1);
+ os::rmdir(path2);
+ os::rmdir(path3);
}
TEST(LogTest, WriteRead)
{
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
Replica replica1(path1);
@@ -1146,18 +1147,18 @@ TEST(LogTest, WriteRead)
EXPECT_EQ(position.get(), entries.get().front().position);
EXPECT_EQ("hello world", entries.get().front().data);
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
}
TEST(LogTest, Position)
{
- const std::string path1 = utils::os::getcwd() + "/.log1";
- const std::string path2 = utils::os::getcwd() + "/.log2";
+ const std::string path1 = os::getcwd() + "/.log1";
+ const std::string path2 = os::getcwd() + "/.log2";
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
Replica replica1(path1);
@@ -1174,8 +1175,8 @@ TEST(LogTest, Position)
ASSERT_EQ(position.get(), log.position(position.get().identity()));
- utils::os::rmdir(path1);
- utils::os::rmdir(path2);
+ os::rmdir(path1);
+ os::rmdir(path2);
}
Modified: incubator/mesos/trunk/src/tests/main.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/main.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/main.cpp (original)
+++ incubator/mesos/trunk/src/tests/main.cpp Thu Jul 12 20:46:50 2012
@@ -22,7 +22,7 @@
#include <process/process.hpp>
-#include "common/utils.hpp"
+#include <stout/os.hpp>
#include "configurator/configuration.hpp"
#include "configurator/configurator.hpp"
@@ -49,14 +49,14 @@ using std::string;
static bool shouldRun(const std::string& name)
{
if (strings::contains(name, "ROOT") &&
- utils::os::user() != "root") {
+ os::user() != "root") {
return false;
}
// TODO(jieyu): Replace the cgroups check with cgroups::enabled() once the
// cgroups module is checked in.
if (strings::contains(name, "CGROUPS") &&
- !utils::os::exists("/proc/cgroups")) {
+ !os::exists("/proc/cgroups")) {
return false;
}
@@ -116,7 +116,7 @@ static void setupFilter()
void usage(const char* argv0, const Configurator& configurator)
{
- cerr << "Usage: " << utils::os::basename(argv0) << " [...]" << endl
+ cerr << "Usage: " << os::basename(argv0) << " [...]" << endl
<< endl
<< "Supported options:" << endl
<< configurator.getUsage();
@@ -179,14 +179,14 @@ int main(int argc, char** argv)
testing::FLAGS_gtest_death_test_style = "threadsafe";
// Get the absolute path to the source (i.e., root) directory.
- Try<string> path = utils::os::realpath(SOURCE_DIR);
+ Try<string> path = os::realpath(SOURCE_DIR);
CHECK(path.isSome()) << "Error getting source directory " << path.error();
mesosSourceDirectory = path.get();
std::cout << "Source directory: " << mesosSourceDirectory << std::endl;
// Get absolute path to the build directory.
- path = utils::os::realpath(BUILD_DIR);
+ path = os::realpath(BUILD_DIR);
CHECK(path.isSome()) << "Error getting build directory " << path.error();
mesosBuildDirectory = path.get();
Modified: incubator/mesos/trunk/src/tests/master_detector_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/master_detector_tests.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/master_detector_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/master_detector_tests.cpp Thu Jul 12 20:46:50 2012
@@ -26,7 +26,8 @@
#include <mesos/executor.hpp>
#include <mesos/scheduler.hpp>
-#include "common/try.hpp"
+#include <stout/os.hpp>
+#include <stout/try.hpp>
#include "detector/detector.hpp"
@@ -87,7 +88,7 @@ TEST(MasterDetector, File)
Try<MasterDetector*> detector2 =
MasterDetector::create("file://" + path, slave, false, true);
- utils::os::rm(path);
+ os::rm(path);
ASSERT_TRUE(detector2.isSome());
Modified: incubator/mesos/trunk/src/tests/master_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/master_tests.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/master_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/master_tests.cpp Thu Jul 12 20:46:50 2012
@@ -22,6 +22,8 @@
#include <mesos/executor.hpp>
#include <mesos/scheduler.hpp>
+#include <stout/os.hpp>
+
#include "detector/detector.hpp"
#include "local/local.hpp"
@@ -669,7 +671,7 @@ protected:
virtual ~WhitelistFixture()
{
- utils::os::rm(path);
+ os::rm(path);
}
const string path;
@@ -687,10 +689,10 @@ TEST_F(WhitelistFixture, WhitelistSlave)
.WillRepeatedly(Return(false));
// Add some hosts to the white list.
- Try<string> hostname = utils::os::hostname();
+ Try<string> hostname = os::hostname();
ASSERT_TRUE(hostname.isSome());
string hosts = hostname.get() + "\n" + "dummy-slave";
- CHECK (utils::os::write(path, hosts).isSome()) << "Error writing whitelist";
+ CHECK (os::write(path, hosts).isSome()) << "Error writing whitelist";
DominantShareAllocator a;
flags::Flags<logging::Flags, master::Flags> flags;
Modified: incubator/mesos/trunk/src/tests/multihashmap_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/multihashmap_tests.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/multihashmap_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/multihashmap_tests.cpp Thu Jul 12 20:46:50 2012
@@ -20,8 +20,8 @@
#include <string>
-#include "common/foreach.hpp"
-#include "common/multihashmap.hpp"
+#include <stout/foreach.hpp>
+#include <stout/multihashmap.hpp>
using std::string;
Modified: incubator/mesos/trunk/src/tests/proc_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/proc_tests.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/proc_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/proc_tests.cpp Thu Jul 12 20:46:50 2012
@@ -22,7 +22,7 @@
#include <set>
-#include "common/try.hpp"
+#include <stout/try.hpp>
#include "linux/proc.hpp"
Modified: incubator/mesos/trunk/src/tests/protobuf_io_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/protobuf_io_tests.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/protobuf_io_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/protobuf_io_tests.cpp Thu Jul 12 20:46:50 2012
@@ -20,7 +20,9 @@
#include <gmock/gmock.h>
-#include "common/utils.hpp"
+#include <stout/os.hpp>
+#include <stout/protobuf.hpp>
+
#include "common/type_utils.hpp"
#include "messages/messages.hpp"
@@ -33,14 +35,14 @@ TEST(ProtobufIOTest, Basic)
{
const std::string file = ".protobuf_io_test_basic";
- Try<int> result = utils::os::open(file, O_CREAT | O_WRONLY | O_SYNC,
- S_IRUSR | S_IWUSR | S_IRGRP | S_IRWXO);
+ Try<int> result = os::open(file, O_CREAT | O_WRONLY | O_SYNC,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IRWXO);
ASSERT_TRUE(result.isSome());
int fdw = result.get();
- result = utils::os::open(file, O_CREAT | O_RDONLY,
- S_IRUSR | S_IWUSR | S_IRGRP | S_IRWXO);
+ result = os::open(file, O_CREAT | O_RDONLY,
+ S_IRUSR | S_IWUSR | S_IRGRP | S_IRWXO);
ASSERT_TRUE(result.isSome());
int fdr = result.get();
@@ -50,21 +52,21 @@ TEST(ProtobufIOTest, Basic)
for (int i = 0; i < writes; i++) {
FrameworkID frameworkId;
frameworkId.set_value(stringify(i));
- Try<bool> result = utils::protobuf::write(fdw, frameworkId);
+ Try<bool> result = protobuf::write(fdw, frameworkId);
ASSERT_TRUE(result.isSome());
EXPECT_TRUE(result.get());
}
for (int i = 0; i < writes; i++) {
FrameworkID frameworkId;
- Result<bool> result = utils::protobuf::read(fdr, &frameworkId);
+ Result<bool> result = protobuf::read(fdr, &frameworkId);
ASSERT_TRUE(result.isSome());
EXPECT_TRUE(result.get());
EXPECT_EQ(frameworkId.value(), stringify(i));
}
- utils::os::close(fdw);
- utils::os::close(fdr);
+ os::close(fdw);
+ os::close(fdr);
- utils::os::rm(file);
+ os::rm(file);
}
Modified: incubator/mesos/trunk/src/tests/slave_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/slave_tests.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/slave_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/slave_tests.cpp Thu Jul 12 20:46:50 2012
@@ -24,7 +24,8 @@
#include <process/dispatch.hpp>
#include <process/future.hpp>
-#include "common/time.hpp"
+#include <stout/os.hpp>
+#include <stout/time.hpp>
#include "detector/detector.hpp"
@@ -109,7 +110,7 @@ protected:
process::filter(NULL);
- utils::os::rmdir(flags.work_dir);
+ os::rmdir(flags.work_dir);
}
void startSlave()
@@ -236,7 +237,7 @@ TEST_F(SlaveTest, GarbageCollectSlaveDir
// Make sure directory exists.
const std::string& slaveDir = flags.work_dir + "/slaves/" + slaveId.value();
- ASSERT_TRUE(utils::os::exists(slaveDir));
+ ASSERT_TRUE(os::exists(slaveDir));
Clock::pause();
@@ -265,8 +266,8 @@ TEST_F(SlaveTest, GarbageCollectSlaveDir
// By this time the old slave directory should be cleaned up and
// the new directory should exist.
- ASSERT_FALSE(utils::os::exists(slaveDir));
- ASSERT_TRUE(utils::os::exists(flags.work_dir + "/slaves/" +
+ ASSERT_FALSE(os::exists(slaveDir));
+ ASSERT_TRUE(os::exists(flags.work_dir + "/slaves/" +
slaveId2.value()));
Clock::resume();
@@ -309,7 +310,7 @@ TEST_F(SlaveTest, GarbageCollectExecutor
const std::string executorDir =
isolationModule->directories[DEFAULT_EXECUTOR_ID];
- ASSERT_TRUE(utils::os::exists(executorDir));
+ ASSERT_TRUE(os::exists(executorDir));
statusUpdateCall.value = false;
resourceOffersCall.value = false;
@@ -342,7 +343,7 @@ TEST_F(SlaveTest, GarbageCollectExecutor
WAIT_UNTIL(statusUpdateCall); // TASK_LOST
// First executor's directory should be gced by now.
- ASSERT_FALSE(utils::os::exists(executorDir));
+ ASSERT_FALSE(os::exists(executorDir));
Clock::resume();
Modified: incubator/mesos/trunk/src/tests/state_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/state_tests.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/state_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/state_tests.cpp Thu Jul 12 20:46:50 2012
@@ -26,9 +26,10 @@
#include <process/future.hpp>
#include <process/protobuf.hpp>
-#include "common/option.hpp"
+#include <stout/option.hpp>
+#include <stout/os.hpp>
+
#include "common/type_utils.hpp"
-#include "common/utils.hpp"
#include "messages/messages.hpp"
@@ -198,19 +199,19 @@ class LevelDBStateTest : public ::testin
{
public:
LevelDBStateTest()
- : state(NULL), path(utils::os::getcwd() + "/.state") {}
+ : state(NULL), path(os::getcwd() + "/.state") {}
protected:
virtual void SetUp()
{
- utils::os::rmdir(path);
+ os::rmdir(path);
state = new LevelDBState(path);
}
virtual void TearDown()
{
delete state;
- utils::os::rmdir(path);
+ os::rmdir(path);
}
State* state;
Modified: incubator/mesos/trunk/src/tests/utils.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/utils.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/utils.hpp (original)
+++ incubator/mesos/trunk/src/tests/utils.hpp Thu Jul 12 20:46:50 2012
@@ -31,9 +31,10 @@
#include <process/process.hpp>
-#include "common/option.hpp"
+#include <stout/option.hpp>
+#include <stout/os.hpp>
+
#include "common/type_utils.hpp"
-#include "common/utils.hpp"
#include "master/master.hpp"
@@ -461,19 +462,19 @@ public:
directories[executorInfo.executor_id()] = directory;
- utils::os::setenv("MESOS_LOCAL", "1");
- utils::os::setenv("MESOS_DIRECTORY", directory);
- utils::os::setenv("MESOS_SLAVE_PID", slave);
- utils::os::setenv("MESOS_FRAMEWORK_ID", frameworkId.value());
- utils::os::setenv("MESOS_EXECUTOR_ID", executorInfo.executor_id().value());
+ os::setenv("MESOS_LOCAL", "1");
+ os::setenv("MESOS_DIRECTORY", directory);
+ os::setenv("MESOS_SLAVE_PID", slave);
+ os::setenv("MESOS_FRAMEWORK_ID", frameworkId.value());
+ os::setenv("MESOS_EXECUTOR_ID", executorInfo.executor_id().value());
driver->start();
- utils::os::unsetenv("MESOS_LOCAL");
- utils::os::unsetenv("MESOS_DIRECTORY");
- utils::os::unsetenv("MESOS_SLAVE_PID");
- utils::os::unsetenv("MESOS_FRAMEWORK_ID");
- utils::os::unsetenv("MESOS_EXECUTOR_ID");
+ os::unsetenv("MESOS_LOCAL");
+ os::unsetenv("MESOS_DIRECTORY");
+ os::unsetenv("MESOS_SLAVE_PID");
+ os::unsetenv("MESOS_FRAMEWORK_ID");
+ os::unsetenv("MESOS_EXECUTOR_ID");
} else {
FAIL() << "Cannot launch executor";
}
Modified: incubator/mesos/trunk/src/tests/values_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/values_tests.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/values_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/values_tests.cpp Thu Jul 12 20:46:50 2012
@@ -21,8 +21,10 @@
#include <gtest/gtest.h>
-#include "common/try.hpp"
+#include <stout/try.hpp>
+
#include "common/values.hpp"
+
#include "master/master.hpp"
using namespace mesos;
@@ -83,4 +85,4 @@ TEST(ValuesTest, InvalidInput)
// Test when giving empty string.
Try<Value> result6 = parse(" ");
ASSERT_TRUE(result6.isError());
-}
\ No newline at end of file
+}
Modified: incubator/mesos/trunk/src/tests/zookeeper_server.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/zookeeper_server.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/zookeeper_server.cpp (original)
+++ incubator/mesos/trunk/src/tests/zookeeper_server.cpp Thu Jul 12 20:46:50 2012
@@ -24,8 +24,7 @@
#include <sstream>
#include <vector>
-#include "common/utils.hpp"
-#include "common/uuid.hpp"
+#include <stout/uuid.hpp>
#include "jvm/jvm.hpp"
Modified: incubator/mesos/trunk/src/tests/zookeeper_server.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/zookeeper_server.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/zookeeper_server.hpp (original)
+++ incubator/mesos/trunk/src/tests/zookeeper_server.hpp Thu Jul 12 20:46:50 2012
@@ -23,7 +23,7 @@
#include <glog/logging.h>
-#include "common/utils.hpp"
+#include <stout/os.hpp>
#include "jvm/jvm.hpp"
@@ -73,7 +73,7 @@ private:
~TemporaryDirectory()
{
jvm->deleteGlobalRef(file);
- if (!utils::os::rmdir(path)) {
+ if (!os::rmdir(path)) {
LOG(WARNING) << "Failed to delete temp dir: " << path;
}
}
Modified: incubator/mesos/trunk/src/tests/zookeeper_url_tests.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/tests/zookeeper_url_tests.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/tests/zookeeper_url_tests.cpp (original)
+++ incubator/mesos/trunk/src/tests/zookeeper_url_tests.cpp Thu Jul 12 20:46:50 2012
@@ -18,7 +18,7 @@
#include <gtest/gtest.h>
-#include "common/try.hpp"
+#include <stout/try.hpp>
#include "zookeeper/url.hpp"
Modified: incubator/mesos/trunk/src/webui/webui.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/webui/webui.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/webui/webui.cpp (original)
+++ incubator/mesos/trunk/src/webui/webui.cpp Thu Jul 12 20:46:50 2012
@@ -1,6 +1,5 @@
#ifdef MESOS_WEBUI
-#include <Python.h>
#include <unistd.h>
#include <sys/types.h>
@@ -8,12 +7,19 @@
#include <tr1/functional>
-#include "common/strings.hpp"
+#include <stout/os.hpp>
+#include <stout/path.hpp>
+#include <stout/strings.hpp>
+
#include "common/thread.hpp"
-#include "common/utils.hpp"
#include "webui/webui.hpp"
+// TODO(jieyu): We put this include here so that we don't get complaint from
+// fts.h: "<fts.h> cannot be used with -D_FILE_OFFSET_BITS==64". We don't use
+// any of the function defined in fts.h in this file.
+#include <Python.h>
+
namespace mesos {
namespace internal {
namespace webui {
@@ -23,7 +29,7 @@ static void run(const std::string& direc
const std::vector<std::string>& args)
{
// Setup the Python interpreter and load the script.
- std::string path = utils::path::join(directory, script);
+ std::string path = path::join(directory, script);
Py_Initialize();
@@ -41,8 +47,8 @@ static void run(const std::string& direc
// Run some code to setup PATH and add webui_dir as a variable.
std::string code =
"import sys\n"
- "sys.path.append('" + utils::path::join(directory, "common") + "')\n"
- "sys.path.append('" + utils::path::join(directory, "bottle-0.8.3") + "')\n";
+ "sys.path.append('" + path::join(directory, "common") + "')\n"
+ "sys.path.append('" + path::join(directory, "bottle-0.8.3") + "')\n";
PyRun_SimpleString(code.c_str());
@@ -77,9 +83,9 @@ void start(const std::string& directory,
<< "Expecting relative path for webui script (relative to 'webui_dir')";
// Make sure directory/script exists.
- std::string path = utils::path::join(directory, script);
+ std::string path = path::join(directory, script);
- CHECK(utils::os::exists(path))
+ CHECK(os::exists(path))
<< "Failed to find webui script at '" << path << "'";
// TODO(benh): Consider actually forking a process for the webui
Modified: incubator/mesos/trunk/src/zookeeper/group.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/zookeeper/group.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/zookeeper/group.cpp (original)
+++ incubator/mesos/trunk/src/zookeeper/group.cpp Thu Jul 12 20:46:50 2012
@@ -8,9 +8,11 @@
#include <process/dispatch.hpp>
#include <process/process.hpp>
-#include "common/result.hpp"
-#include "common/strings.hpp"
-#include "common/utils.hpp"
+#include <stout/numify.hpp>
+#include <stout/os.hpp>
+#include <stout/result.hpp>
+#include <stout/strings.hpp>
+#include <stout/utils.hpp>
#include "zookeeper/authentication.hpp"
#include "zookeeper/group.hpp"
@@ -19,8 +21,6 @@
using namespace process;
-namespace utils = mesos::internal::utils; // TODO(benh): Pull utils out.
-
using process::wait; // Necessary on some OS's to disambiguate.
using std::make_pair;
@@ -556,9 +556,9 @@ Result<Group::Membership> GroupProcess::
// Save the sequence number but only grab the basename. Example:
// "/path/to/znode/0000000131" => "0000000131".
- result = utils::os::basename(result);
+ result = os::basename(result);
- Try<uint64_t> sequence = utils::numify<uint64_t>(result);
+ Try<uint64_t> sequence = numify<uint64_t>(result);
CHECK(sequence.isSome()) << sequence.error();
Promise<bool>* cancelled = new Promise<bool>();
@@ -673,7 +673,7 @@ bool GroupProcess::cache()
set<uint64_t> sequences;
foreach (const string& result, results) {
- Try<uint64_t> sequence = utils::numify<uint64_t>(result);
+ Try<uint64_t> sequence = numify<uint64_t>(result);
// Skip it if it couldn't be converted to a number.
if (sequence.isError()) {
Modified: incubator/mesos/trunk/src/zookeeper/group.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/zookeeper/group.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/zookeeper/group.hpp (original)
+++ incubator/mesos/trunk/src/zookeeper/group.hpp Thu Jul 12 20:46:50 2012
@@ -4,9 +4,9 @@
#include <set>
#include "process/future.hpp"
-#include "process/option.hpp"
-#include "common/time.hpp"
+#include <stout/option.hpp>
+#include <stout/time.hpp>
#include "zookeeper/authentication.hpp"
Modified: incubator/mesos/trunk/src/zookeeper/url.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/zookeeper/url.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/zookeeper/url.hpp (original)
+++ incubator/mesos/trunk/src/zookeeper/url.hpp Thu Jul 12 20:46:50 2012
@@ -21,9 +21,9 @@
#include <string>
-#include "common/option.hpp"
-#include "common/strings.hpp"
-#include "common/try.hpp"
+#include <stout/option.hpp>
+#include <stout/strings.hpp>
+#include <stout/try.hpp>
#include "zookeeper/authentication.hpp"
Modified: incubator/mesos/trunk/src/zookeeper/zookeeper.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/zookeeper/zookeeper.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/zookeeper/zookeeper.cpp (original)
+++ incubator/mesos/trunk/src/zookeeper/zookeeper.cpp Thu Jul 12 20:46:50 2012
@@ -26,7 +26,7 @@
#include <process/dispatch.hpp>
#include <process/process.hpp>
-#include "common/fatal.hpp"
+#include <stout/fatal.hpp>
#include "zookeeper/zookeeper.hpp"
Modified: incubator/mesos/trunk/src/zookeeper/zookeeper.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/zookeeper/zookeeper.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/src/zookeeper/zookeeper.hpp (original)
+++ incubator/mesos/trunk/src/zookeeper/zookeeper.hpp Thu Jul 12 20:46:50 2012
@@ -31,7 +31,7 @@
#include <string>
#include <vector>
-#include "common/time.hpp"
+#include <stout/time.hpp>
/* Forward declarations of classes we are using. */
Modified: incubator/mesos/trunk/third_party/libprocess/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/Makefile.am?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/Makefile.am (original)
+++ incubator/mesos/trunk/third_party/libprocess/Makefile.am Thu Jul 12 20:46:50 2012
@@ -26,8 +26,8 @@ noinst_LTLIBRARIES = libprocess.la
libprocess_la_SOURCES = src/process.cpp src/pid.cpp src/latch.cpp \
src/tokenize.cpp src/config.hpp src/decoder.hpp \
- src/encoder.hpp src/foreach.hpp src/gate.hpp \
- src/synchronized.hpp src/tokenize.hpp
+ src/encoder.hpp src/gate.hpp src/synchronized.hpp \
+ src/tokenize.hpp
libprocess_la_CPPFLAGS = -I$(srcdir)/include -I$(BOOST) -I$(GLOG)/src \
-I$(RY_HTTP_PARSER) -I$(LIBEV) $(AM_CPPFLAGS)
@@ -56,7 +56,6 @@ libprocess_la_SOURCES += $(top_srcdir)/i
$(top_srcdir)/include/process/mime.hpp \
$(top_srcdir)/include/process/nothing.hpp \
$(top_srcdir)/include/process/once.hpp \
- $(top_srcdir)/include/process/option.hpp \
$(top_srcdir)/include/process/pid.hpp \
$(top_srcdir)/include/process/preprocessor.hpp \
$(top_srcdir)/include/process/process.hpp \
@@ -76,6 +75,7 @@ libprocess_la_SOURCES += $(top_srcdir)/i
$(top_srcdir)/include/stout/lambda.hpp \
$(top_srcdir)/include/stout/multihashmap.hpp \
$(top_srcdir)/include/stout/net.hpp \
+ $(top_srcdir)/include/stout/numify.hpp \
$(top_srcdir)/include/stout/option.hpp \
$(top_srcdir)/include/stout/os.hpp \
$(top_srcdir)/include/stout/protobuf.hpp \
@@ -84,6 +84,7 @@ libprocess_la_SOURCES += $(top_srcdir)/i
$(top_srcdir)/include/stout/time.hpp \
$(top_srcdir)/include/stout/timer.hpp \
$(top_srcdir)/include/stout/try.hpp \
+ $(top_srcdir)/include/stout/utils.hpp \
$(top_srcdir)/include/stout/uuid.hpp
@@ -95,4 +96,4 @@ tests_CPPFLAGS = -I$(GTEST)/include -I$(
$(libprocess_la_CPPFLAGS)
tests_LDADD = third_party/libgmock.la libprocess.la
-# TODO(benh): Fix shared builds (tests need libglog, libev, etc).
\ No newline at end of file
+# TODO(benh): Fix shared builds (tests need libglog, libev, etc).
Modified: incubator/mesos/trunk/third_party/libprocess/include/process/collect.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/process/collect.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/process/collect.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/process/collect.hpp Thu Jul 12 20:46:50 2012
@@ -8,10 +8,11 @@
#include <process/defer.hpp>
#include <process/delay.hpp>
#include <process/future.hpp>
-#include <process/option.hpp>
#include <process/process.hpp>
#include <process/timeout.hpp>
+#include <stout/option.hpp>
+
namespace process {
// Waits on each future in the specified set and returns the set of
Modified: incubator/mesos/trunk/third_party/libprocess/include/process/future.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/process/future.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/process/future.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/process/future.hpp Thu Jul 12 20:46:50 2012
@@ -11,7 +11,8 @@
#include <tr1/memory> // TODO(benh): Replace shared_ptr with unique_ptr.
#include <process/latch.hpp>
-#include <process/option.hpp>
+
+#include <stout/option.hpp>
namespace process {
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/cache.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/cache.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/cache.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/cache.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_CACHE_HPP__
#define __STOUT_CACHE_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/fatal.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/fatal.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/fatal.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/fatal.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_FATAL_HPP__
#define __STOUT_FATAL_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/foreach.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/foreach.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/foreach.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/foreach.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_FOREACH_HPP__
#define __STOUT_FOREACH_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/format.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/format.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/format.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/format.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_FORMAT_HPP__
#define __STOUT_FORMAT_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/hashmap.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/hashmap.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/hashmap.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/hashmap.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_HASHMAP_HPP__
#define __STOUT_HASHMAP_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/hashset.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/hashset.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/hashset.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/hashset.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_HASHSET_HPP__
#define __STOUT_HASHSET_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/json.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/json.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/json.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/json.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_JSON__
#define __STOUT_JSON__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/lambda.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/lambda.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/lambda.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/lambda.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_LAMBDA_HPP__
#define __STOUT_LAMBDA_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/multihashmap.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/multihashmap.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/multihashmap.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/multihashmap.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_MULTIHASHMAP_HPP__
#define __STOUT_MULTIHASHMAP_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/net.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/net.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/net.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/net.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_NET_HPP__
#define __STOUT_NET_HPP__
Added: incubator/mesos/trunk/third_party/libprocess/include/stout/numify.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/numify.hpp?rev=1360924&view=auto
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/numify.hpp (added)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/numify.hpp Thu Jul 12 20:46:50 2012
@@ -0,0 +1,26 @@
+#ifndef __STOUT_NUMIFY_HPP__
+#define __STOUT_NUMIFY_HPP__
+
+#include <glog/logging.h>
+
+#include <string>
+
+#include <boost/lexical_cast.hpp>
+
+#include "format.hpp"
+#include "try.hpp"
+
+template <typename T>
+Try<T> numify(const std::string& s)
+{
+ try {
+ return boost::lexical_cast<T>(s);
+ } catch (const boost::bad_lexical_cast&) {
+ const Try<std::string>& message =
+ strings::format("Failed to convert '%s' to number", s);
+ CHECK(message.isSome());
+ return Try<T>::error(message.get());
+ }
+}
+
+#endif // __STOUT_NUMIFY_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/option.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/option.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/option.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/option.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_OPTION_HPP__
#define __STOUT_OPTION_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/os.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/os.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/os.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/os.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_OS_HPP__
#define __STOUT_OS_HPP__
Added: incubator/mesos/trunk/third_party/libprocess/include/stout/path.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/path.hpp?rev=1360924&view=auto
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/path.hpp (added)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/path.hpp Thu Jul 12 20:46:50 2012
@@ -0,0 +1,21 @@
+#ifndef __STOUT_PATH_HPP__
+#define __STOUT_PATH_HPP__
+
+#include <string>
+
+#include "strings.hpp"
+
+namespace path {
+
+inline std::string join(const std::string& path1, const std::string& path2)
+{
+ return
+ strings::remove(path1, "/", strings::SUFFIX) + "/" +
+ strings::remove(path2, "/", strings::PREFIX);
+}
+
+// TODO(benh): Provide implementations for more than two paths.
+
+} // namespace path {
+
+#endif // __STOUT_PATH_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/protobuf.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/protobuf.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/protobuf.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/protobuf.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_PROTOBUF_HPP__
#define __STOUT_PROTOBUF_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/result.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/result.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/result.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/result.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_RESULT_HPP__
#define __STOUT_RESULT_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/stringify.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/stringify.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/stringify.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/stringify.hpp Thu Jul 12 20:46:50 2012
@@ -1,24 +1,8 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_STRINGIFY_HPP__
#define __STOUT_STRINGIFY_HPP__
+#include <stdlib.h>
+
#include <iostream> // For 'std::cerr' and 'std::endl'.
#include <list>
#include <map>
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/strings.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/strings.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/strings.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/strings.hpp Thu Jul 12 20:46:50 2012
@@ -1,30 +1,13 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_STRINGS_HPP__
#define __STOUT_STRINGS_HPP__
+#include <algorithm>
#include <string>
#include <map>
#include <vector>
#include "foreach.hpp"
-#include "format.hpp" // TODO(benh): Include format.hpp explicitly.
+#include "format.hpp"
namespace strings {
@@ -168,6 +151,22 @@ inline bool contains(const std::string&
}
+inline std::string lower(const std::string& s)
+{
+ std::string result = s;
+ std::transform(result.begin(), result.end(), result.begin(), ::tolower);
+ return result;
+}
+
+
+inline std::string upper(const std::string& s)
+{
+ std::string result = s;
+ std::transform(result.begin(), result.end(), result.begin(), ::toupper);
+ return result;
+}
+
+
} // namespaces strings {
#endif // __STOUT_STRINGS_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/time.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/time.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/time.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/time.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_TIME_HPP__
#define __STOUT_TIME_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/timer.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/timer.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/timer.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/timer.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_TIMER_HPP__
#define __STOUT_TIMER_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/try.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/try.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/try.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/try.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_TRY_HPP__
#define __STOUT_TRY_HPP__
Added: incubator/mesos/trunk/third_party/libprocess/include/stout/utils.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/utils.hpp?rev=1360924&view=auto
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/utils.hpp (added)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/utils.hpp Thu Jul 12 20:46:50 2012
@@ -0,0 +1,11 @@
+#ifndef __STOUT_UTILS_HPP__
+#define __STOUT_UTILS_HPP__
+
+namespace utils {
+
+template <typename T>
+T copy(const T& t) { return t; }
+
+} // namespace utils {
+
+#endif // __STOUT_UTILS_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/uuid.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/uuid.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/uuid.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/uuid.hpp Thu Jul 12 20:46:50 2012
@@ -1,21 +1,3 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
#ifndef __STOUT_UUID_HPP__
#define __STOUT_UUID_HPP__
@@ -28,7 +10,6 @@
#include <boost/uuid/uuid_io.hpp>
#include <boost/uuid/uuid_generators.hpp>
-
struct UUID : boost::uuids::uuid
{
public:
@@ -70,5 +51,4 @@ private:
: boost::uuids::uuid(uuid) {}
};
-
#endif // __STOUT_UUID_HPP__
Modified: incubator/mesos/trunk/third_party/libprocess/src/decoder.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/src/decoder.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/src/decoder.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/src/decoder.hpp Thu Jul 12 20:46:50 2012
@@ -10,7 +10,7 @@
#include <process/http.hpp>
#include <process/socket.hpp>
-#include "foreach.hpp"
+#include <stout/foreach.hpp>
namespace process {
Modified: incubator/mesos/trunk/third_party/libprocess/src/encoder.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/src/encoder.hpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/src/encoder.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/src/encoder.hpp Thu Jul 12 20:46:50 2012
@@ -8,7 +8,7 @@
#include <process/http.hpp>
#include <process/process.hpp>
-#include "foreach.hpp"
+#include <stout/foreach.hpp>
namespace process {
Modified: incubator/mesos/trunk/third_party/libprocess/src/process.cpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/src/process.cpp?rev=1360924&r1=1360923&r2=1360924&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/src/process.cpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/src/process.cpp Thu Jul 12 20:46:50 2012
@@ -60,10 +60,12 @@
#include <process/thread.hpp>
#include <process/timer.hpp>
+#include <stout/foreach.hpp>
+#include <stout/lambda.hpp>
+
#include "config.hpp"
#include "decoder.hpp"
#include "encoder.hpp"
-#include "foreach.hpp"
#include "gate.hpp"
#include "synchronized.hpp"
#include "tokenize.hpp"
@@ -90,16 +92,6 @@ using std::string;
using std::stringstream;
using std::vector;
-// We wrap some of the functional std::tr1 symbols in the 'lambda'
-// namespace to make code less verbose.
-namespace lambda {
-
-using std::tr1::bind;
-using std::tr1::function;
-using namespace std::tr1::placeholders;
-
-} // namespace lambda {
-
template <int i>
std::ostream& fixedprecision(std::ostream& os)