Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
56 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 11 additions & 8 deletions
19
common/common-core/src/main/java/dk/netarkivet/common/utils/HadoopUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
package dk.netarkivet.common.utils; | ||
|
||
import org.apache.hadoop.conf.Configuration; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import dk.netarkivet.common.CommonSettings; | ||
|
||
public class HadoopUtils { | ||
/** The class logger. */ | ||
private static Logger log = LoggerFactory.getLogger(HadoopUtils.class); | ||
public static final String DEFAULT_FILESYSTEM = "fs.defaultFS"; | ||
public static final String MAPREDUCE_FRAMEWORK = "mapreduce.framework.name"; | ||
public static final String YARN_RESOURCEMANAGER_ADDRESS = "yarn.resourcemanager.address"; | ||
|
||
public Configuration getConf() { | ||
/** Utility class, do not initialise. */ | ||
private HadoopUtils() { | ||
} | ||
|
||
public static Configuration getConfFromSettings() { | ||
Configuration conf = new Configuration(); | ||
conf.set("fs.defaultFS", Settings.get(CommonSettings.HADOOP_HDFS)); | ||
//conf.set("mapreduce.framework.name", Settings.get(CommonSettings.HADOOP_MAPRED_FRAMEWORK)); | ||
//conf.set("yarn.resourcemanager.address", Settings.get(CommonSettings.HADOOP_RESOURCEMANAGER_ADDRESS)); | ||
conf.set(DEFAULT_FILESYSTEM, Settings.get(CommonSettings.HADOOP_DEFAULT_FS)); | ||
conf.set(MAPREDUCE_FRAMEWORK, Settings.get(CommonSettings.HADOOP_MAPRED_FRAMEWORK)); | ||
conf.set(YARN_RESOURCEMANAGER_ADDRESS, Settings.get(CommonSettings.HADOOP_RESOURCEMANAGER_ADDRESS)); | ||
return conf; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters