Skip to content

Commit

Permalink
Merge pull request apache#53 from sahilTakiar/master
Browse files Browse the repository at this point in the history
Fixing build and find bugs warnings
  • Loading branch information
sahilTakiar committed Mar 16, 2015
2 parents 790bb7b + 84cc397 commit beab089
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ subprojects {
}
}

if (isDefaultEnvironment && !project.name.equals('gobblin-compaction')) {
if (isDefaultEnvironment) {
task sourcesJar(type: Jar, dependsOn: classes) {
from sourceSets.main.allSource
classifier = 'sources'
Expand Down
4 changes: 3 additions & 1 deletion gobblin-compaction/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ task createCompactionTar(type: Tar) {

createCompactionTar.dependsOn ':gobblin-compaction:jar'

artifacts { archives createCompactionTar }
artifacts {
archives createCompactionTar
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.sql.PreparedStatement;
Expand Down Expand Up @@ -88,7 +90,7 @@ public static HiveJdbcConnector newConnectorWithProps(Properties compactRunProps

// Set the Hive Server type
if (compactRunProps.containsKey(HIVESERVER_VERSION)) {
hiveJdbcConnector.withHiveServerVersion(Integer.valueOf(compactRunProps.getProperty(HIVESERVER_VERSION, DEFAULT_HIVESERVER_VERSION)));
hiveJdbcConnector.withHiveServerVersion(Integer.parseInt(compactRunProps.getProperty(HIVESERVER_VERSION, DEFAULT_HIVESERVER_VERSION)));
}

// Add the Hive Site Dir to the classpath
Expand Down Expand Up @@ -189,8 +191,16 @@ private void addHiveSiteDirToClasspath(String hiveSiteDir) {
Method method = urlClass.getDeclaredMethod("addURL", new Class[] { URL.class });
method.setAccessible(true);
method.invoke(urlClassLoader, new Object[] { u });
} catch (Exception e) {
throw new RuntimeException("Unable to add hive.site.dir to CLASSPATH");
} catch (NoSuchMethodException e) {
throw new RuntimeException("Unable to add hive.site.dir to CLASSPATH", e);
} catch (IllegalArgumentException e) {
throw new RuntimeException("Unable to add hive.site.dir to CLASSPATH", e);
} catch (IllegalAccessException e) {
throw new RuntimeException("Unable to add hive.site.dir to CLASSPATH", e);
} catch (InvocationTargetException e) {
throw new RuntimeException("Unable to add hive.site.dir to CLASSPATH", e);
} catch (MalformedURLException e) {
throw new RuntimeException("Unable to add hive.site.dir to CLASSPATH", e);
}
}

Expand Down

0 comments on commit beab089

Please sign in to comment.