Skip to content

Commit

Permalink
Added hdfs_skip option.
Browse files Browse the repository at this point in the history
This makes it extra clear that, when launched via hadoop and running
in a mapper task, H2O does not load any HDFS library itself.
Instead, H2O inherits the HDFS library from the mapper task.
  • Loading branch information
tomkraljevic committed Aug 14, 2013
1 parent 65ad0ef commit d9fa27b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions hadoop/src/main/java/water/hadoop/h2omapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,12 @@ private int run2(Context context) throws IOException, InterruptedException {
String localPortString = Integer.toString(ss.getLocalPort());

String[] args = {
// Options used by H2O.
"-ice_root", ice_root,
"-name", jobtrackerName,
"-hdfs_skip",

// Options passed through to UserMain for configuring the EmbeddedH2OConfig.
"-driverip", driverIp,
"-driverport", driverPortString,
"-mapperport", localPortString
Expand Down
1 change: 1 addition & 0 deletions src/main/java/water/H2O.java
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ public static class OptArgs extends Arguments.Opt {
public String hdfs; // HDFS backend
public String hdfs_version; // version of the filesystem
public String hdfs_config; // configuration file of the HDFS
public String hdfs_skip = null; // used by hadoop driver to not unpack and load any hdfs jar file at runtime.
public String aws_credentials; // properties file for aws credentials
public String keepice; // Do not delete ice on startup
public String soft = null; // soft launch for demos
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/water/persist/HdfsLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ public class HdfsLoader {
private static final String MAPRFS_HDFS_VERSION = "mapr2.1.3";

public static void loadJars() {
if (H2O.OPT_ARGS.hdfs_skip != null) {
// When H2O is launched by hadoop itself, it should use the HDFS library that
// the hadoop mapper task picks up by default.
//
// Do not load any hadoop jar that is packed with H2O.
Log.info("H2O was started by Hadoop; inheriting HDFS library from mapper task.");
return;
}

// Load the HDFS backend for existing hadoop installations.
// FIX! hadoop/mapr supports other variants? also why isn't port an option on mapr, and why volume?
// port should be optional
Expand Down

0 comments on commit d9fa27b

Please sign in to comment.