/** * Constructor. * * @param home Hadoop home. * @param common Common home. * @param hdfs HDFS home. * @param mapred Mapred home. */ public HadoopLocations(String home, String common, String hdfs, String mapred) { assert common != null && hdfs != null && mapred != null; this.home = home; this.common = common; this.hdfs = hdfs; this.mapred = mapred; commonExists = HadoopClasspathUtils.exists(common); hdfsExists = HadoopClasspathUtils.exists(hdfs); mapredExists = HadoopClasspathUtils.exists(mapred); }
/** * Constructor. * * @param dir Directory. * @param filter Filter. * @param strict Whether directory must exist. * @throws IOException If failed. */ private SearchDirectory(File dir, DirectoryFilter filter, boolean strict) throws IOException { this.dir = dir; this.filter = filter; this.strict = strict; if (strict && !exists(dir.getAbsolutePath())) throw new IOException("Directory cannot be read: " + dir.getAbsolutePath()); }
if (!exists(hadoopHome)) throw new IOException("Failed to resolve Hadoop classpath because " + HOME + " environment " + "variable points to nonexistent directory: " + hadoopHome);
/** * Constructor. * * @param home Hadoop home. * @param common Common home. * @param hdfs HDFS home. * @param mapred Mapred home. */ public HadoopLocations(String home, String common, String hdfs, String mapred) { assert common != null && hdfs != null && mapred != null; this.home = home; this.common = common; this.hdfs = hdfs; this.mapred = mapred; commonExists = HadoopClasspathUtils.exists(common); hdfsExists = HadoopClasspathUtils.exists(hdfs); mapredExists = HadoopClasspathUtils.exists(mapred); }
/** * Constructor. * * @param dir Directory. * @param filter Filter. * @param strict Whether directory must exist. * @throws IOException If failed. */ private SearchDirectory(File dir, DirectoryFilter filter, boolean strict) throws IOException { this.dir = dir; this.filter = filter; this.strict = strict; if (strict && !exists(dir.getAbsolutePath())) throw new IOException("Directory cannot be read: " + dir.getAbsolutePath()); }
if (!exists(hadoopHome)) throw new IOException("Failed to resolve Hadoop classpath because " + HOME + " environment " + "variable points to nonexistent directory: " + hadoopHome);