22 using Pair = std::pair<std::string, size_t>;
25 .template FlatMap<Pair>(
32 word_pairs.ReduceByKey(
34 [](
const Pair& p) {
return p.first; },
36 [](
const Pair& a,
const Pair& b) {
37 return Pair(a.first, a.second + b.second);
39 .Map([](
const Pair& p) {
46 int main(
int argc,
char* argv[]) {
48 std::cout <<
"Usage: " << argv[0] <<
" <input> <output>" << std::endl;
void WordCount(thrill::Context &ctx, std::string input, std::string output)
int Run(const std::function< void(Context &)> &job_startpoint)
Runs the given job startpoint with a Context instance.
The Context of a job is a unique instance per worker which holds references to all underlying parts o...
DIA< std::string > ReadLines(Context &ctx, const std::string &filepath)
ReadLines is a DOp, which reads a file from the file system and creates an ordered DIA according to a...
static by_string to_string(int val)
convert to string
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
StringView is a reference to a part of a string, consisting of only a char pointer and a length...
std::string to_string() const
Returns the data of this StringView as a std::string.
static void split_view(char sep, const std::string &str, Functor &&callback, std::string::size_type limit=std::string::npos)
Split the given string at each separator character into distinct substrings, and call the given callb...
int main(int argc, char *argv[])