Skip to content

Commit

Permalink
Removes play dependencies to read config file and read system propert…
Browse files Browse the repository at this point in the history
…ies. (linkedin#183)
  • Loading branch information
shkhrgpt authored and akshayrai committed Jan 8, 2017
1 parent 780e56e commit b5d80ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions app/com/linkedin/drelephant/security/HadoopSecurity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.io.File;
import java.io.IOException;
import java.security.PrivilegedAction;
import play.Play;


/**
Expand All @@ -46,13 +45,13 @@ public HadoopSecurity() throws IOException {
logger.info("This cluster is Kerberos enabled.");
boolean login = true;

_keytabUser = Play.application().configuration().getString("keytab.user");
_keytabUser = System.getProperty("keytab.user");
if (_keytabUser == null) {
logger.error("Keytab user not set. Please set keytab_user in the configuration file");
login = false;
}

_keytabLocation = Play.application().configuration().getString("keytab.location");
_keytabLocation = System.getProperty("keytab.location");
if (_keytabLocation == null) {
logger.error("Keytab location not set. Please set keytab_location in the configuration file");
login = false;
Expand Down
5 changes: 2 additions & 3 deletions app/com/linkedin/drelephant/util/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
import play.Play;
import java.util.List;
import java.util.ArrayList;
import java.util.Comparator;
Expand Down Expand Up @@ -77,7 +76,7 @@ public static String getJobIdFromApplicationId(String appId) {
public static Document loadXMLDoc(String filePath) {
InputStream instream = null;
logger.info("Loading configuration file " + filePath);
instream = Play.application().resourceAsStream(filePath);
instream = ClassLoader.getSystemClassLoader().getResourceAsStream(filePath);

if (instream == null) {
logger.info("Configuation file not present in classpath. File: " + filePath);
Expand Down Expand Up @@ -414,7 +413,7 @@ public static Map<String, String> getConfigurationParameters(Element confElem) {
}
return paramsMap;
}

/* Returns the total resources used by the job list
* @param resultList The job lsit
* @return The total resources used by the job list
Expand Down

0 comments on commit b5d80ba

Please sign in to comment.