Skip to content
Browse files

Fixed Wonderdog for Pig 0.10 by checking the conf object if the call …

…to the hadoop cache misses
  • Loading branch information...
1 parent 9db09cf commit d061ee5fcbb366061f7ed0e48c971352b8bde644 @rjurney committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/main/java/com/infochimps/elasticsearch/ElasticSearchOutputFormat.java
View
6 src/main/java/com/infochimps/elasticsearch/ElasticSearchOutputFormat.java
@@ -120,7 +120,8 @@ public ElasticSearchRecordWriter(TaskAttemptContext context) {
this.objType = conf.get(ES_OBJECT_TYPE);
//
- // Fetches elasticsearch.yml and the plugins directory from the distributed cache
+ // Fetches elasticsearch.yml and the plugins directory from the distributed cache, or
+ // from the local config.
//
try {
String taskConfigPath = HadoopUtils.fetchFileFromCache(ES_CONFIG_NAME, conf);
@@ -130,7 +131,8 @@ public ElasticSearchRecordWriter(TaskAttemptContext context) {
System.setProperty(ES_CONFIG, taskConfigPath);
System.setProperty(ES_PLUGINS, taskPluginsPath+SLASH+ES_PLUGINS_NAME);
} catch (Exception e) {
- throw new RuntimeException(e);
+ System.setProperty(ES_CONFIG,conf.get(ES_CONFIG));
+ System.setProperty(ES_PLUGINS,conf.get(ES_PLUGINS));
}
start_embedded_client();

0 comments on commit d061ee5

Please sign in to comment.
Something went wrong with that request. Please try again.