// Copyright (c) 2008 Michael Miceli and Christopher Miceli // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef MR_FRONTEND_CFGFILEPARSER_HPP #define MR_FRONTEND_CFGFILEPARSER_HPP #include #include #include "../utils/LogWriter.hpp" namespace MapReduce { namespace Master { // Describes a session struct SessionDescription { std::string name; std::string version; std::string orchestrator; std::string user; std::string priority; std::string experimentID; std::string eventLevel; }; // Describes an executable struct BinaryDescription { std::string URL; std::string targetOS; std::string targetArch; std::string extraArgs; }; // Describes an executable struct HostDescription { std::string rmURL; std::string hostOS; std::string hostArch; }; // Describes a data file struct FileDescription { std::string name; }; // Parses a Task Farming config file class ConfigFileParser { private: std::string cfgFilePath_; SessionDescription sessionDesc_; std::vector targetHostList_; std::vector binDescList_; std::vector fileDescList_; std::string outputPrefix_; std::string masterAddress_; MapReduce::LogWriter *log_; public: ConfigFileParser(); ConfigFileParser(std::string cfgFilePath, MapReduce::LogWriter &log); void parse_(void); SessionDescription getSessionDescription(void); std::vector getExecutableList(void); std::vector getTargetHostList(void); std::vector getFileList(void); std::string getOutputPrefix(void); std::string getMasterAddress(); }; } //namespace Master } //namespace MapReduce #endif //MR_FRONTEND_CFGFILEPARSER_HPP