hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1347389 - in /hbase/trunk/hbase-server/src: main/java/org/apache/hadoop/hbase/ main/java/org/apache/hadoop/hbase/catalog/ main/java/org/apache/hadoop/hbase/regionserver/ test/java/org/apache/hadoop/hbase/regionserver/
Date Thu, 07 Jun 2012 04:58:53 GMT
Author: stack
Date: Thu Jun  7 04:58:53 2012
New Revision: 1347389

URL: http://svn.apache.org/viewvc?rev=1347389&view=rev
Log:
HBASE-6182 TestStoreFile fails with jdk1.7

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/GetClosestRowBeforeTracker.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java?rev=1347389&r1=1347388&r2=1347389&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/HRegionInfo.java Thu Jun
 7 04:58:53 2012
@@ -147,9 +147,6 @@ implements WritableComparable<HRegionInf
     return encodedRegionName;
   }
 
-  /** delimiter used between portions of a region name */
-  public static final int DELIMITER = ',';
-
   /** HRegionInfo for root region */
   public static final HRegionInfo ROOT_REGIONINFO =
     new HRegionInfo(0L, Bytes.toBytes("-ROOT-"));
@@ -363,12 +360,12 @@ implements WritableComparable<HRegionInf
 
     int offset = tableName.length;
     System.arraycopy(tableName, 0, b, 0, offset);
-    b[offset++] = DELIMITER;
+    b[offset++] = HConstants.REGIONINFO_DELIMITER;
     if (startKey != null && startKey.length > 0) {
       System.arraycopy(startKey, 0, b, offset, startKey.length);
       offset += startKey.length;
     }
-    b[offset++] = DELIMITER;
+    b[offset++] = HConstants.REGIONINFO_DELIMITER;
     System.arraycopy(id, 0, b, offset, id.length);
     offset += id.length;
 
@@ -406,7 +403,7 @@ implements WritableComparable<HRegionInf
   public static byte [] getTableName(byte [] regionName) {
     int offset = -1;
     for (int i = 0; i < regionName.length; i++) {
-      if (regionName[i] == DELIMITER) {
+      if (regionName[i] == HConstants.REGIONINFO_DELIMITER) {
         offset = i;
         break;
       }
@@ -426,7 +423,7 @@ implements WritableComparable<HRegionInf
   throws IOException {
     int offset = -1;
     for (int i = 0; i < regionName.length; i++) {
-      if (regionName[i] == DELIMITER) {
+      if (regionName[i] == HConstants.REGIONINFO_DELIMITER) {
         offset = i;
         break;
       }
@@ -436,7 +433,7 @@ implements WritableComparable<HRegionInf
     System.arraycopy(regionName, 0, tableName, 0, offset);
     offset = -1;
     for (int i = regionName.length - 1; i > 0; i--) {
-      if(regionName[i] == DELIMITER) {
+      if(regionName[i] == HConstants.REGIONINFO_DELIMITER) {
         offset = i;
         break;
       }

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java?rev=1347389&r1=1347388&r2=1347389&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/catalog/MetaReader.java
Thu Jun  7 04:58:53 2012
@@ -454,8 +454,8 @@ public class MetaReader {
   static byte [] getTableStartRowForMeta(final byte [] tableName) {
     byte [] startRow = new byte[tableName.length + 2];
     System.arraycopy(tableName, 0, startRow, 0, tableName.length);
-    startRow[startRow.length - 2] = HRegionInfo.DELIMITER;
-    startRow[startRow.length - 1] = HRegionInfo.DELIMITER;
+    startRow[startRow.length - 2] = HConstants.REGIONINFO_DELIMITER;
+    startRow[startRow.length - 1] = HConstants.REGIONINFO_DELIMITER;
     return startRow;
   }
 

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/GetClosestRowBeforeTracker.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/GetClosestRowBeforeTracker.java?rev=1347389&r1=1347388&r2=1347389&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/GetClosestRowBeforeTracker.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/GetClosestRowBeforeTracker.java
Thu Jun  7 04:58:53 2012
@@ -25,6 +25,7 @@ import java.util.TreeMap;
 import java.util.TreeSet;
 
 import org.apache.hadoop.classification.InterfaceAudience;
+import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValue.KVComparator;
@@ -70,7 +71,7 @@ class GetClosestRowBeforeTracker {
     int l = -1;
     if (metaregion) {
       l = KeyValue.getDelimiter(kv.getBuffer(), rowoffset, kv.getRowLength(),
-        HRegionInfo.DELIMITER) - this.rowoffset;
+	  HConstants.REGIONINFO_DELIMITER) - this.rowoffset;
     }
     this.tablenamePlusDelimiterLength = metaregion? l + 1: -1;
     this.oldestts = System.currentTimeMillis() - ttl;

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java?rev=1347389&r1=1347388&r2=1347389&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestGetClosestAtOrBefore.java
Thu Jun  7 04:58:53 2012
@@ -166,9 +166,9 @@ public class TestGetClosestAtOrBefore ex
 
   private byte [] extractRowFromMetaRow(final byte [] b) {
     int firstDelimiter = KeyValue.getDelimiter(b, 0, b.length,
-      HRegionInfo.DELIMITER);
+        HConstants.REGIONINFO_DELIMITER);
     int lastDelimiter = KeyValue.getDelimiterInReverse(b, 0, b.length,
-      HRegionInfo.DELIMITER);
+        HConstants.REGIONINFO_DELIMITER);
     int length = lastDelimiter - firstDelimiter - 1;
     byte [] row = new byte[length];
     System.arraycopy(b, firstDelimiter + 1, row, 0, length);

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java?rev=1347389&r1=1347388&r2=1347389&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreFile.java
Thu Jun  7 04:58:53 2012
@@ -369,7 +369,7 @@ public class TestStoreFile extends HBase
     int falseNeg = 0;
     for (int i = 0; i < 2000; i++) {
       String row = String.format(localFormatter, i);
-      TreeSet<byte[]> columns = new TreeSet<byte[]>();
+      TreeSet<byte[]> columns = new TreeSet<byte[]>(Bytes.BYTES_COMPARATOR);
       columns.add("family:col".getBytes());
 
       Scan scan = new Scan(row.getBytes(),row.getBytes());
@@ -528,7 +528,7 @@ public class TestStoreFile extends HBase
         for (int j = 0; j < colCount*2; ++j) {   // column qualifiers
           String row = String.format(localFormatter, i);
           String col = String.format(localFormatter, j);
-          TreeSet<byte[]> columns = new TreeSet<byte[]>();
+          TreeSet<byte[]> columns = new TreeSet<byte[]>(Bytes.BYTES_COMPARATOR);
           columns.add(("col" + col).getBytes());
 
           Scan scan = new Scan(row.getBytes(),row.getBytes());
@@ -712,7 +712,7 @@ public class TestStoreFile extends HBase
         StoreFile.BloomType.NONE, NoOpDataBlockEncoder.INSTANCE);
     StoreFile.Reader reader = hsf.createReader();
     StoreFileScanner scanner = reader.getStoreFileScanner(false, false);
-    TreeSet<byte[]> columns = new TreeSet<byte[]>();
+    TreeSet<byte[]> columns = new TreeSet<byte[]>(Bytes.BYTES_COMPARATOR);
     columns.add(qualifier);
 
     scan.setTimeRange(20, 100);



Mime
View raw message