You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2016/03/22 22:56:33 UTC
mesos git commit: Fixed right angle brackets in state APIs.
Repository: mesos
Updated Branches:
refs/heads/master 6857d8ae7 -> 9c97c787a
Fixed right angle brackets in state APIs.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/9c97c787
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/9c97c787
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/9c97c787
Branch: refs/heads/master
Commit: 9c97c787a760ba7e02475bf84bbb35343c561f51
Parents: 6857d8a
Author: Jie Yu <yu...@gmail.com>
Authored: Tue Mar 22 14:55:50 2016 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Tue Mar 22 14:55:50 2016 -0700
----------------------------------------------------------------------
src/state/in_memory.cpp | 4 ++--
src/state/in_memory.hpp | 4 ++--
src/state/leveldb.cpp | 22 +++++++++++-----------
src/state/leveldb.hpp | 4 ++--
src/state/log.cpp | 22 +++++++++++-----------
src/state/log.hpp | 4 ++--
src/state/protobuf.hpp | 16 ++++++++--------
src/state/state.hpp | 12 ++++++------
src/state/storage.hpp | 4 ++--
src/state/zookeeper.cpp | 32 ++++++++++++++++----------------
src/state/zookeeper.hpp | 4 ++--
11 files changed, 64 insertions(+), 64 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/9c97c787/src/state/in_memory.cpp
----------------------------------------------------------------------
diff --git a/src/state/in_memory.cpp b/src/state/in_memory.cpp
index c6d9c64..ac4f34b 100644
--- a/src/state/in_memory.cpp
+++ b/src/state/in_memory.cpp
@@ -104,7 +104,7 @@ InMemoryStorage::~InMemoryStorage()
}
-Future<Option<Entry> > InMemoryStorage::get(const string& name)
+Future<Option<Entry>> InMemoryStorage::get(const string& name)
{
return dispatch(process, &InMemoryStorageProcess::get, name);
}
@@ -122,7 +122,7 @@ Future<bool> InMemoryStorage::expunge(const Entry& entry)
}
-Future<std::set<string> > InMemoryStorage::names()
+Future<std::set<string>> InMemoryStorage::names()
{
return dispatch(process, &InMemoryStorageProcess::names);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/9c97c787/src/state/in_memory.hpp
----------------------------------------------------------------------
diff --git a/src/state/in_memory.hpp b/src/state/in_memory.hpp
index 855a93f..28ad761 100644
--- a/src/state/in_memory.hpp
+++ b/src/state/in_memory.hpp
@@ -44,10 +44,10 @@ public:
virtual ~InMemoryStorage();
// Storage implementation.
- virtual process::Future<Option<Entry> > get(const std::string& name);
+ virtual process::Future<Option<Entry>> get(const std::string& name);
virtual process::Future<bool> set(const Entry& entry, const UUID& uuid);
virtual process::Future<bool> expunge(const Entry& entry);
- virtual process::Future<std::set<std::string> > names();
+ virtual process::Future<std::set<std::string>> names();
private:
InMemoryStorageProcess* process;
http://git-wip-us.apache.org/repos/asf/mesos/blob/9c97c787/src/state/leveldb.cpp
----------------------------------------------------------------------
diff --git a/src/state/leveldb.cpp b/src/state/leveldb.cpp
index 4988aa1..f925a73 100644
--- a/src/state/leveldb.cpp
+++ b/src/state/leveldb.cpp
@@ -61,14 +61,14 @@ public:
virtual void initialize();
// Storage implementation.
- Future<Option<Entry> > get(const string& name);
+ Future<Option<Entry>> get(const string& name);
Future<bool> set(const Entry& entry, const UUID& uuid);
Future<bool> expunge(const Entry& entry);
- Future<std::set<string> > names();
+ Future<std::set<string>> names();
private:
// Helpers for interacting with leveldb.
- Try<Option<Entry> > read(const string& name);
+ Try<Option<Entry>> read(const string& name);
Try<bool> write(const Entry& entry);
const string path;
@@ -105,7 +105,7 @@ void LevelDBStorageProcess::initialize()
}
-Future<std::set<string> > LevelDBStorageProcess::names()
+Future<std::set<string>> LevelDBStorageProcess::names()
{
if (error.isSome()) {
return Failure(error.get());
@@ -128,13 +128,13 @@ Future<std::set<string> > LevelDBStorageProcess::names()
}
-Future<Option<Entry> > LevelDBStorageProcess::get(const string& name)
+Future<Option<Entry>> LevelDBStorageProcess::get(const string& name)
{
if (error.isSome()) {
return Failure(error.get());
}
- Try<Option<Entry> > option = read(name);
+ Try<Option<Entry>> option = read(name);
if (option.isError()) {
return Failure(option.error());
@@ -153,7 +153,7 @@ Future<bool> LevelDBStorageProcess::set(const Entry& entry, const UUID& uuid)
// We do a read first to make sure the version has not changed. This
// could be optimized in the future, for now it will probably hit
// the cache anyway.
- Try<Option<Entry> > option = read(entry.name());
+ Try<Option<Entry>> option = read(entry.name());
if (option.isError()) {
return Failure(option.error());
@@ -188,7 +188,7 @@ Future<bool> LevelDBStorageProcess::expunge(const Entry& entry)
// We do a read first to make sure the version has not changed. This
// could be optimized in the future, for now it will probably hit
// the cache anyway.
- Try<Option<Entry> > option = read(entry.name());
+ Try<Option<Entry>> option = read(entry.name());
if (option.isError()) {
return Failure(option.error());
@@ -220,7 +220,7 @@ Future<bool> LevelDBStorageProcess::expunge(const Entry& entry)
}
-Try<Option<Entry> > LevelDBStorageProcess::read(const string& name)
+Try<Option<Entry>> LevelDBStorageProcess::read(const string& name)
{
CHECK_NONE(error);
@@ -286,7 +286,7 @@ LevelDBStorage::~LevelDBStorage()
}
-Future<Option<Entry> > LevelDBStorage::get(const string& name)
+Future<Option<Entry>> LevelDBStorage::get(const string& name)
{
return dispatch(process, &LevelDBStorageProcess::get, name);
}
@@ -304,7 +304,7 @@ Future<bool> LevelDBStorage::expunge(const Entry& entry)
}
-Future<std::set<string> > LevelDBStorage::names()
+Future<std::set<string>> LevelDBStorage::names()
{
return dispatch(process, &LevelDBStorageProcess::names);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/9c97c787/src/state/leveldb.hpp
----------------------------------------------------------------------
diff --git a/src/state/leveldb.hpp b/src/state/leveldb.hpp
index f95fa4b..626ed82 100644
--- a/src/state/leveldb.hpp
+++ b/src/state/leveldb.hpp
@@ -45,10 +45,10 @@ public:
virtual ~LevelDBStorage();
// Storage implementation.
- virtual process::Future<Option<Entry> > get(const std::string& name);
+ virtual process::Future<Option<Entry>> get(const std::string& name);
virtual process::Future<bool> set(const Entry& entry, const UUID& uuid);
virtual process::Future<bool> expunge(const Entry& entry);
- virtual process::Future<std::set<std::string> > names();
+ virtual process::Future<std::set<std::string>> names();
private:
LevelDBStorageProcess* process;
http://git-wip-us.apache.org/repos/asf/mesos/blob/9c97c787/src/state/log.cpp
----------------------------------------------------------------------
diff --git a/src/state/log.cpp b/src/state/log.cpp
index 07bd542..fd9f5ef 100644
--- a/src/state/log.cpp
+++ b/src/state/log.cpp
@@ -81,10 +81,10 @@ public:
virtual ~LogStorageProcess();
// Storage implementation.
- Future<Option<state::Entry> > get(const string& name);
+ Future<Option<state::Entry>> get(const string& name);
Future<bool> set(const state::Entry& entry, const UUID& uuid);
Future<bool> expunge(const state::Entry& entry);
- Future<std::set<string> > names();
+ Future<std::set<string>> names();
protected:
virtual void finalize();
@@ -107,7 +107,7 @@ private:
const Option<Log::Position>& position);
// Continuations.
- Future<Option<state::Entry> > _get(const string& name);
+ Future<Option<state::Entry>> _get(const string& name);
Future<bool> _set(const state::Entry& entry, const UUID& uuid);
Future<bool> __set(const state::Entry& entry, const UUID& uuid);
@@ -122,7 +122,7 @@ private:
const state::Entry& entry,
const Option<Log::Position>& position);
- Future<std::set<string> > _names();
+ Future<std::set<string>> _names();
Log::Reader reader;
Log::Writer writer;
@@ -133,7 +133,7 @@ private:
Mutex mutex;
// Whether or not we've started the ability to append to log.
- Option<Future<Nothing> > starting;
+ Option<Future<Nothing>> starting;
// Last position in the log that we've read or written.
Option<Log::Position> index;
@@ -431,14 +431,14 @@ Future<Nothing> LogStorageProcess::__truncate(
}
-Future<Option<state::Entry> > LogStorageProcess::get(const string& name)
+Future<Option<state::Entry>> LogStorageProcess::get(const string& name)
{
return start()
.then(defer(self(), &Self::_get, name));
}
-Future<Option<state::Entry> > LogStorageProcess::_get(const string& name)
+Future<Option<state::Entry>> LogStorageProcess::_get(const string& name)
{
Option<Snapshot> snapshot = snapshots.get(name);
@@ -635,14 +635,14 @@ Future<bool> LogStorageProcess::___expunge(
}
-Future<std::set<string> > LogStorageProcess::names()
+Future<std::set<string>> LogStorageProcess::names()
{
return start()
.then(defer(self(), &Self::_names));
}
-Future<std::set<string> > LogStorageProcess::_names()
+Future<std::set<string>> LogStorageProcess::_names()
{
const hashset<string>& keys = snapshots.keys();
return std::set<string>(keys.begin(), keys.end());
@@ -664,7 +664,7 @@ LogStorage::~LogStorage()
}
-Future<Option<state::Entry> > LogStorage::get(const string& name)
+Future<Option<state::Entry>> LogStorage::get(const string& name)
{
return dispatch(process, &LogStorageProcess::get, name);
}
@@ -682,7 +682,7 @@ Future<bool> LogStorage::expunge(const state::Entry& entry)
}
-Future<std::set<string> > LogStorage::names()
+Future<std::set<string>> LogStorage::names()
{
return dispatch(process, &LogStorageProcess::names);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/9c97c787/src/state/log.hpp
----------------------------------------------------------------------
diff --git a/src/state/log.hpp b/src/state/log.hpp
index 651b769..5dd30ca 100644
--- a/src/state/log.hpp
+++ b/src/state/log.hpp
@@ -47,10 +47,10 @@ public:
virtual ~LogStorage();
// Storage implementation.
- virtual process::Future<Option<Entry> > get(const std::string& name);
+ virtual process::Future<Option<Entry>> get(const std::string& name);
virtual process::Future<bool> set(const Entry& entry, const UUID& uuid);
virtual process::Future<bool> expunge(const Entry& entry);
- virtual process::Future<std::set<std::string> > names();
+ virtual process::Future<std::set<std::string>> names();
private:
LogStorageProcess* process;
http://git-wip-us.apache.org/repos/asf/mesos/blob/9c97c787/src/state/protobuf.hpp
----------------------------------------------------------------------
diff --git a/src/state/protobuf.hpp b/src/state/protobuf.hpp
index af1f0a9..7ac5bca 100644
--- a/src/state/protobuf.hpp
+++ b/src/state/protobuf.hpp
@@ -78,13 +78,13 @@ public:
// Returns a variable from the state, creating a new one if one
// previously did not exist (or an error if one occurs).
template <typename T>
- process::Future<Variable<T> > fetch(const std::string& name);
+ process::Future<Variable<T>> fetch(const std::string& name);
// Returns the variable specified if it was successfully stored in
// the state, otherwise returns none if the version of the variable
// was no longer valid, or an error if one occurs.
template <typename T>
- process::Future<Option<Variable<T> > > store(const Variable<T>& variable);
+ process::Future<Option<Variable<T>>> store(const Variable<T>& variable);
// Expunges the variable from the state.
template <typename T>
@@ -95,18 +95,18 @@ private:
// these static members of State for friend access to Variable's
// constructor.
template <typename T>
- static process::Future<Variable<T> > _fetch(
+ static process::Future<Variable<T>> _fetch(
const state::Variable& option);
template <typename T>
- static process::Future<Option<Variable<T> > > _store(
+ static process::Future<Option<Variable<T>>> _store(
const T& t,
const Option<state::Variable>& variable);
};
template <typename T>
-process::Future<Variable<T> > State::fetch(const std::string& name)
+process::Future<Variable<T>> State::fetch(const std::string& name)
{
return state::State::fetch(name)
.then(lambda::bind(&State::template _fetch<T>, lambda::_1));
@@ -114,7 +114,7 @@ process::Future<Variable<T> > State::fetch(const std::string& name)
template <typename T>
-process::Future<Variable<T> > State::_fetch(
+process::Future<Variable<T>> State::_fetch(
const state::Variable& variable)
{
Try<T> t = messages::deserialize<T>(variable.value());
@@ -127,7 +127,7 @@ process::Future<Variable<T> > State::_fetch(
template <typename T>
-process::Future<Option<Variable<T> > > State::store(
+process::Future<Option<Variable<T>>> State::store(
const Variable<T>& variable)
{
Try<std::string> value = messages::serialize(variable.t);
@@ -142,7 +142,7 @@ process::Future<Option<Variable<T> > > State::store(
template <typename T>
-process::Future<Option<Variable<T> > > State::_store(
+process::Future<Option<Variable<T>>> State::_store(
const T& t,
const Option<state::Variable>& variable)
{
http://git-wip-us.apache.org/repos/asf/mesos/blob/9c97c787/src/state/state.hpp
----------------------------------------------------------------------
diff --git a/src/state/state.hpp b/src/state/state.hpp
index c963e85..ecae61f 100644
--- a/src/state/state.hpp
+++ b/src/state/state.hpp
@@ -103,13 +103,13 @@ public:
// Returns the variable specified if it was successfully stored in
// the state, otherwise returns none if the version of the variable
// was no longer valid, or an error if one occurs.
- process::Future<Option<Variable> > store(const Variable& variable);
+ process::Future<Option<Variable>> store(const Variable& variable);
// Returns true if successfully expunged the variable from the state.
process::Future<bool> expunge(const Variable& variable);
// Returns the collection of variable names in the state.
- process::Future<std::set<std::string> > names();
+ process::Future<std::set<std::string>> names();
private:
// Helpers to handle future results from fetch and swap. We make
@@ -119,7 +119,7 @@ private:
const std::string& name,
const Option<Entry>& option);
- static process::Future<Option<Variable> > _store(
+ static process::Future<Option<Variable>> _store(
const Entry& entry,
const bool& b); // TODO(benh): Remove 'const &' after fixing libprocess.
@@ -152,7 +152,7 @@ inline process::Future<Variable> State::_fetch(
}
-inline process::Future<Option<Variable> > State::store(const Variable& variable)
+inline process::Future<Option<Variable>> State::store(const Variable& variable)
{
// Note that we try and swap an entry even if the value didn't change!
UUID uuid = UUID::fromBytes(variable.entry.uuid());
@@ -169,7 +169,7 @@ inline process::Future<Option<Variable> > State::store(const Variable& variable)
}
-inline process::Future<Option<Variable > > State::_store(
+inline process::Future<Option<Variable>> State::_store(
const Entry& entry,
const bool& b) // TODO(benh): Remove 'const &' after fixing libprocess.
{
@@ -187,7 +187,7 @@ inline process::Future<bool> State::expunge(const Variable& variable)
}
-inline process::Future<std::set<std::string> > State::names()
+inline process::Future<std::set<std::string>> State::names()
{
return storage->names();
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/9c97c787/src/state/storage.hpp
----------------------------------------------------------------------
diff --git a/src/state/storage.hpp b/src/state/storage.hpp
index 5b70dc1..5de3b17 100644
--- a/src/state/storage.hpp
+++ b/src/state/storage.hpp
@@ -41,14 +41,14 @@ public:
// implementations to be agnostic of Variable. Note that set acts
// like a "test-and-set" by requiring the existing entry to have the
// specified UUID.
- virtual process::Future<Option<Entry> > get(const std::string& name) = 0;
+ virtual process::Future<Option<Entry>> get(const std::string& name) = 0;
virtual process::Future<bool> set(const Entry& entry, const UUID& uuid) = 0;
// Returns true if successfully expunged the variable from the state.
virtual process::Future<bool> expunge(const Entry& entry) = 0;
// Returns the collection of variable names in the state.
- virtual process::Future<std::set<std::string> > names() = 0;
+ virtual process::Future<std::set<std::string>> names() = 0;
};
} // namespace state {
http://git-wip-us.apache.org/repos/asf/mesos/blob/9c97c787/src/state/zookeeper.cpp
----------------------------------------------------------------------
diff --git a/src/state/zookeeper.cpp b/src/state/zookeeper.cpp
index e3df3ee..5578fa5 100644
--- a/src/state/zookeeper.cpp
+++ b/src/state/zookeeper.cpp
@@ -76,10 +76,10 @@ public:
virtual void initialize();
// Storage implementation.
- Future<Option<Entry> > get(const string& name);
+ Future<Option<Entry>> get(const string& name);
Future<bool> set(const Entry& entry, const UUID& uuid);
virtual Future<bool> expunge(const Entry& entry);
- Future<std::set<string> > names();
+ Future<std::set<string>> names();
// ZooKeeper events.
// Note that events from previous sessions are dropped.
@@ -92,8 +92,8 @@ public:
private:
// Helpers for getting the names, fetching, and swapping.
- Result<std::set<string> > doNames();
- Result<Option<Entry> > doGet(const string& name);
+ Result<std::set<string>> doNames();
+ Result<Option<Entry>> doGet(const string& name);
Result<bool> doSet(const Entry& entry, const UUID& uuid);
Result<bool> doExpunge(const Entry& entry);
@@ -121,7 +121,7 @@ private:
struct Names
{
- Promise<std::set<string> > promise;
+ Promise<std::set<string>> promise;
};
struct Get
@@ -129,7 +129,7 @@ private:
explicit Get(const string& _name) : name(_name) {}
string name;
- Promise<Option<Entry> > promise;
+ Promise<Option<Entry>> promise;
};
struct Set
@@ -213,7 +213,7 @@ void ZooKeeperStorageProcess::initialize()
}
-Future<std::set<string> > ZooKeeperStorageProcess::names()
+Future<std::set<string>> ZooKeeperStorageProcess::names()
{
if (error.isSome()) {
return Failure(error.get());
@@ -223,7 +223,7 @@ Future<std::set<string> > ZooKeeperStorageProcess::names()
return names->promise.future();
}
- Result<std::set<string> > result = doNames();
+ Result<std::set<string>> result = doNames();
if (result.isNone()) { // Try again later.
Names* names = new Names();
@@ -237,7 +237,7 @@ Future<std::set<string> > ZooKeeperStorageProcess::names()
}
-Future<Option<Entry> > ZooKeeperStorageProcess::get(const string& name)
+Future<Option<Entry>> ZooKeeperStorageProcess::get(const string& name)
{
if (error.isSome()) {
return Failure(error.get());
@@ -247,7 +247,7 @@ Future<Option<Entry> > ZooKeeperStorageProcess::get(const string& name)
return get->promise.future();
}
- Result<Option<Entry> > result = doGet(name);
+ Result<Option<Entry>> result = doGet(name);
if (result.isNone()) { // Try again later.
Get* get = new Get(name);
@@ -334,7 +334,7 @@ void ZooKeeperStorageProcess::connected(int64_t sessionId, bool reconnect)
while (!pending.names.empty()) {
Names* names = pending.names.front();
- Result<std::set<string> > result = doNames();
+ Result<std::set<string>> result = doNames();
if (result.isNone()) {
return; // Try again later.
} else if (result.isError()) {
@@ -348,7 +348,7 @@ void ZooKeeperStorageProcess::connected(int64_t sessionId, bool reconnect)
while (!pending.gets.empty()) {
Get* get = pending.gets.front();
- Result<Option<Entry> > result = doGet(get->name);
+ Result<Option<Entry>> result = doGet(get->name);
if (result.isNone()) {
return; // Try again later.
} else if (result.isError()) {
@@ -419,7 +419,7 @@ void ZooKeeperStorageProcess::deleted(int64_t sessionId, const string& path)
}
-Result<std::set<string> > ZooKeeperStorageProcess::doNames()
+Result<std::set<string>> ZooKeeperStorageProcess::doNames()
{
// Get all children to determine current memberships.
vector<string> results;
@@ -442,7 +442,7 @@ Result<std::set<string> > ZooKeeperStorageProcess::doNames()
}
-Result<Option<Entry> > ZooKeeperStorageProcess::doGet(const string& name)
+Result<Option<Entry>> ZooKeeperStorageProcess::doGet(const string& name)
{
CHECK_NONE(error) << ": " << error.get();
CHECK(state == CONNECTED);
@@ -644,7 +644,7 @@ ZooKeeperStorage::~ZooKeeperStorage()
}
-Future<Option<Entry> > ZooKeeperStorage::get(const string& name)
+Future<Option<Entry>> ZooKeeperStorage::get(const string& name)
{
return dispatch(process, &ZooKeeperStorageProcess::get, name);
}
@@ -662,7 +662,7 @@ Future<bool> ZooKeeperStorage::expunge(const Entry& entry)
}
-Future<std::set<string> > ZooKeeperStorage::names()
+Future<std::set<string>> ZooKeeperStorage::names()
{
return dispatch(process, &ZooKeeperStorageProcess::names);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/9c97c787/src/state/zookeeper.hpp
----------------------------------------------------------------------
diff --git a/src/state/zookeeper.hpp b/src/state/zookeeper.hpp
index 9ee0100..d8f9df8 100644
--- a/src/state/zookeeper.hpp
+++ b/src/state/zookeeper.hpp
@@ -52,10 +52,10 @@ public:
virtual ~ZooKeeperStorage();
// Storage implementation.
- virtual process::Future<Option<Entry> > get(const std::string& name);
+ virtual process::Future<Option<Entry>> get(const std::string& name);
virtual process::Future<bool> set(const Entry& entry, const UUID& uuid);
virtual process::Future<bool> expunge(const Entry& entry);
- virtual process::Future<std::set<std::string> > names();
+ virtual process::Future<std::set<std::string>> names();
private:
ZooKeeperStorageProcess* process;