Skip to content

Commit

Permalink
Rename ch02 to ch02-mr-intro.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwhite committed Sep 18, 2014
1 parent 8710b56 commit 0c3d3fc
Show file tree
Hide file tree
Showing 50 changed files with 49 additions and 69 deletions.
24 changes: 2 additions & 22 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,5 @@ Again, you can specify hadoop.version to use a particular Hadoop 2 version:

You should then be able to run the examples from the book.

Chapter names for "Hadoop: The Definitive Guide", Third Edition

ch01 - Meet Hadoop
ch02 - MapReduce
ch03 - The Hadoop Distributed Filesystem
ch04 - Hadoop I/O
ch05 - Developing a MapReduce Application
ch06 - How MapReduce Works
ch07 - MapReduce Types and Formats
ch08 - MapReduce Features
ch09 - Setting Up a Hadoop Cluster
ch10 - Administering Hadoop
ch11 - Pig
ch12 - Hive
ch13 - HBase
ch14 - ZooKeeper
ch15 - Sqoop
ch16 - Case Studies

app1 - Installing Apache Hadoop
app2 - Cloudera's Distribution for Hadoop
app3 - Preparing the NCDC Weather Data
For chapter names for "Hadoop: The Definitive Guide", see
https://github.com/tomwhite/hadoop-book/wiki/Chapter-Numbers-By-Edition
2 changes: 1 addition & 1 deletion ch02/pom.xml → ch02-mr-intro/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<relativePath>../hadoop-meta/pom.xml</relativePath>
</parent>
<groupId>com.hadoopbook</groupId>
<artifactId>ch02</artifactId>
<artifactId>ch02-mr-intro</artifactId>
<packaging>jar</packaging>
<version>3.0</version>
<name>Chapter 2: MapReduce</name>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hadoop jar $HADOOP_HOME/share/hadoop/tools/lib/hadoop-streaming-*.jar \
-input input/ncdc/sample.txt \
-output output \
-mapper ch02-mr-intro/src/main/ruby/max_temperature_map.rb \
-reducer ch02-mr-intro/src/main/ruby/max_temperature_reduce.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
hadoop jar $HADOOP_HOME/share/hadoop/tools/lib/hadoop-streaming-*.jar \
-files ch02-mr-intro/src/main/ruby/max_temperature_map.rb,\
ch02-mr-intro/src/main/ruby/max_temperature_reduce.rb \
-input input/ncdc/all \
-output output \
-mapper ch02-mr-intro/src/main/ruby/max_temperature_map.rb \
-combiner ch02-mr-intro/src/main/ruby/max_temperature_reduce.rb \
-reducer ch02-mr-intro/src/main/ruby/max_temperature_reduce.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hadoop jar $HADOOP_HOME/share/hadoop/tools/lib/hadoop-streaming-*.jar \
-input input/ncdc/sample.txt \
-output output \
-mapper ch02-mr-intro/src/main/python/max_temperature_map.py \
-reducer ch02-mr-intro/src/main/python/max_temperature_reduce.py
5 changes: 5 additions & 0 deletions ch02-mr-intro/src/main/examples/max_temperature_py/input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hadoop jar $HADOOP_HOME/share/hadoop/tools/lib/hadoop-streaming-*.jar \
-input input/ncdc/sample.txt \
-output output \
-mapper ch02-mr-intro/src/main/python/max_temperature_map.py \
-reducer ch02-mr-intro/src/main/python/max_temperature_reduce.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
hadoop jar $HADOOP_HOME/share/hadoop/tools/lib/hadoop-streaming-*.jar \
-files ch02-mr-intro/src/main/python/max_temperature_map.py,\
ch02-mr-intro/src/main/python/max_temperature_reduce.py \
-input input/ncdc/sample.txt \
-output output \
-mapper ch02-mr-intro/src/main/python/max_temperature_map.py \
-reducer ch02-mr-intro/src/main/python/max_temperature_reduce.py
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ hadoop MaxTemperature input/ncdc/sample.txt output
cat output/part-00000
: ^^ max_temp_java_output
: vv max_temp_ruby_map
cat input/ncdc/sample.txt | ch02/src/main/ruby/max_temperature_map.rb
cat input/ncdc/sample.txt | ch02-mr-intro/src/main/ruby/max_temperature_map.rb
: ^^ max_temp_ruby_map
: vv max_temp_ruby_pipeline
cat input/ncdc/sample.txt | ch02/src/main/ruby/max_temperature_map.rb | \
sort | ch02/src/main/ruby/max_temperature_reduce.rb
cat input/ncdc/sample.txt | ch02-mr-intro/src/main/ruby/max_temperature_map.rb | \
sort | ch02-mr-intro/src/main/ruby/max_temperature_reduce.rb
: ^^ max_temp_ruby_pipeline
: vv max_temp_python_pipeline
cat input/ncdc/sample.txt | ch02/src/main/python/max_temperature_map.py | \
sort | ch02/src/main/python/max_temperature_reduce.py
cat input/ncdc/sample.txt | ch02-mr-intro/src/main/python/max_temperature_map.py | \
sort | ch02-mr-intro/src/main/python/max_temperature_reduce.py
: ^^ max_temp_python_pipeline

5 changes: 0 additions & 5 deletions ch02/src/main/examples/max_temperature_hadoop.input.txt

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions ch02/src/main/examples/max_temperature_py/2/input.txt

This file was deleted.

5 changes: 0 additions & 5 deletions ch02/src/main/examples/max_temperature_py/input.txt

This file was deleted.

7 changes: 0 additions & 7 deletions ch02/src/main/examples/max_temperature_py/pseudo/input.txt

This file was deleted.

2 changes: 1 addition & 1 deletion ch04/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<dependencies>
<dependency>
<groupId>com.hadoopbook</groupId>
<artifactId>ch02</artifactId>
<artifactId>ch02-mr-intro</artifactId>
<version>3.0</version>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion ch07/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</dependency>
<dependency>
<groupId>com.hadoopbook</groupId>
<artifactId>ch02</artifactId>
<artifactId>ch02-mr-intro</artifactId>
<version>3.0</version>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion ch08/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</dependency>
<dependency>
<groupId>com.hadoopbook</groupId>
<artifactId>ch02</artifactId>
<artifactId>ch02-mr-intro</artifactId>
<version>3.0</version>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion ch18-crunch/src/main/java/crunch/MaxTemperatureCrunch.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.apache.crunch.impl.mr.MRPipeline;
import org.apache.crunch.io.To;

// Crunch version of ch02 MaxTemperature
// Crunch version of ch02-mr-intro MaxTemperature
public class MaxTemperatureCrunch {

public static void main(String[] args) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import static org.apache.crunch.types.writable.Writables.strings;
import static org.apache.crunch.types.writable.Writables.tableOf;

// Crunch version of ch02 MaxTemperature
// Crunch version of ch02-mr-intro MaxTemperature
public class MaxTemperatureCrunchWithShutdownHook {

public static void main(String[] args) throws Exception {
Expand Down
2 changes: 1 addition & 1 deletion hadoop-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</dependency>
<dependency>
<groupId>com.hadoopbook</groupId>
<artifactId>ch02</artifactId>
<artifactId>ch02-mr-intro</artifactId>
<version>3.0</version>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<modules>
<module>book</module>
<module>common</module>
<module>ch02</module>
<module>ch02-mr-intro</module>
<module>ch03</module>
<module>ch04</module>
<module>ch06-avro</module>
Expand Down
2 changes: 1 addition & 1 deletion snippet/README
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ mvn verify
mvn verify -DargLine="-Dexample.mode=pseudo"

# Run the examples from chapter 2 only
mvn verify -DargLine="-Dexample.chapters=ch02"
mvn verify -DargLine="-Dexample.chapters=ch02-mr-intro"
2 changes: 1 addition & 1 deletion snippet/bin/check_manuscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ actual="$bin"/../actual
book_workspace=~/book-workspace/htdg-git

# Should add remaining chapters: ch03 ch04 ch14
for ch in ch02 ch03 ch05 ch07 ch08 # ch11 ch12
for ch in ch02-mr-intro ch03 ch05 ch07 ch08 # ch11 ch12
do
# remove id attributes from program listings, and add a newline before </programlisting>
sed '/<programlisting/s/ id="[^"]*"//; s|</programlisting>|\
Expand Down
2 changes: 1 addition & 1 deletion snippet/bin/generate_listings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ bin=`cd "$bin"; pwd`

actual="$bin"/../actual

perl $bin/phragmite_db.pl $actual/ch02/ $(grep -ElR '(// ?cc|// ?==)' --include '*.java' $bin/../../ch02)
perl $bin/phragmite_db.pl $actual/ch02-mr-intro/ $(grep -ElR '(// ?cc|// ?==)' --include '*.java' $bin/../../ch02-mr-intro)
perl $bin/phragmite_db.pl $actual/ch03/ $(grep -ElR '(// ?cc|// ?==)' --include '*.java' $bin/../../ch03)
perl $bin/phragmite_db.pl $actual/ch04/ $(grep -ElR '(// ?cc|// ?==)' --include '*.java' $bin/../../ch04)
perl $bin/phragmite_db.pl $actual/ch06-avro/ $(grep -ElR '(// ?cc|// ?==)' --include '*.java' $bin/../../ch06-avro)
Expand Down
2 changes: 1 addition & 1 deletion snippet/src/test/java/ExamplesIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class ExamplesIT {
private static final String MODE_DEFAULT = "local";

private static final String EXAMPLE_CHAPTERS_PROPERTY = "example.chapters";
private static final String EXAMPLE_CHAPTERS_DEFAULT = "ch02,ch04,ch06-avro,ch05,ch07,ch08";
private static final String EXAMPLE_CHAPTERS_DEFAULT = "ch02-mr-intro,ch04,ch06-avro,ch05,ch07,ch08";

private static final IOFileFilter HIDDEN_FILE_FILTER =
new OrFileFilter(HiddenFileFilter.HIDDEN, new PrefixFileFilter("_"));
Expand Down

0 comments on commit 0c3d3fc

Please sign in to comment.