Logging to see if can figure why the TestTableInputFormatScan failures up on hudson

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1021237 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-10-11 03:38:26 +00:00
parent c80154014b
commit fb3e4766d2
3 changed files with 13 additions and 7 deletions

View File

@ -34,6 +34,7 @@ import org.apache.hadoop.hbase.NotServingRegionException;
import org.apache.hadoop.hbase.UnknownScannerException;
import org.apache.hadoop.hbase.ZooKeeperConnectionException;
import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitor;
import org.apache.hadoop.hbase.mapreduce.TestTableInputFormatScan;
import org.apache.hadoop.hbase.util.Bytes;
import org.apache.hadoop.hbase.util.Pair;
import org.apache.hadoop.hbase.util.Writables;
@ -81,6 +82,7 @@ import java.io.DataOutput;
* @see HBaseAdmin for create, drop, list, enable and disable of tables.
*/
public class HTable implements HTableInterface {
private static final Log LOG = LogFactory.getLog(HTable.class);
private final HConnection connection;
private final byte [] tableName;
protected final int scannerTimeout;
@ -348,9 +350,14 @@ public class HTable implements HTableInterface {
final List<byte[]> endKeyList = new ArrayList<byte[]>();
MetaScannerVisitor visitor = new MetaScannerVisitor() {
public boolean processRow(Result rowResult) throws IOException {
HRegionInfo info = Writables.getHRegionInfo(
rowResult.getValue(HConstants.CATALOG_FAMILY,
HConstants.REGIONINFO_QUALIFIER));
byte [] bytes = rowResult.getValue(HConstants.CATALOG_FAMILY,
HConstants.REGIONINFO_QUALIFIER);
if (bytes == null) {
LOG.warn("Null " + HConstants.REGIONINFO_QUALIFIER + " cell in " +
rowResult);
return true;
}
HRegionInfo info = Writables.getHRegionInfo(bytes);
if (Bytes.equals(info.getTableDesc().getName(), getTableName())) {
if (!(info.isOffline() || info.isSplit())) {
startKeyList.add(info.getStartKey());

View File

@ -89,7 +89,7 @@ implements Configurable {
this.conf = configuration;
String tableName = conf.get(INPUT_TABLE);
try {
setHTable(new HTable(HBaseConfiguration.create(conf), tableName));
setHTable(new HTable(new Configuration(conf), tableName));
} catch (Exception e) {
LOG.error(StringUtils.stringifyException(e));
}

View File

@ -326,13 +326,12 @@ public class TestTableInputFormatScan {
* @throws ClassNotFoundException
* @throws InterruptedException
*/
@SuppressWarnings("deprecation")
private void testScan(String start, String stop, String last)
throws IOException, InterruptedException, ClassNotFoundException {
String jobName = "Scan" + (start != null ? start.toUpperCase() : "Empty") +
"To" + (stop != null ? stop.toUpperCase() : "Empty");
LOG.info("Before map/reduce startup - job " + jobName);
Configuration c = TEST_UTIL.getConfiguration();
Configuration c = new Configuration(TEST_UTIL.getConfiguration());
Scan scan = new Scan();
scan.addFamily(INPUT_FAMILY);
if (start != null) {
@ -356,4 +355,4 @@ public class TestTableInputFormatScan {
assertTrue(job.isComplete());
LOG.info("After map/reduce completion - job " + jobName);
}
}
}