// 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_HANDLE_MAPS_HPP #define MR_HANDLE_MAPS_HPP #include #include #include #include #include "../input_output.hpp" #include "../../utils/LogWriter.hpp" #include "../version.hpp" namespace mapreduce { namespace master { class HandleMaps { public: HandleMaps(const JobDescription& job, std::vector &chunks, std::map& committed_chunks_, RawInputFormat* input_format, saga::url serverURL, LogWriter *log); ~HandleMaps(); bool assignMaps(); private: void issue_command_(); std::string getCandidate_(saga::stream::stream& worker); saga::stream::server *service_; const JobDescription& job_; std::map chunk_assignments_; std::map& committed_chunks_; std::map worker_adverts_; RawInputFormat* input_format_; std::set unassigned_; std::set assigned_; std::set finished_; saga::url serverURL_; LogWriter *log_; std::vector::size_type totalChunks_; }; } // namespace master } // namespace mapreduce #endif // MR_HANDLE_MAPS_HPP