Permalink
Browse files

Fixed the problem with NullPointerException masking the actual proble…

…m with the connection.

git-svn-id: https://hadoopdb.svn.sourceforge.net/svnroot/hadoopdb/trunk@22 2ab80ee8-dcc6-4802-a23e-3bfff869ab2a
  • Loading branch information...
1 parent 44057bb commit f4ed1e394b35d4e7995fe336be90ca9f2021452d kbajda committed Nov 15, 2010
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/java/edu/yale/cs/hadoopdb/connector/AbstractDBRecordReader.java
@@ -161,8 +161,11 @@ protected Connection getConnection(DBInputSplit dbSplit) {
LOG.info("Data locality failed for " + localHostAddr);
chunk_host = chunk.getAnyHost(avoid_host);
} else {
- if (avoid_host != chunk.getHost(localHostAddr))
+ if (avoid_host != chunk.getHost(localHostAddr)) {
chunk_host = chunk.getHost(localHostAddr);
+ } else {
+ chunk_host = chunk.getAnyHost(avoid_host);
+ }
}
LOG.info("Task from " + localHostAddr + " is connecting to chunk "
+ chunk.getId() + " on host " + chunk_host.getHost()

0 comments on commit f4ed1e3

Please sign in to comment.