hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1453175 - in /hbase/trunk: hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
Date Wed, 06 Mar 2013 07:09:26 GMT
Author: stack
Date: Wed Mar  6 07:09:26 2013
New Revision: 1453175

URL: http://svn.apache.org/r1453175
Log:
HBASE-7928 Scanning .META. with startRow and/or stopRow is not giving proper results; REVERT.
 NEEDS SOME MORE WORK

Modified:
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java
    hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java?rev=1453175&r1=1453174&r2=1453175&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java (original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java Wed
Mar  6 07:09:26 2013
@@ -529,30 +529,9 @@ public class HTable implements HTableInt
     if (scan.getCaching() <= 0) {
       scan.setCaching(getScannerCaching());
     }
-    if (Bytes.equals(this.getTableName(), HConstants.META_TABLE_NAME)) {
-      changeStartAndStopRowIfMeta(scan);
-    }
-
     return new ClientScanner(getConfiguration(), scan, getTableName(),
         this.connection);
   }
-  private void changeStartAndStopRowIfMeta(final Scan scan) {
-    if (scan.getStartRow() != null && scan.getStartRow().length != 0
-        && !isValidMetaTableRow(scan.getStartRow())) {
-      scan.setStartRow(Bytes.add(scan.getStartRow(), HConstants.META_ROW_DELIMITER_BYTES,
-          Bytes.toBytes(HConstants.ZEROES)));
-    }
-    if (scan.getStopRow() != null && scan.getStopRow().length != 0
-        && !isValidMetaTableRow(scan.getStopRow())) {
-      scan.setStopRow(Bytes.add(scan.getStopRow(), HConstants.META_ROW_DELIMITER_BYTES,
-          Bytes.toBytes(HConstants.NINES)));
-    }
-  }
-
-  private boolean isValidMetaTableRow(byte[] metaRow) {
-    return (com.google.common.primitives.Bytes
-        .indexOf(metaRow, HConstants.META_ROW_DELIMITER_BYTES) != -1);
-  }
 
   /**
    * {@inheritDoc}

Modified: hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java?rev=1453175&r1=1453174&r2=1453175&view=diff
==============================================================================
--- hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java (original)
+++ hbase/trunk/hbase-common/src/main/java/org/apache/hadoop/hbase/HConstants.java Wed Mar
 6 07:09:26 2013
@@ -358,8 +358,6 @@ public final class HConstants {
 
   /** delimiter used between portions of a region name */
   public static final int META_ROW_DELIMITER = ',';
-  
-  public static final byte[] META_ROW_DELIMITER_BYTES = Bytes.toBytes(",,");
 
   /** The catalog family as a string*/
   public static final String CATALOG_FAMILY_STR = "info";

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java?rev=1453175&r1=1453174&r2=1453175&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java Wed
Mar  6 07:09:26 2013
@@ -536,38 +536,6 @@ public class TestAdmin {
       assertTrue(regionList.size() == min || regionList.size() == max);
     }
   }
-  
-  @Test
-  public void testHBASE7928() throws Exception {
-    final byte[] tableName = Bytes.toBytes("a");
-    final byte[] tableName1 = Bytes.toBytes("b");
-    final byte[] tableName2 = Bytes.toBytes("c");
-    try {
-
-      TEST_UTIL.createTable(tableName, HConstants.CATALOG_FAMILY).close();
-
-      TEST_UTIL.createTable(tableName1, HConstants.CATALOG_FAMILY).close();
-
-      TEST_UTIL.createTable(tableName2, HConstants.CATALOG_FAMILY).close();
-      while (!admin.isTableAvailable(tableName2)) {
-        Thread.sleep(1);
-      }
-      Scan s = new Scan();
-      s.setStartRow(Bytes.toBytes("a1"));
-      s.setStopRow(Bytes.toBytes("b1"));
-      HTable table = new HTable(admin.getConfiguration(), HConstants.META_TABLE_NAME);
-      ResultScanner scanner = table.getScanner(s);
-      Result[] result = scanner.next(5);
-      assertEquals("Only one row should be selected", 1, result.length);
-    } finally {
-      admin.disableTable(tableName);
-      admin.deleteTable(tableName);
-      admin.disableTable(tableName1);
-      admin.deleteTable(tableName1);
-      admin.disableTable(tableName2);
-      admin.deleteTable(tableName2);
-    }
-  }
 
   @Test
   public void testCreateTableWithRegions() throws IOException, InterruptedException {



Mime
View raw message