Skip to content
Snippets Groups Projects
Commit 3ae37205 authored by ajf5's avatar ajf5
Browse files

try to fix reducer

parent 8afe1981
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
...@@ -10,6 +10,7 @@ int main(int argc, char **argv) { ...@@ -10,6 +10,7 @@ int main(int argc, char **argv) {
while (std::getline(file, str)) while (std::getline(file, str))
{ {
if (str.size() == 0) continue; if (str.size() == 0) continue;
if ((str.compare(" ") == 0) || (str.compare("\n") == 0)) continue;
std::vector<std::string> temp = splitString(str, delim); std::vector<std::string> temp = splitString(str, delim);
key = temp[0]; key = temp[0];
try { counter += stoi(temp[1]); } try { counter += stoi(temp[1]); }
......
...@@ -60,7 +60,7 @@ void handlePipe(int file) { ...@@ -60,7 +60,7 @@ void handlePipe(int file) {
int lines = 0; int lines = 0;
while ((fgets(str, bufSize, stream)) != NULL){ while ((fgets(str, bufSize, stream)) != NULL){
lines++; lines++;
//cout << "[PIPE] " << str << endl; cout << "[PIPE] " << str << endl;
std::string key(strtok(str, delim)); std::string key(strtok(str, delim));
std::string val(strtok(NULL, delim)); std::string val(strtok(NULL, delim));
string keyFile = "tmp-" + key; string keyFile = "tmp-" + key;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment