Skip to content

Commit c22d36c

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents 627d1c6 + 32a0cba commit c22d36c

File tree

9 files changed

+16
-9
lines changed

9 files changed

+16
-9
lines changed

madoop/mapreduce.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,13 @@ def group_stage(input_dir, output_dir):
278278
last_two(inpath), outparent.name, ",".join(outnames),
279279
)
280280

281+
# Remove empty output files. We won't always use the maximum number of
282+
# reducers because some MapReduce programs have fewer intermediate keys.
283+
for path in sorted(output_dir.iterdir()):
284+
if path.stat().st_size == 0:
285+
LOGGER.debug("empty partition: rm %s", last_two(path))
286+
path.unlink()
287+
281288
# Sort output files
282289
for path in sorted(output_dir.iterdir()):
283290
sort_file(path)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
description="A light weight MapReduce framework for education.",
1515
long_description=LONG_DESCRIPTION,
1616
long_description_content_type="text/markdown",
17-
version="0.4.0",
17+
version="0.5.0",
1818
author="Andrew DeOrio",
1919
author_email="[email protected]",
2020
url="https://github.com/eecs485staff/madoop/",

tests/testdata/word_count/correct/grouper-output/part-00001

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Bye 1
2+
Hadoop 2
3+
World 2
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
Bye 1
2-
Hadoop 2
3-
World 2
1+
Hello 2

tests/testdata/word_count/correct/output/part-00003

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Bye 1
2+
Hadoop 2
3+
World 2
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
Bye 1
2-
Hadoop 2
3-
World 2
1+
Hello 2

tests/testdata/word_count/correct/reducer-output/part-00003

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)