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:
parent
c80154014b
commit
fb3e4766d2
|
@ -34,6 +34,7 @@ import org.apache.hadoop.hbase.NotServingRegionException;
|
||||||
import org.apache.hadoop.hbase.UnknownScannerException;
|
import org.apache.hadoop.hbase.UnknownScannerException;
|
||||||
import org.apache.hadoop.hbase.ZooKeeperConnectionException;
|
import org.apache.hadoop.hbase.ZooKeeperConnectionException;
|
||||||
import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitor;
|
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.Bytes;
|
||||||
import org.apache.hadoop.hbase.util.Pair;
|
import org.apache.hadoop.hbase.util.Pair;
|
||||||
import org.apache.hadoop.hbase.util.Writables;
|
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.
|
* @see HBaseAdmin for create, drop, list, enable and disable of tables.
|
||||||
*/
|
*/
|
||||||
public class HTable implements HTableInterface {
|
public class HTable implements HTableInterface {
|
||||||
|
private static final Log LOG = LogFactory.getLog(HTable.class);
|
||||||
private final HConnection connection;
|
private final HConnection connection;
|
||||||
private final byte [] tableName;
|
private final byte [] tableName;
|
||||||
protected final int scannerTimeout;
|
protected final int scannerTimeout;
|
||||||
|
@ -348,9 +350,14 @@ public class HTable implements HTableInterface {
|
||||||
final List<byte[]> endKeyList = new ArrayList<byte[]>();
|
final List<byte[]> endKeyList = new ArrayList<byte[]>();
|
||||||
MetaScannerVisitor visitor = new MetaScannerVisitor() {
|
MetaScannerVisitor visitor = new MetaScannerVisitor() {
|
||||||
public boolean processRow(Result rowResult) throws IOException {
|
public boolean processRow(Result rowResult) throws IOException {
|
||||||
HRegionInfo info = Writables.getHRegionInfo(
|
byte [] bytes = rowResult.getValue(HConstants.CATALOG_FAMILY,
|
||||||
rowResult.getValue(HConstants.CATALOG_FAMILY,
|
HConstants.REGIONINFO_QUALIFIER);
|
||||||
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 (Bytes.equals(info.getTableDesc().getName(), getTableName())) {
|
||||||
if (!(info.isOffline() || info.isSplit())) {
|
if (!(info.isOffline() || info.isSplit())) {
|
||||||
startKeyList.add(info.getStartKey());
|
startKeyList.add(info.getStartKey());
|
||||||
|
|
|
@ -89,7 +89,7 @@ implements Configurable {
|
||||||
this.conf = configuration;
|
this.conf = configuration;
|
||||||
String tableName = conf.get(INPUT_TABLE);
|
String tableName = conf.get(INPUT_TABLE);
|
||||||
try {
|
try {
|
||||||
setHTable(new HTable(HBaseConfiguration.create(conf), tableName));
|
setHTable(new HTable(new Configuration(conf), tableName));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error(StringUtils.stringifyException(e));
|
LOG.error(StringUtils.stringifyException(e));
|
||||||
}
|
}
|
||||||
|
|
|
@ -326,13 +326,12 @@ public class TestTableInputFormatScan {
|
||||||
* @throws ClassNotFoundException
|
* @throws ClassNotFoundException
|
||||||
* @throws InterruptedException
|
* @throws InterruptedException
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
private void testScan(String start, String stop, String last)
|
private void testScan(String start, String stop, String last)
|
||||||
throws IOException, InterruptedException, ClassNotFoundException {
|
throws IOException, InterruptedException, ClassNotFoundException {
|
||||||
String jobName = "Scan" + (start != null ? start.toUpperCase() : "Empty") +
|
String jobName = "Scan" + (start != null ? start.toUpperCase() : "Empty") +
|
||||||
"To" + (stop != null ? stop.toUpperCase() : "Empty");
|
"To" + (stop != null ? stop.toUpperCase() : "Empty");
|
||||||
LOG.info("Before map/reduce startup - job " + jobName);
|
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 scan = new Scan();
|
||||||
scan.addFamily(INPUT_FAMILY);
|
scan.addFamily(INPUT_FAMILY);
|
||||||
if (start != null) {
|
if (start != null) {
|
||||||
|
|
Loading…
Reference in New Issue