Permalink
Browse files

Bug fixes in HdfsFetcher revealed by HdfsFetcherTest (NPE and hiding …

…the VoldemortSerializationException)
  • Loading branch information...
1 parent f97699b commit 3b6c28255127400cf8c79f788411b4c966e8926c Chinmay Soman committed Jan 14, 2013
@@ -149,7 +149,11 @@ public HdfsFetcher(DynamicThrottleLimit dynThrottleLimit,
}
public File fetch(String sourceFileUrl, String destinationFile) throws IOException {
- return fetch(sourceFileUrl, destinationFile, this.voldemortConfig.getHadoopConfigPath());
+ String hadoopConfigPath = "";
+ if(this.voldemortConfig != null) {
+ hadoopConfigPath = this.voldemortConfig.getHadoopConfigPath();
+ }
+ return fetch(sourceFileUrl, destinationFile, hadoopConfigPath);
}
public File fetch(String sourceFileUrl, String destinationFile, String hadoopConfigPath)
@@ -274,7 +278,7 @@ public FileSystem run() throws Exception {
} else {
return null;
}
- } catch(Exception e) {
+ } catch(IOException e) {
logger.error("Error while getting Hadoop filesystem : " + e);
return null;
} finally {

0 comments on commit 3b6c282

Please sign in to comment.