HBASE-14662 Fix NPE in HFileOutputFormat2 (Heng Chen)

This commit is contained in:
stack 2015-10-21 21:48:47 -07:00
parent 97fc755013
commit 35c34ba84e
1 changed files with 9 additions and 8 deletions

View File

@ -209,7 +209,7 @@ public class HFileOutputFormat2
if (conf.getBoolean(LOCALITY_SENSITIVE_CONF_KEY, DEFAULT_LOCALITY_SENSITIVE)) {
HRegionLocation loc = null;
String tableName = conf.get(OUTPUT_TABLE_NAME_CONF_KEY);
if (tableName != null) {
try (Connection connection = ConnectionFactory.createConnection(conf);
RegionLocator locator =
connection.getRegionLocator(TableName.valueOf(tableName))) {
@ -219,6 +219,7 @@ public class HFileOutputFormat2
Bytes.toString(rowKey), e);
loc = null;
}
}
if (null == loc) {
if (LOG.isTraceEnabled()) {