You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2011/10/28 01:16:50 UTC

svn commit: r1190080 - /hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java

Author: stack
Date: Thu Oct 27 23:16:49 2011
New Revision: 1190080

URL: http://svn.apache.org/viewvc?rev=1190080&view=rev
Log:
Added debug to figure why this TestRegionServerCoprocessorExceptionWithRemove is failing with ArrayIndexOutOfBoundsException though we just checked the List size is > 0

Modified:
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java?rev=1190080&r1=1190079&r2=1190080&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java Thu Oct 27 23:16:49 2011
@@ -1123,10 +1123,14 @@ public class HBaseTestingUtility {
   public HRegionServer getRSForFirstRegionInTable(byte[] tableName)
       throws IOException {
     List<byte[]> metaRows = getMetaTableRows(tableName);
-    if (metaRows == null || metaRows.size() == 0) {
+    if (metaRows == null || metaRows.isEmpty()) {
       return null;
     }
-    int index = hbaseCluster.getServerWith(metaRows.get(0));
+    LOG.debug("Found " + metaRows.size() + " rows for table " +
+      Bytes.toString(tableName));
+    byte [] firstrow = metaRows.get(0);
+    LOG.debug("FirstRow=" + Bytes.toString(firstrow));
+    int index = hbaseCluster.getServerWith(firstrow);
     return hbaseCluster.getRegionServerThreads().get(index).getRegionServer();
   }