hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject svn commit: r1521676 [2/2] - in /hbase/trunk: hbase-client/src/main/java/org/apache/hadoop/hbase/client/ hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/ hbase-common/src/main/java/org/apache/hadoop/hbase/ hbase-examples/src/main/...
Date Tue, 10 Sep 2013 23:05:51 GMT
Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java
Tue Sep 10 23:05:50 2013
@@ -249,7 +249,7 @@ public class TestHRegion extends HBaseTe
     List<Cell> results = new ArrayList<Cell>();
     scanner1.next(results);
     Cell keyValue = results.get(0);
-    Assert.assertTrue(Bytes.compareTo(CellUtil.getRowArray(keyValue), Bytes.toBytes("r2"))
== 0);
+    Assert.assertTrue(Bytes.compareTo(CellUtil.cloneRow(keyValue), Bytes.toBytes("r2")) ==
0);
     scanner1.close();
   }
 
@@ -296,7 +296,7 @@ public class TestHRegion extends HBaseTe
       for (long i = minSeqId; i <= maxSeqId; i += 10) {
         List<Cell> kvs = result.getColumn(family, Bytes.toBytes(i));
         assertEquals(1, kvs.size());
-        assertEquals(Bytes.toBytes(i), CellUtil.getValueArray(kvs.get(0)));
+        assertEquals(Bytes.toBytes(i), CellUtil.cloneValue(kvs.get(0)));
       }
     } finally {
       HRegion.closeHRegion(this.region);
@@ -352,7 +352,7 @@ public class TestHRegion extends HBaseTe
           assertEquals(0, kvs.size());
         } else {
           assertEquals(1, kvs.size());
-          assertEquals(Bytes.toBytes(i), CellUtil.getValueArray(kvs.get(0)));
+          assertEquals(Bytes.toBytes(i), CellUtil.cloneValue(kvs.get(0)));
         }
       }
     } finally {
@@ -678,7 +678,7 @@ public class TestHRegion extends HBaseTe
         count++;
       else
         break;
-      Delete delete = new Delete(CellUtil.getRowArray(results.get(0)));
+      Delete delete = new Delete(CellUtil.cloneRow(results.get(0)));
       delete.deleteColumn(Bytes.toBytes("trans-tags"), Bytes.toBytes("qual2"));
       r.delete(delete);
       results.clear();
@@ -696,7 +696,7 @@ public class TestHRegion extends HBaseTe
       if (results != null && !results.isEmpty()) numberOfResults++;
       else break;
       for (Cell kv: results) {
-        System.out.println("kv=" + kv.toString() + ", " + Bytes.toString(CellUtil.getValueArray(kv)));
+        System.out.println("kv=" + kv.toString() + ", " + Bytes.toString(CellUtil.cloneValue(kv)));
       }
       results.clear();
     } while(more);
@@ -1542,10 +1542,10 @@ public class TestHRegion extends HBaseTe
       assertEquals(1, results.size());
       Cell kv = results.get(0);
 
-      assertByteEquals(value2, CellUtil.getValueArray(kv));
-      assertByteEquals(fam1, CellUtil.getFamilyArray(kv));
-      assertByteEquals(qual1, CellUtil.getQualifierArray(kv));
-      assertByteEquals(row, CellUtil.getRowArray(kv));
+      assertByteEquals(value2, CellUtil.cloneValue(kv));
+      assertByteEquals(fam1, CellUtil.cloneFamily(kv));
+      assertByteEquals(qual1, CellUtil.cloneQualifier(kv));
+      assertByteEquals(row, CellUtil.cloneRow(kv));
     } finally {
       HRegion.closeHRegion(this.region);
       this.region = null;
@@ -2367,7 +2367,7 @@ public class TestHRegion extends HBaseTe
     assertEquals(1, result.size());
 
     Cell kv = result.rawCells()[0];
-    long r = Bytes.toLong(CellUtil.getValueArray(kv));
+    long r = Bytes.toLong(CellUtil.cloneValue(kv));
     assertEquals(amount, r);
   }
 
@@ -2382,7 +2382,7 @@ public class TestHRegion extends HBaseTe
     assertEquals(1, result.size());
 
     Cell kv = result.rawCells()[0];
-    int r = Bytes.toInt(CellUtil.getValueArray(kv));
+    int r = Bytes.toInt(CellUtil.cloneValue(kv));
     assertEquals(amount, r);
   }
 
@@ -3128,16 +3128,16 @@ public class TestHRegion extends HBaseTe
           Cell previousKV = null;
 
           for (Cell kv : result.rawCells()) {
-            byte[] thisValue = CellUtil.getValueArray(kv);
+            byte[] thisValue = CellUtil.cloneValue(kv);
             if (previousKV != null) {
-              if (Bytes.compareTo(CellUtil.getValueArray(previousKV), thisValue) != 0) {
+              if (Bytes.compareTo(CellUtil.cloneValue(previousKV), thisValue) != 0) {
                 LOG.warn("These two KV should have the same value." +
                     " Previous KV:" +
                     previousKV + "(memStoreTS:" + previousKV.getMvccVersion() + ")" +
                     ", New KV: " +
                     kv + "(memStoreTS:" + kv.getMvccVersion() + ")"
                     );
-                assertEquals(0, Bytes.compareTo(CellUtil.getValueArray(previousKV), thisValue));
+                assertEquals(0, Bytes.compareTo(CellUtil.cloneValue(previousKV), thisValue));
               }
             }
             previousKV = kv;
@@ -3742,7 +3742,7 @@ public class TestHRegion extends HBaseTe
     res = this.region.get(get);
     kvs = res.getColumn(family, qualifier);
     assertEquals(1, kvs.size());
-    assertEquals(Bytes.toBytes("value0"), CellUtil.getValueArray(kvs.get(0)));
+    assertEquals(Bytes.toBytes("value0"), CellUtil.cloneValue(kvs.get(0)));
 
     region.flushcache();
     get = new Get(row);
@@ -3751,7 +3751,7 @@ public class TestHRegion extends HBaseTe
     res = this.region.get(get);
     kvs = res.getColumn(family, qualifier);
     assertEquals(1, kvs.size());
-    assertEquals(Bytes.toBytes("value0"), CellUtil.getValueArray(kvs.get(0)));
+    assertEquals(Bytes.toBytes("value0"), CellUtil.cloneValue(kvs.get(0)));
 
     put = new Put(row);
     value = Bytes.toBytes("value1");
@@ -3763,7 +3763,7 @@ public class TestHRegion extends HBaseTe
     res = this.region.get(get);
     kvs = res.getColumn(family, qualifier);
     assertEquals(1, kvs.size());
-    assertEquals(Bytes.toBytes("value1"), CellUtil.getValueArray(kvs.get(0)));
+    assertEquals(Bytes.toBytes("value1"), CellUtil.cloneValue(kvs.get(0)));
 
     region.flushcache();
     get = new Get(row);
@@ -3772,7 +3772,7 @@ public class TestHRegion extends HBaseTe
     res = this.region.get(get);
     kvs = res.getColumn(family, qualifier);
     assertEquals(1, kvs.size());
-    assertEquals(Bytes.toBytes("value1"), CellUtil.getValueArray(kvs.get(0)));
+    assertEquals(Bytes.toBytes("value1"), CellUtil.cloneValue(kvs.get(0)));
   }
 
   @Test
@@ -3915,7 +3915,7 @@ public class TestHRegion extends HBaseTe
     Get get = new Get(k).addFamily(family).setMaxVersions();
     Cell [] results = r.get(get).rawCells();
     for (int j = 0; j < results.length; j++) {
-      byte [] tmp = CellUtil.getValueArray(results[j]);
+      byte [] tmp = CellUtil.cloneValue(results[j]);
       // Row should be equal to value every time.
       assertTrue(Bytes.equals(k, tmp));
     }
@@ -3940,7 +3940,7 @@ public class TestHRegion extends HBaseTe
       boolean first = true;
       OUTER_LOOP: while(s.next(curVals)) {
         for (Cell kv: curVals) {
-          byte [] val = CellUtil.getValueArray(kv);
+          byte [] val = CellUtil.cloneValue(kv);
           byte [] curval = val;
           if (first) {
             first = false;
@@ -4069,15 +4069,15 @@ public class TestHRegion extends HBaseTe
                              int rowIdx, int colIdx, long ts) {
     String ctx = "rowIdx=" + rowIdx + "; colIdx=" + colIdx + "; ts=" + ts;
     assertEquals("Row mismatch which checking: " + ctx,
-                 "row:"+ rowIdx, Bytes.toString(CellUtil.getRowArray(kv)));
+                 "row:"+ rowIdx, Bytes.toString(CellUtil.cloneRow(kv)));
     assertEquals("ColumnFamily mismatch while checking: " + ctx,
-                 Bytes.toString(cf), Bytes.toString(CellUtil.getFamilyArray(kv)));
+                 Bytes.toString(cf), Bytes.toString(CellUtil.cloneFamily(kv)));
     assertEquals("Column qualifier mismatch while checking: " + ctx,
-                 "column:" + colIdx, Bytes.toString(CellUtil.getQualifierArray(kv)));
+                 "column:" + colIdx, Bytes.toString(CellUtil.cloneQualifier(kv)));
     assertEquals("Timestamp mismatch while checking: " + ctx,
                  ts, kv.getTimestamp());
     assertEquals("Value mismatch while checking: " + ctx,
-                 "value-version-" + ts, Bytes.toString(CellUtil.getValueArray(kv)));
+                 "value-version-" + ts, Bytes.toString(CellUtil.cloneValue(kv)));
   }
 }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestKeepDeletes.java
Tue Sep 10 23:05:50 2013
@@ -339,11 +339,11 @@ public class TestKeepDeletes {
     scan.next(kvs);
     assertEquals(8, kvs.size());
     assertTrue(CellUtil.isDeleteFamily(kvs.get(0)));
-    assertArrayEquals(CellUtil.getValueArray(kvs.get(1)), T3);
+    assertArrayEquals(CellUtil.cloneValue(kvs.get(1)), T3);
     assertTrue(CellUtil.isDelete(kvs.get(2)));
     assertTrue(CellUtil.isDelete(kvs.get(3))); // .isDeleteType());
-    assertArrayEquals(CellUtil.getValueArray(kvs.get(4)), T2);
-    assertArrayEquals(CellUtil.getValueArray(kvs.get(5)), T1);
+    assertArrayEquals(CellUtil.cloneValue(kvs.get(4)), T2);
+    assertArrayEquals(CellUtil.cloneValue(kvs.get(5)), T1);
     // we have 3 CFs, so there are two more delete markers
     assertTrue(CellUtil.isDeleteFamily(kvs.get(6)));
     assertTrue(CellUtil.isDeleteFamily(kvs.get(7)));
@@ -369,7 +369,7 @@ public class TestKeepDeletes {
     scan.next(kvs);
     assertEquals(4, kvs.size());
     assertTrue(CellUtil.isDeleteFamily(kvs.get(0)));
-    assertArrayEquals(CellUtil.getValueArray(kvs.get(1)), T1);
+    assertArrayEquals(CellUtil.cloneValue(kvs.get(1)), T1);
     // we have 3 CFs
     assertTrue(CellUtil.isDeleteFamily(kvs.get(2)));
     assertTrue(CellUtil.isDeleteFamily(kvs.get(3)));
@@ -383,7 +383,7 @@ public class TestKeepDeletes {
     kvs = new ArrayList<Cell>();
     scan.next(kvs);
     assertEquals(2, kvs.size());
-    assertArrayEquals(CellUtil.getValueArray(kvs.get(0)), T3);
+    assertArrayEquals(CellUtil.cloneValue(kvs.get(0)), T3);
     assertTrue(CellUtil.isDelete(kvs.get(1)));
 
 
@@ -835,7 +835,7 @@ public class TestKeepDeletes {
     List<Cell> kvs = r.getColumn(fam, col);
     assertEquals(kvs.size(), vals.length);
     for (int i=0;i<vals.length;i++) {
-      assertArrayEquals(CellUtil.getValueArray(kvs.get(i)), vals[i]);
+      assertArrayEquals(CellUtil.cloneValue(kvs.get(i)), vals[i]);
     }
   }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMultiColumnScanner.java
Tue Sep 10 23:05:50 2013
@@ -288,8 +288,8 @@ public class TestMultiColumnScanner {
   }
 
   private static String getRowQualStr(Cell kv) {
-    String rowStr = Bytes.toString(CellUtil.getRowArray(kv));
-    String qualStr = Bytes.toString(CellUtil.getQualifierArray(kv));
+    String rowStr = Bytes.toString(CellUtil.cloneRow(kv));
+    String qualStr = Bytes.toString(CellUtil.cloneQualifier(kv));
     return rowStr + "_" + qualStr;
   }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestParallelPut.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestParallelPut.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestParallelPut.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestParallelPut.java
Tue Sep 10 23:05:50 2013
@@ -141,7 +141,7 @@ public class TestParallelPut extends HBa
     assertEquals(1, result.size());
 
     Cell kv = result.rawCells()[0];
-    byte[] r = CellUtil.getValueArray(kv);
+    byte[] r = CellUtil.cloneValue(kv);
     assertTrue(Bytes.compareTo(r, value) == 0);
   }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestResettingCounters.java
Tue Sep 10 23:05:50 2013
@@ -95,7 +95,7 @@ public class TestResettingCounters {
       for (int i=0;i<kvs.length;i++) {
         System.out.println(kvs[i].toString());
         assertTrue(CellUtil.matchingQualifier(kvs[i], qualifiers[i]));
-        assertEquals(6, Bytes.toLong(CellUtil.getValueArray(kvs[i])));
+        assertEquals(6, Bytes.toLong(CellUtil.cloneValue(kvs[i])));
       }
     } finally {
       HRegion.closeHRegion(region);

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanWithBloomError.java
Tue Sep 10 23:05:50 2013
@@ -170,7 +170,7 @@ public class TestScanWithBloomError {
 
     List<Integer> actualIds = new ArrayList<Integer>();
     for (Cell kv : allResults) {
-      String qual = Bytes.toString(CellUtil.getQualifierArray(kv));
+      String qual = Bytes.toString(CellUtil.cloneQualifier(kv));
       assertTrue(qual.startsWith(QUALIFIER_PREFIX));
       actualIds.add(Integer.valueOf(qual.substring(
           QUALIFIER_PREFIX.length())));

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java
Tue Sep 10 23:05:50 2013
@@ -158,7 +158,7 @@ public class TestScanner {
         }
         count++;
       }
-      assertTrue(Bytes.BYTES_COMPARATOR.compare(stoprow, CellUtil.getRowArray(kv)) > 0);
+      assertTrue(Bytes.BYTES_COMPARATOR.compare(stoprow, CellUtil.cloneRow(kv)) > 0);
       // We got something back.
       assertTrue(count > 10);
       s.close();
@@ -175,8 +175,8 @@ public class TestScanner {
     while (hasMore) {
       hasMore = s.next(results);
       for (Cell kv : results) {
-        assertEquals((byte)'a', CellUtil.getRowArray(kv)[0]);
-        assertEquals((byte)'b', CellUtil.getRowArray(kv)[1]);
+        assertEquals((byte)'a', CellUtil.cloneRow(kv)[0]);
+        assertEquals((byte)'b', CellUtil.cloneRow(kv)[1]);
       }
       results.clear();
     }
@@ -191,7 +191,7 @@ public class TestScanner {
     while (hasMore) {
       hasMore = s.next(results);
       for (Cell kv : results) {
-        assertTrue(Bytes.compareTo(CellUtil.getRowArray(kv), stopRow) <= 0);
+        assertTrue(Bytes.compareTo(CellUtil.cloneRow(kv), stopRow) <= 0);
       }
       results.clear();
     }
@@ -392,7 +392,7 @@ public class TestScanner {
         while (scanner.next(results)) {
           assertTrue(hasColumn(results, HConstants.CATALOG_FAMILY,
               HConstants.REGIONINFO_QUALIFIER));
-          byte [] val = CellUtil.getValueArray(getColumn(results, HConstants.CATALOG_FAMILY,
+          byte [] val = CellUtil.cloneValue(getColumn(results, HConstants.CATALOG_FAMILY,
               HConstants.REGIONINFO_QUALIFIER));
           validateRegionInfo(val);
           if(validateStartcode) {
@@ -409,7 +409,7 @@ public class TestScanner {
           if(serverName != null) {
             assertTrue(hasColumn(results, HConstants.CATALOG_FAMILY,
                 HConstants.SERVER_QUALIFIER));
-            val = CellUtil.getValueArray(getColumn(results, HConstants.CATALOG_FAMILY,
+            val = CellUtil.cloneValue(getColumn(results, HConstants.CATALOG_FAMILY,
                 HConstants.SERVER_QUALIFIER));
             assertNotNull(val);
             assertFalse(val.length == 0);

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java
Tue Sep 10 23:05:50 2013
@@ -273,14 +273,14 @@ public class TestSeekOptimizations {
       }
 
       if (!qualSet.isEmpty() && (!CellUtil.matchingFamily(kv, FAMILY_BYTES)
-          || !qualSet.contains(Bytes.toString(CellUtil.getQualifierArray(kv))))) {
+          || !qualSet.contains(Bytes.toString(CellUtil.cloneQualifier(kv))))) {
         continue;
       }
 
       final String rowColStr =
-        Bytes.toStringBinary(CellUtil.getRowArray(kv)) + "/"
-            + Bytes.toStringBinary(CellUtil.getFamilyArray(kv)) + ":"
-            + Bytes.toStringBinary(CellUtil.getQualifierArray(kv));
+        Bytes.toStringBinary(CellUtil.cloneRow(kv)) + "/"
+            + Bytes.toStringBinary(CellUtil.cloneFamily(kv)) + ":"
+            + Bytes.toStringBinary(CellUtil.cloneQualifier(kv));
       final Integer curNumVer = verCount.get(rowColStr);
       final int newNumVer = curNumVer != null ? (curNumVer + 1) : 1;
       if (newNumVer <= maxVersions) {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStore.java
Tue Sep 10 23:05:50 2013
@@ -496,8 +496,8 @@ public class TestStore extends TestCase 
 
     assertTrue(ts1 > ts2);
 
-    assertEquals(newValue, Bytes.toLong(CellUtil.getValueArray(results.get(0))));
-    assertEquals(oldValue, Bytes.toLong(CellUtil.getValueArray(results.get(1))));
+    assertEquals(newValue, Bytes.toLong(CellUtil.cloneValue(results.get(0))));
+    assertEquals(oldValue, Bytes.toLong(CellUtil.cloneValue(results.get(1))));
   }
 
   @Override
@@ -611,8 +611,8 @@ public class TestStore extends TestCase 
     long ts2 = results.get(1).getTimestamp();
 
     assertTrue(ts1 > ts2);
-    assertEquals(newValue, Bytes.toLong(CellUtil.getValueArray(results.get(0))));
-    assertEquals(oldValue, Bytes.toLong(CellUtil.getValueArray(results.get(1))));
+    assertEquals(newValue, Bytes.toLong(CellUtil.cloneValue(results.get(0))));
+    assertEquals(oldValue, Bytes.toLong(CellUtil.cloneValue(results.get(1))));
 
     mee.setValue(2); // time goes up slightly
     newValue += 1;
@@ -625,8 +625,8 @@ public class TestStore extends TestCase 
     ts2 = results.get(1).getTimestamp();
 
     assertTrue(ts1 > ts2);
-    assertEquals(newValue, Bytes.toLong(CellUtil.getValueArray(results.get(0))));
-    assertEquals(oldValue, Bytes.toLong(CellUtil.getValueArray(results.get(1))));
+    assertEquals(newValue, Bytes.toLong(CellUtil.cloneValue(results.get(0))));
+    assertEquals(oldValue, Bytes.toLong(CellUtil.cloneValue(results.get(1))));
   }
 
   public void testHandleErrorsInFlush() throws Exception {

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestWideScanner.java
Tue Sep 10 23:05:50 2013
@@ -112,9 +112,9 @@ public class TestWideScanner extends HBa
 
         if (results.size() > 0) {
           // assert that all results are from the same row
-          byte[] row = CellUtil.getRowArray(results.get(0));
+          byte[] row = CellUtil.cloneRow(results.get(0));
           for (Cell kv: results) {
-            assertTrue(Bytes.equals(row, CellUtil.getRowArray(kv)));
+            assertTrue(Bytes.equals(row, CellUtil.cloneRow(kv)));
           }
         }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestReplicationSmallTests.java
Tue Sep 10 23:05:50 2013
@@ -140,9 +140,9 @@ public class TestReplicationSmallTests e
         LOG.info("Rows not available");
         Thread.sleep(SLEEP_TIME);
       } else {
-        assertArrayEquals(CellUtil.getValueArray(res.rawCells()[0]), v3);
-        assertArrayEquals(CellUtil.getValueArray(res.rawCells()[1]), v2);
-        assertArrayEquals(CellUtil.getValueArray(res.rawCells()[2]), v1);
+        assertArrayEquals(CellUtil.cloneValue(res.rawCells()[0]), v3);
+        assertArrayEquals(CellUtil.cloneValue(res.rawCells()[1]), v2);
+        assertArrayEquals(CellUtil.cloneValue(res.rawCells()[2]), v1);
         break;
       }
     }
@@ -162,8 +162,8 @@ public class TestReplicationSmallTests e
         LOG.info("Version not deleted");
         Thread.sleep(SLEEP_TIME);
       } else {
-        assertArrayEquals(CellUtil.getValueArray(res.rawCells()[0]), v3);
-        assertArrayEquals(CellUtil.getValueArray(res.rawCells()[1]), v2);
+        assertArrayEquals(CellUtil.cloneValue(res.rawCells()[0]), v3);
+        assertArrayEquals(CellUtil.cloneValue(res.rawCells()[1]), v2);
         break;
       }
     }
@@ -463,8 +463,8 @@ public class TestReplicationSmallTests e
     for (Result result : rs) {
       put = new Put(result.getRow());
       Cell firstVal = result.rawCells()[0];
-      put.add(CellUtil.getFamilyArray(firstVal),
-          CellUtil.getQualifierArray(firstVal), Bytes.toBytes("diff data"));
+      put.add(CellUtil.cloneFamily(firstVal),
+          CellUtil.cloneQualifier(firstVal), Bytes.toBytes("diff data"));
       htable2.put(put);
     }
     Delete delete = new Delete(put.getRow());

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedUpdater.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedUpdater.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedUpdater.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/MultiThreadedUpdater.java
Tue Sep 10 23:05:50 2013
@@ -181,7 +181,7 @@ public class MultiThreadedUpdater extend
                 byte[] checkedValue = HConstants.EMPTY_BYTE_ARRAY;
                 if (hashCode % 2 == 0) {
                   Cell kv = result.getColumnLatest(cf, column);
-                  checkedValue = kv != null ? CellUtil.getValueArray(kv) : null;
+                  checkedValue = kv != null ? CellUtil.cloneValue(kv) : null;
                   Preconditions.checkNotNull(checkedValue,
                     "Column value to be checked should not be null");
                 }

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java?rev=1521676&r1=1521675&r2=1521676&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestMergeTool.java
Tue Sep 10 23:05:50 2013
@@ -243,7 +243,7 @@ public class TestMergeTool extends HBase
         get.addFamily(FAMILY);
         Result result = merged.get(get);
         assertEquals(1, result.size());
-        byte [] bytes = CellUtil.getValueArray(result.rawCells()[0]);
+        byte [] bytes = CellUtil.cloneValue(result.rawCells()[0]);
         assertNotNull(Bytes.toStringBinary(rows[i][j]), bytes);
         assertTrue(Bytes.equals(bytes, rows[i][j]));
       }
@@ -262,7 +262,7 @@ public class TestMergeTool extends HBase
         Get get = new Get(rows[i][j]);
         get.addFamily(FAMILY);
         Result result = regions[i].get(get);
-        byte [] bytes =  CellUtil.getValueArray(result.rawCells()[0]);
+        byte [] bytes =  CellUtil.cloneValue(result.rawCells()[0]);
         assertNotNull(bytes);
         assertTrue(Bytes.equals(bytes, rows[i][j]));
       }



Mime
View raw message