diff --git a/hadoop-unit-client/hadoop-unit-client-spark/pom.xml b/hadoop-unit-client/hadoop-unit-client-spark/pom.xml index 1cfcb7b7..174d4d09 100644 --- a/hadoop-unit-client/hadoop-unit-client-spark/pom.xml +++ b/hadoop-unit-client/hadoop-unit-client-spark/pom.xml @@ -18,12 +18,6 @@ org.apache.spark spark-core_2.10 - - - jackson-module-scala_2.10 - com.fasterxml.jackson.module - - @@ -39,7 +33,6 @@ jackson-module-scala_2.10 com.fasterxml.jackson.module - 2.6.5 diff --git a/hadoop-unit-commons/pom.xml b/hadoop-unit-commons/pom.xml index 94b3b86c..fd7364b6 100644 --- a/hadoop-unit-commons/pom.xml +++ b/hadoop-unit-commons/pom.xml @@ -44,6 +44,16 @@ httpclient + + org.slf4j + jcl-over-slf4j + + + + org.slf4j + log4j-over-slf4j + + org.slf4j slf4j-api diff --git a/hadoop-unit-commons/src/main/java/com/github/sakserv/propertyparser/PropertyParser.java b/hadoop-unit-commons/src/main/java/com/github/sakserv/propertyparser/PropertyParser.java new file mode 100644 index 00000000..690371cd --- /dev/null +++ b/hadoop-unit-commons/src/main/java/com/github/sakserv/propertyparser/PropertyParser.java @@ -0,0 +1,71 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.github.sakserv.propertyparser; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +public class PropertyParser { + + private static final Logger LOG = LoggerFactory.getLogger(PropertyParser.class); + + private Properties props = new Properties(); + private String propFileName; + + public PropertyParser(String propFileName) { + this.propFileName = propFileName; + } + + public String getPropFileName() { + return propFileName; + } + + public void setPropFileName(String propFileName) { + this.propFileName = propFileName; + } + + public String getProperty(String key) { + return props.get(key).toString(); + } + + public void parsePropsFile() throws IOException { + + InputStream inputStream = getClass().getClassLoader().getResourceAsStream(propFileName); + + try { + if (null != inputStream) { + props.load(inputStream); + } else { + throw new IOException("Could not load property file from the resources directory, trying local"); + } + } catch(IOException e) { + LOG.error(e.getMessage()); + e.printStackTrace(); + try { + inputStream = new FileInputStream(new File(propFileName).getAbsolutePath()); + props.load(inputStream); + } catch (IOException ex) { + LOG.error("Could not load property file at " + new File(propFileName).getAbsolutePath()); + ex.printStackTrace(); + throw ex; + } + } + } +} \ No newline at end of file diff --git a/hadoop-unit-standalone/hadoop-unit-standalone-elasticsearch/src/main/conf/logback.xml b/hadoop-unit-standalone/hadoop-unit-standalone-elasticsearch/src/main/conf/logback.xml index bdcfede2..8329aeb7 100755 --- a/hadoop-unit-standalone/hadoop-unit-standalone-elasticsearch/src/main/conf/logback.xml +++ b/hadoop-unit-standalone/hadoop-unit-standalone-elasticsearch/src/main/conf/logback.xml @@ -7,6 +7,8 @@ + + diff --git a/hadoop-unit-standalone/hadoop-unit-standalone-solr/pom.xml b/hadoop-unit-standalone/hadoop-unit-standalone-solr/pom.xml index c2bf9bbe..407a768f 100644 --- a/hadoop-unit-standalone/hadoop-unit-standalone-solr/pom.xml +++ b/hadoop-unit-standalone/hadoop-unit-standalone-solr/pom.xml @@ -34,29 +34,6 @@ - - - - - - - - - - - - - - - - - - - - - - - org.codehaus.mojo appassembler-maven-plugin @@ -131,8 +108,6 @@ -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -server - - -XX:+HeapDumpOnOutOfMemoryError diff --git a/hadoop-unit-standalone/hadoop-unit-standalone-solr/src/main/conf/logback.xml b/hadoop-unit-standalone/hadoop-unit-standalone-solr/src/main/conf/logback.xml index bdcfede2..8329aeb7 100755 --- a/hadoop-unit-standalone/hadoop-unit-standalone-solr/src/main/conf/logback.xml +++ b/hadoop-unit-standalone/hadoop-unit-standalone-solr/src/main/conf/logback.xml @@ -7,6 +7,8 @@ + + diff --git a/hadoop-unit-standalone/pom.xml b/hadoop-unit-standalone/pom.xml index 16e160e7..ce6befb4 100644 --- a/hadoop-unit-standalone/pom.xml +++ b/hadoop-unit-standalone/pom.xml @@ -26,6 +26,12 @@ fr.jetoile.hadoop hadoop-unit-commons + + + org.slf4j + log4j-over-slf4j + + diff --git a/pom.xml b/pom.xml index cb69b536..7ef580dc 100755 --- a/pom.xml +++ b/pom.xml @@ -143,6 +143,7 @@ 5.0.0-alpha3 3.1.2 4.2.0 + 2.6.5 @@ -159,6 +160,16 @@ org.apache.hive hive-jdbc ${hive.version} + + + log4j + log4j + + + slf4j-log4j12 + org.slf4j + + @@ -283,6 +294,12 @@ info.archinnov achilles-embedded ${achilles.version} + + + jboss-logging + org.jboss.logging + + @@ -330,6 +347,14 @@ guava com.google.guava + + log4j + log4j + + + slf4j-log4j12 + org.slf4j + @@ -343,6 +368,8 @@ org.apache.httpcomponents httpclient ${httpclient.version} + + @@ -354,6 +381,14 @@ servlet-api javax.servlet + + log4j + log4j + + + slf4j-log4j12 + org.slf4j + @@ -398,6 +433,10 @@ com.googlecode.concurrentlinkedhashmap concurrentlinkedhashmap-lru + + log4j + log4j + @@ -438,6 +477,22 @@ hive-jdbc org.apache.hive + + log4j + log4j + + + slf4j-simple + org.slf4j + + + slf4j-log4j12 + org.slf4j + + + property-parser + com.github.sakserv + @@ -469,12 +524,24 @@ com.github.sakserv hadoop-mini-clusters-mapreduce ${hadoop-mini-clusters.version} + + + org.slf4j + slf4j-log4j12 + + com.github.sakserv hadoop-mini-clusters-yarn ${hadoop-mini-clusters.version} + + + org.slf4j + slf4j-log4j12 + + @@ -493,12 +560,32 @@ org.apache.kafka kafka_2.10 ${kafka_2.10.version} + + + log4j + log4j + + + slf4j-log4j12 + org.slf4j + + com.github.sakserv hadoop-mini-clusters-hivemetastore ${hadoop-mini-clusters.version} + + + log4j + log4j + + + slf4j-log4j12 + org.slf4j + + @@ -510,6 +597,10 @@ jetty-all org.eclipse.jetty.aggregate + + slf4j-log4j12 + org.slf4j + @@ -522,6 +613,14 @@ servlet-api javax.servlet + + log4j + log4j + + + slf4j-log4j12 + org.slf4j + @@ -586,9 +685,31 @@ hadoop-client org.apache.hadoop + + slf4j-log4j12 + org.slf4j + + + jackson-module-scala_2.10 + com.fasterxml.jackson.module + + + log4j + log4j + + + jul-to-slf4j + org.slf4j + + + jackson-module-scala_2.10 + com.fasterxml.jackson.module + ${jackson-module-scala_2.10.version} + + org.apache.spark spark-sql_2.10 @@ -637,6 +758,18 @@ ${slf4j.version} + + org.slf4j + jcl-over-slf4j + ${slf4j.version} + + + + org.slf4j + log4j-over-slf4j + ${slf4j.version} + + ch.qos.logback logback-classic