Updated Branches: refs/heads/master 9cbb81ba4 -> c020a889e
Moved slave state API functions to the top of the header. Review: https://reviews.apache.org/r/16237 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c020a889 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c020a889 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c020a889 Branch: refs/heads/master Commit: c020a889ee0e9033381c180d1a4435ecd7bceee0 Parents: 9cbb81b Author: Benjamin Mahler <bmah...@twitter.com> Authored: Thu Dec 12 20:08:57 2013 -0800 Committer: Benjamin Mahler <bmah...@twitter.com> Committed: Tue Dec 17 18:17:27 2013 -0800 ---------------------------------------------------------------------- src/slave/state.hpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/c020a889/src/slave/state.hpp ---------------------------------------------------------------------- diff --git a/src/slave/state.hpp b/src/slave/state.hpp index f06cba8..78b20ff 100644 --- a/src/slave/state.hpp +++ b/src/slave/state.hpp @@ -51,8 +51,8 @@ struct ExecutorState; struct RunState; struct TaskState; -// Each of the structs below (recursively) recover the checkpointed -// state. If the 'strict' flag is set, any errors encountered while +// This function performs recovery from the state stored at 'rootDir'. +// If the 'strict' flag is set, any errors encountered while // recovering a state are considered fatal and hence the recovery is // short-circuited and returns an error. There might be orphaned // executors that need to be manually cleaned up. If 'strict' flag is @@ -61,7 +61,24 @@ struct TaskState; // while increasing the 'errors' count. Note that 'errors' on a struct // includes the 'errors' encountered recursively. In other words, // 'SlaveState.errors' is the sum total of all recovery errors. +// If the machine has rebooted since the last slave run, +// None is returned. +Result<SlaveState> recover(const std::string& rootDir, bool strict); +// Thin wrappers to checkpoint data to disk and perform the +// necessary error checking. + +// Checkpoints a protobuf at the given path. +Try<Nothing> checkpoint( + const std::string& path, + const google::protobuf::Message& message); + + +// Checkpoints a string at the given path. +Try<Nothing> checkpoint(const std::string& path, const std::string& message); + +// Each of the structs below (recursively) recover the checkpointed +// state. struct SlaveState { SlaveState () : errors(0) {} @@ -156,23 +173,6 @@ struct TaskState unsigned int errors; }; - -// This function performs recovery from the state stored at 'rootDir'. -Result<SlaveState> recover(const std::string& rootDir, bool strict); - - -// Thin wrappers to checkpoint data to disk and perform the -// necessary error checking. - -// Checkpoints a protobuf at the given path. -Try<Nothing> checkpoint( - const std::string& path, - const google::protobuf::Message& message); - - -// Checkpoints a string at the given path. -Try<Nothing> checkpoint(const std::string& path, const std::string& message); - } // namespace state { } // namespace slave { } // namespace internal {