diff --git a/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseTableInputFormat.java b/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseTableInputFormat.java index 2f1815876957fb5a9f42c574c143835878688c3b..b392bc6363f1804af890b3088fb3cf5b97062ee0 100644 --- a/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseTableInputFormat.java +++ b/hbase-handler/src/java/org/apache/hadoop/hive/hbase/HiveHBaseTableInputFormat.java @@ -84,6 +84,7 @@ implements InputFormat { static final Log LOG = LogFactory.getLog(HiveHBaseTableInputFormat.class); + private static final Object hbaseTableMonitor = new Object(); @Override public RecordReader getRecordReader( @@ -424,9 +425,15 @@ static IndexPredicateAnalyzer newIndexPredicateAnalyzer( return analyzer; } - + @Override public InputSplit[] getSplits(JobConf jobConf, int numSplits) throws IOException { + synchronized (hbaseTableMonitor) { + return getSplitsInternal(jobConf, numSplits); + } + } + + private InputSplit[] getSplitsInternal(JobConf jobConf, int numSplits) throws IOException { //obtain delegation tokens for the job if (UserGroupInformation.getCurrentUser().hasKerberosCredentials()) {