Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add some missing files.

  • Loading branch information...
commit e54d62750602c55213f50fe4d0b5096be6c37e92 1 parent 23d65c8
@tomwhite authored
View
36 ch05/src/main/java/LoggingDriver.java
@@ -0,0 +1,36 @@
+import org.apache.hadoop.conf.Configured;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapreduce.Job;
+import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
+import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
+import org.apache.hadoop.util.Tool;
+import org.apache.hadoop.util.ToolRunner;
+
+public class LoggingDriver extends Configured implements Tool {
+
+ @Override
+ public int run(String[] args) throws Exception {
+ if (args.length != 2) {
+ System.err.printf("Usage: %s [generic options] <input> <output>\n",
+ getClass().getSimpleName());
+ ToolRunner.printGenericCommandUsage(System.err);
+ return -1;
+ }
+
+ Job job = new Job(getConf(), "Logging job");
+ job.setJarByClass(getClass());
+
+ FileInputFormat.addInputPath(job, new Path(args[0]));
+ FileOutputFormat.setOutputPath(job, new Path(args[1]));
+
+ job.setMapperClass(LoggingIdentityMapper.class);
+ job.setNumReduceTasks(0);
+
+ return job.waitForCompletion(true) ? 0 : 1;
+ }
+
+ public static void main(String[] args) throws Exception {
+ int exitCode = ToolRunner.run(new LoggingDriver(), args);
+ System.exit(exitCode);
+ }
+}
View
9 ch09/src/main/conf-mr2/mapred-site.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<!-- mapred-site.xml -->
+<configuration>
+ <property>
+ <name>mapred.child.java.opts</name>
+ <value>-Xmx400m</value>
+ <!-- Not marked as final so jobs can include JVM debugging options -->
+ </property>
+</configuration>
View
21 ch09/src/main/conf-mr2/yarn-site.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<!-- yarn-site.xml -->
+<configuration>
+ <property>
+ <name>yarn.resourcemanager.address</name>
+ <value>resourcemanager:8040</value>
+ </property>
+ <property>
+ <name>yarn.nodemanager.local-dirs</name>
+ <value>/disk1/nm-local-dir,/disk2/nm-local-dir</value>
+ <final>true</final>
+ </property>
+ <property>
+ <name>yarn.nodemanager.aux-services</name>
+ <value>mapreduce.shuffle</value>
+ </property>
+ <property>
+ <name>yarn.nodemanager.resource.memory-mb</name>
+ <value>8192</value>
+ </property>
+</configuration>
Please sign in to comment.
Something went wrong with that request. Please try again.