hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject svn commit: r1519077 [6/6] - in /hbase/trunk: hbase-client/src/main/java/org/apache/hadoop/hbase/ hbase-client/src/main/java/org/apache/hadoop/hbase/client/ hbase-client/src/main/java/org/apache/hadoop/hbase/client/coprocessor/ hbase-client/src/main/ja...
Date Fri, 30 Aug 2013 20:31:50 GMT
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=1519077&r1=1519076&r2=1519077&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 Fri Aug 30 20:31:47 2013
@@ -27,6 +27,8 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HTableDescriptor;
@@ -208,7 +210,7 @@ public class TestKeepDeletes {
     s.setRaw(true);
     s.setMaxVersions();
     InternalScanner scan = region.getScanner(s);
-    List<KeyValue> kvs = new ArrayList<KeyValue>();
+    List<Cell> kvs = new ArrayList<Cell>();
     scan.next(kvs);
     assertEquals(2, kvs.size());
 
@@ -222,7 +224,7 @@ public class TestKeepDeletes {
     s.setRaw(true);
     s.setMaxVersions();
     scan = region.getScanner(s);
-    kvs = new ArrayList<KeyValue>();
+    kvs = new ArrayList<Cell>();
     scan.next(kvs);
     assertTrue(kvs.isEmpty());
 
@@ -259,7 +261,7 @@ public class TestKeepDeletes {
     s.setMaxVersions();
     s.setTimeRange(0L, ts+1);
     InternalScanner scanner = region.getScanner(s);
-    List<KeyValue> kvs = new ArrayList<KeyValue>();
+    List<Cell> kvs = new ArrayList<Cell>();
     while(scanner.next(kvs));
     assertTrue(kvs.isEmpty());
 
@@ -333,18 +335,18 @@ public class TestKeepDeletes {
     s.setRaw(true);
     s.setMaxVersions();
     InternalScanner scan = region.getScanner(s);
-    List<KeyValue> kvs = new ArrayList<KeyValue>();
+    List<Cell> kvs = new ArrayList<Cell>();
     scan.next(kvs);
     assertEquals(8, kvs.size());
-    assertTrue(kvs.get(0).isDeleteFamily());
-    assertArrayEquals(kvs.get(1).getValue(), T3);
-    assertTrue(kvs.get(2).isDelete());
-    assertTrue(kvs.get(3).isDeleteType());
-    assertArrayEquals(kvs.get(4).getValue(), T2);
-    assertArrayEquals(kvs.get(5).getValue(), T1);
+    assertTrue(CellUtil.isDeleteFamily(kvs.get(0)));
+    assertArrayEquals(CellUtil.getValueArray(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);
     // we have 3 CFs, so there are two more delete markers
-    assertTrue(kvs.get(6).isDeleteFamily());
-    assertTrue(kvs.get(7).isDeleteFamily());
+    assertTrue(CellUtil.isDeleteFamily(kvs.get(6)));
+    assertTrue(CellUtil.isDeleteFamily(kvs.get(7)));
 
     // verify that raw scans honor the passed timerange
     s = new Scan();
@@ -352,7 +354,7 @@ public class TestKeepDeletes {
     s.setMaxVersions();
     s.setTimeRange(0, 1);
     scan = region.getScanner(s);
-    kvs = new ArrayList<KeyValue>();
+    kvs = new ArrayList<Cell>();
     scan.next(kvs);
     // nothing in this interval, not even delete markers
     assertTrue(kvs.isEmpty());
@@ -363,14 +365,14 @@ public class TestKeepDeletes {
     s.setMaxVersions();
     s.setTimeRange(0, ts+2);
     scan = region.getScanner(s);
-    kvs = new ArrayList<KeyValue>();
+    kvs = new ArrayList<Cell>();
     scan.next(kvs);
     assertEquals(4, kvs.size());
-    assertTrue(kvs.get(0).isDeleteFamily());
-    assertArrayEquals(kvs.get(1).getValue(), T1);
+    assertTrue(CellUtil.isDeleteFamily(kvs.get(0)));
+    assertArrayEquals(CellUtil.getValueArray(kvs.get(1)), T1);
     // we have 3 CFs
-    assertTrue(kvs.get(2).isDeleteFamily());
-    assertTrue(kvs.get(3).isDeleteFamily());
+    assertTrue(CellUtil.isDeleteFamily(kvs.get(2)));
+    assertTrue(CellUtil.isDeleteFamily(kvs.get(3)));
 
     // filter old delete markers
     s = new Scan();
@@ -378,11 +380,11 @@ public class TestKeepDeletes {
     s.setMaxVersions();
     s.setTimeRange(ts+3, ts+5);
     scan = region.getScanner(s);
-    kvs = new ArrayList<KeyValue>();
+    kvs = new ArrayList<Cell>();
     scan.next(kvs);
     assertEquals(2, kvs.size());
-    assertArrayEquals(kvs.get(0).getValue(), T3);
-    assertTrue(kvs.get(1).isDelete());
+    assertArrayEquals(CellUtil.getValueArray(kvs.get(0)), T3);
+    assertTrue(CellUtil.isDelete(kvs.get(1)));
 
 
     HRegion.closeHRegion(region);
@@ -703,7 +705,7 @@ public class TestKeepDeletes {
     Scan s = new Scan(T1);
     s.setTimeRange(0, ts+1);
     InternalScanner scanner = region.getScanner(s);
-    List<KeyValue> kvs = new ArrayList<KeyValue>();
+    List<Cell> kvs = new ArrayList<Cell>();
     scanner.next(kvs);
     assertEquals(4, kvs.size());
     scanner.close();
@@ -711,7 +713,7 @@ public class TestKeepDeletes {
     s = new Scan(T2);
     s.setTimeRange(0, ts+2);
     scanner = region.getScanner(s);
-    kvs = new ArrayList<KeyValue>();
+    kvs = new ArrayList<Cell>();
     scanner.next(kvs);
     assertEquals(4, kvs.size());
     scanner.close();
@@ -814,13 +816,13 @@ public class TestKeepDeletes {
     // use max versions from the store(s)
     s.setMaxVersions(region.getStores().values().iterator().next().getScanInfo().getMaxVersions());
     InternalScanner scan = region.getScanner(s);
-    List<KeyValue> kvs = new ArrayList<KeyValue>();
+    List<Cell> kvs = new ArrayList<Cell>();
     int res = 0;
     boolean hasMore;
     do {
       hasMore = scan.next(kvs);
-      for (KeyValue kv : kvs) {
-        if(kv.isDelete()) res++;
+      for (Cell kv : kvs) {
+        if(CellUtil.isDelete(kv)) res++;
       }
       kvs.clear();
     } while (hasMore);
@@ -830,10 +832,10 @@ public class TestKeepDeletes {
 
   private void checkResult(Result r, byte[] fam, byte[] col, byte[] ... vals) {
     assertEquals(r.size(), vals.length);
-    List<KeyValue> kvs = r.getColumn(fam, col);
+    List<Cell> kvs = r.getColumn(fam, col);
     assertEquals(kvs.size(), vals.length);
     for (int i=0;i<vals.length;i++) {
-      assertArrayEquals(kvs.get(i).getValue(), vals[i]);
+      assertArrayEquals(CellUtil.getValueArray(kvs.get(i)), vals[i]);
     }
   }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStore.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStore.java?rev=1519077&r1=1519076&r2=1519077&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStore.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMemStore.java Fri Aug 30 20:31:47 2013
@@ -34,6 +34,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -80,8 +81,7 @@ public class TestMemStore extends TestCa
     this.memstore.add(samekey);
     KeyValue found = this.memstore.kvset.first();
     assertEquals(1, this.memstore.kvset.size());
-    assertTrue(Bytes.toString(found.getValue()), Bytes.equals(samekey.getValue(),
-      found.getValue()));
+    assertTrue(Bytes.toString(found.getValue()), CellUtil.matchingValue(samekey, found));
   }
 
   /**
@@ -92,7 +92,7 @@ public class TestMemStore extends TestCa
     int rowCount = addRows(this.memstore);
     List<KeyValueScanner> memstorescanners = this.memstore.getScanners();
     Scan scan = new Scan();
-    List<KeyValue> result = new ArrayList<KeyValue>();
+    List<Cell> result = new ArrayList<Cell>();
     MultiVersionConsistencyControl.resetThreadReadPoint(mvcc);
     ScanInfo scanInfo = new ScanInfo(null, 0, 1, HConstants.LATEST_TIMESTAMP, false,
         0, this.memstore.comparator);
@@ -124,7 +124,7 @@ public class TestMemStore extends TestCa
       while (s.next(result)) {
         LOG.info(result);
         // Assert the stuff is coming out in right order.
-        assertTrue(Bytes.compareTo(Bytes.toBytes(count), result.get(0).getRow()) == 0);
+        assertTrue(CellUtil.matchingRow(result.get(0), Bytes.toBytes(count)));
         count++;
         // Row count is same as column count.
         assertEquals(rowCount, result.size());
@@ -151,7 +151,7 @@ public class TestMemStore extends TestCa
       while (s.next(result)) {
         LOG.info(result);
         // Assert the stuff is coming out in right order.
-        assertTrue(Bytes.compareTo(Bytes.toBytes(count), result.get(0).getRow()) == 0);
+        assertTrue(CellUtil.matchingRow(result.get(0), Bytes.toBytes(count)));
         // Row count is same as column count.
         assertEquals("count=" + count + ", result=" + result, rowCount, result.size());
         count++;
@@ -219,7 +219,7 @@ public class TestMemStore extends TestCa
   private void assertScannerResults(KeyValueScanner scanner, KeyValue[] expected)
       throws IOException {
     scanner.seek(KeyValue.createFirstOnRow(new byte[]{}));
-    List<KeyValue> returned = Lists.newArrayList();
+    List<Cell> returned = Lists.newArrayList();
 
     while (true) {
       KeyValue next = scanner.next();
@@ -533,16 +533,16 @@ public class TestMemStore extends TestCa
       InternalScanner scanner = new StoreScanner(new Scan(
           Bytes.toBytes(startRowId)), scanInfo, scanType, null,
           memstore.getScanners());
-      List<KeyValue> results = new ArrayList<KeyValue>();
+      List<Cell> results = new ArrayList<Cell>();
       for (int i = 0; scanner.next(results); i++) {
         int rowId = startRowId + i;
-        KeyValue left = results.get(0);
+        Cell left = results.get(0);
         byte[] row1 = Bytes.toBytes(rowId);
         assertTrue("Row name",
-          KeyValue.COMPARATOR.compareRows(left.getBuffer(), left.getRowOffset(), (int) left.getRowLength(), row1, 0, row1.length) == 0);
+          KeyValue.COMPARATOR.compareRows(left.getRowArray(), left.getRowOffset(), (int) left.getRowLength(), row1, 0, row1.length) == 0);
         assertEquals("Count of columns", QUALIFIER_COUNT, results.size());
-        List<KeyValue> row = new ArrayList<KeyValue>();
-        for (KeyValue kv : results) {
+        List<Cell> row = new ArrayList<Cell>();
+        for (Cell kv : results) {
           row.add(kv);
         }
         isExpectedRowWithoutTimestamps(rowId, row);
@@ -600,7 +600,7 @@ public class TestMemStore extends TestCa
     KeyValue del2 = new KeyValue(row, fam, qf1, ts2, KeyValue.Type.Delete, val);
     memstore.delete(del2);
 
-    List<KeyValue> expected = new ArrayList<KeyValue>();
+    List<Cell> expected = new ArrayList<Cell>();
     expected.add(put3);
     expected.add(del2);
     expected.add(put2);
@@ -635,7 +635,7 @@ public class TestMemStore extends TestCa
       new KeyValue(row, fam, qf1, ts2, KeyValue.Type.DeleteColumn, val);
     memstore.delete(del2);
 
-    List<KeyValue> expected = new ArrayList<KeyValue>();
+    List<Cell> expected = new ArrayList<Cell>();
     expected.add(put3);
     expected.add(del2);
     expected.add(put2);
@@ -673,7 +673,7 @@ public class TestMemStore extends TestCa
       new KeyValue(row, fam, null, ts, KeyValue.Type.DeleteFamily, val);
     memstore.delete(del);
 
-    List<KeyValue> expected = new ArrayList<KeyValue>();
+    List<Cell> expected = new ArrayList<Cell>();
     expected.add(del);
     expected.add(put1);
     expected.add(put2);
@@ -992,19 +992,16 @@ public class TestMemStore extends TestCa
   }
 
   private void isExpectedRowWithoutTimestamps(final int rowIndex,
-      List<KeyValue> kvs) {
+      List<Cell> kvs) {
     int i = 0;
-    for (KeyValue kv: kvs) {
-      String expectedColname = Bytes.toString(makeQualifier(rowIndex, i++));
-      String colnameStr = Bytes.toString(kv.getQualifier());
-      assertEquals("Column name", colnameStr, expectedColname);
+    for (Cell kv: kvs) {
+      byte[] expectedColname = makeQualifier(rowIndex, i++);
+      assertTrue("Column name", CellUtil.matchingQualifier(kv, expectedColname));
       // Value is column name as bytes.  Usually result is
       // 100 bytes in size at least. This is the default size
       // for BytesWriteable.  For comparison, convert bytes to
       // String and trim to remove trailing null bytes.
-      String colvalueStr = Bytes.toString(kv.getBuffer(), kv.getValueOffset(),
-        kv.getValueLength());
-      assertEquals("Content", colnameStr, colvalueStr);
+      assertTrue("Content", CellUtil.matchingValue(kv, expectedColname));
     }
   }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java?rev=1519077&r1=1519076&r2=1519077&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestMinVersions.java Fri Aug 30 20:31:47 2013
@@ -19,16 +19,16 @@
 package org.apache.hadoop.hbase.regionserver;
 
 import static org.apache.hadoop.hbase.HBaseTestingUtility.COLUMNS;
-import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.SmallTests;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Get;
@@ -461,10 +461,10 @@ public class TestMinVersions {
 
   private void checkResult(Result r, byte[] col, byte[] ... vals) {
     assertEquals(r.size(), vals.length);
-    List<KeyValue> kvs = r.getColumn(col, col);
+    List<Cell> kvs = r.getColumn(col, col);
     assertEquals(kvs.size(), vals.length);
     for (int i=0;i<vals.length;i++) {
-      assertArrayEquals(kvs.get(i).getValue(), vals[i]);
+      assertTrue(CellUtil.matchingValue(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=1519077&r1=1519076&r2=1519077&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 Fri Aug 30 20:31:47 2013
@@ -37,7 +37,9 @@ import java.util.TreeSet;
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.CellComparator;
+import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.KeyValue;
@@ -239,7 +241,7 @@ public class TestMultiColumnScanner {
         }
 
         InternalScanner scanner = region.getScanner(scan);
-        List<KeyValue> results = new ArrayList<KeyValue>();
+        List<Cell> results = new ArrayList<Cell>();
 
         int kvPos = 0;
         int numResults = 0;
@@ -247,7 +249,7 @@ public class TestMultiColumnScanner {
             + columnBitMask + "), maxVersions=" + maxVersions;
 
         while (scanner.next(results) || results.size() > 0) {
-          for (KeyValue kv : results) {
+          for (Cell kv : results) {
             while (kvPos < kvs.size()
                 && !matchesQuery(kvs.get(kvPos), qualSet, maxVersions,
                     lastDelTimeMap)) {
@@ -285,11 +287,9 @@ public class TestMultiColumnScanner {
     HRegion.closeHRegion(region);
   }
 
-  private static String getRowQualStr(KeyValue kv) {
-    String rowStr = Bytes.toString(kv.getBuffer(), kv.getRowOffset(),
-        kv.getRowLength());
-    String qualStr = Bytes.toString(kv.getBuffer(), kv.getQualifierOffset(),
-        kv.getQualifierLength());
+  private static String getRowQualStr(Cell kv) {
+    String rowStr = Bytes.toString(CellUtil.getRowArray(kv));
+    String qualStr = Bytes.toString(CellUtil.getQualifierArray(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=1519077&r1=1519076&r2=1519077&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 Fri Aug 30 20:31:47 2013
@@ -140,8 +140,8 @@ public class TestParallelPut extends HBa
     Result result = region.get(get);
     assertEquals(1, result.size());
 
-    KeyValue kv = result.raw()[0];
-    byte[] r = kv.getValue();
+    Cell kv = result.raw()[0];
+    byte[] r = CellUtil.getValueArray(kv);
     assertTrue(Bytes.compareTo(r, value) == 0);
   }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransaction.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransaction.java?rev=1519077&r1=1519076&r2=1519077&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransaction.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRegionMergeTransaction.java Fri Aug 30 20:31:47 2013
@@ -21,7 +21,8 @@ package org.apache.hadoop.hbase.regionse
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.*;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.when;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -29,15 +30,15 @@ import java.util.List;
 
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HRegionInfo;
 import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.Server;
 import org.apache.hadoop.hbase.SmallTests;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Durability;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Scan;
@@ -413,7 +414,7 @@ public class TestRegionMergeTransaction 
     int rowcount = 0;
     InternalScanner scanner = r.getScanner(new Scan());
     try {
-      List<KeyValue> kvs = new ArrayList<KeyValue>();
+      List<Cell> kvs = new ArrayList<Cell>();
       boolean hasNext = true;
       while (hasNext) {
         hasNext = scanner.next(kvs);

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=1519077&r1=1519076&r2=1519077&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 Fri Aug 30 20:31:47 2013
@@ -91,11 +91,11 @@ public class TestResettingCounters {
       // increment all qualifiers, should have value=6 for all
       Result result = region.increment(all);
       assertEquals(numQualifiers, result.size());
-      KeyValue [] kvs = result.raw();
+      Cell [] kvs = result.raw();
       for (int i=0;i<kvs.length;i++) {
         System.out.println(kvs[i].toString());
-        assertTrue(Bytes.equals(kvs[i].getQualifier(), qualifiers[i]));
-        assertEquals(6, Bytes.toLong(kvs[i].getValue()));
+        assertTrue(CellUtil.matchingQualifier(kvs[i], qualifiers[i]));
+        assertEquals(6, Bytes.toLong(CellUtil.getValueArray(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=1519077&r1=1519076&r2=1519077&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 Fri Aug 30 20:31:47 2013
@@ -33,6 +33,8 @@ import org.apache.commons.logging.LogFac
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.KeyValue;
@@ -156,10 +158,10 @@ public class TestScanWithBloomError {
         + lastStoreFileReader.getHFileReader().getName());
     lastStoreFileReader.disableBloomFilterForTesting();
 
-    List<KeyValue> allResults = new ArrayList<KeyValue>();
+    List<Cell> allResults = new ArrayList<Cell>();
 
     { // Limit the scope of results.
-      List<KeyValue> results = new ArrayList<KeyValue>();
+      List<Cell> results = new ArrayList<Cell>();
       while (scanner.next(results) || results.size() > 0) {
         allResults.addAll(results);
         results.clear();
@@ -167,8 +169,8 @@ public class TestScanWithBloomError {
     }
 
     List<Integer> actualIds = new ArrayList<Integer>();
-    for (KeyValue kv : allResults) {
-      String qual = Bytes.toString(kv.getQualifier());
+    for (Cell kv : allResults) {
+      String qual = Bytes.toString(CellUtil.getQualifierArray(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=1519077&r1=1519076&r2=1519077&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 Fri Aug 30 20:31:47 2013
@@ -33,6 +33,8 @@ import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseTestCase;
 import org.apache.hadoop.hbase.HBaseTestCase.HRegionIncommon;
 import org.apache.hadoop.hbase.HBaseTestCase.ScannerIncommon;
@@ -128,7 +130,7 @@ public class TestScanner {
     try {
       this.r = TEST_UTIL.createLocalHRegion(TESTTABLEDESC, null, null);
       HBaseTestCase.addContent(this.r, HConstants.CATALOG_FAMILY);
-      List<KeyValue> results = new ArrayList<KeyValue>();
+      List<Cell> results = new ArrayList<Cell>();
       // Do simple test of getting one row only first.
       Scan scan = new Scan(Bytes.toBytes("abc"), Bytes.toBytes("abd"));
       scan.addFamily(HConstants.CATALOG_FAMILY);
@@ -146,17 +148,17 @@ public class TestScanner {
 
       s = r.getScanner(scan);
       count = 0;
-      KeyValue kv = null;
-      results = new ArrayList<KeyValue>();
+      Cell kv = null;
+      results = new ArrayList<Cell>();
       for (boolean first = true; s.next(results);) {
         kv = results.get(0);
         if (first) {
-          assertTrue(Bytes.BYTES_COMPARATOR.compare(startrow, kv.getRow()) == 0);
+          assertTrue(CellUtil.matchingRow(kv,  startrow));
           first = false;
         }
         count++;
       }
-      assertTrue(Bytes.BYTES_COMPARATOR.compare(stoprow, kv.getRow()) > 0);
+      assertTrue(Bytes.BYTES_COMPARATOR.compare(stoprow, CellUtil.getRowArray(kv)) > 0);
       // We got something back.
       assertTrue(count > 10);
       s.close();
@@ -166,15 +168,15 @@ public class TestScanner {
   }
 
   void rowPrefixFilter(Scan scan) throws IOException {
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     scan.addFamily(HConstants.CATALOG_FAMILY);
     InternalScanner s = r.getScanner(scan);
     boolean hasMore = true;
     while (hasMore) {
       hasMore = s.next(results);
-      for (KeyValue kv : results) {
-        assertEquals((byte)'a', kv.getRow()[0]);
-        assertEquals((byte)'b', kv.getRow()[1]);
+      for (Cell kv : results) {
+        assertEquals((byte)'a', CellUtil.getRowArray(kv)[0]);
+        assertEquals((byte)'b', CellUtil.getRowArray(kv)[1]);
       }
       results.clear();
     }
@@ -182,14 +184,14 @@ public class TestScanner {
   }
 
   void rowInclusiveStopFilter(Scan scan, byte[] stopRow) throws IOException {
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     scan.addFamily(HConstants.CATALOG_FAMILY);
     InternalScanner s = r.getScanner(scan);
     boolean hasMore = true;
     while (hasMore) {
       hasMore = s.next(results);
-      for (KeyValue kv : results) {
-        assertTrue(Bytes.compareTo(kv.getRow(), stopRow) <= 0);
+      for (Cell kv : results) {
+        assertTrue(Bytes.compareTo(CellUtil.getRowArray(kv), stopRow) <= 0);
       }
       results.clear();
     }
@@ -230,7 +232,7 @@ public class TestScanner {
       HBaseTestCase.addContent(this.r, HConstants.CATALOG_FAMILY);
       Scan scan = new Scan();
       InternalScanner s = r.getScanner(scan);
-      List<KeyValue> results = new ArrayList<KeyValue>();
+      List<Cell> results = new ArrayList<Cell>();
       try {
         s.next(results);
         s.close();
@@ -374,7 +376,7 @@ public class TestScanner {
   throws IOException {
     InternalScanner scanner = null;
     Scan scan = null;
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     byte [][][] scanColumns = {
         COLS,
         EXPLICIT_COLS
@@ -390,8 +392,8 @@ public class TestScanner {
         while (scanner.next(results)) {
           assertTrue(hasColumn(results, HConstants.CATALOG_FAMILY,
               HConstants.REGIONINFO_QUALIFIER));
-          byte [] val = getColumn(results, HConstants.CATALOG_FAMILY,
-              HConstants.REGIONINFO_QUALIFIER).getValue();
+          byte [] val = CellUtil.getValueArray(getColumn(results, HConstants.CATALOG_FAMILY,
+              HConstants.REGIONINFO_QUALIFIER));
           validateRegionInfo(val);
           if(validateStartcode) {
 //            assertTrue(hasColumn(results, HConstants.CATALOG_FAMILY,
@@ -407,8 +409,8 @@ public class TestScanner {
           if(serverName != null) {
             assertTrue(hasColumn(results, HConstants.CATALOG_FAMILY,
                 HConstants.SERVER_QUALIFIER));
-            val = getColumn(results, HConstants.CATALOG_FAMILY,
-                HConstants.SERVER_QUALIFIER).getValue();
+            val = CellUtil.getValueArray(getColumn(results, HConstants.CATALOG_FAMILY,
+                HConstants.SERVER_QUALIFIER));
             assertNotNull(val);
             assertFalse(val.length == 0);
             String server = Bytes.toString(val);
@@ -425,20 +427,20 @@ public class TestScanner {
     }
   }
 
-  private boolean hasColumn(final List<KeyValue> kvs, final byte [] family,
+  private boolean hasColumn(final List<Cell> kvs, final byte [] family,
       final byte [] qualifier) {
-    for (KeyValue kv: kvs) {
-      if (kv.matchingFamily(family) && kv.matchingQualifier(qualifier)) {
+    for (Cell kv: kvs) {
+      if (CellUtil.matchingFamily(kv, family) && CellUtil.matchingQualifier(kv, qualifier)) {
         return true;
       }
     }
     return false;
   }
 
-  private KeyValue getColumn(final List<KeyValue> kvs, final byte [] family,
+  private Cell getColumn(final List<Cell> kvs, final byte [] family,
       final byte [] qualifier) {
-    for (KeyValue kv: kvs) {
-      if (kv.matchingFamily(family) && kv.matchingQualifier(qualifier)) {
+    for (Cell kv: kvs) {
+      if (CellUtil.matchingFamily(kv, family) && CellUtil.matchingQualifier(kv, qualifier)) {
         return kv;
       }
     }
@@ -536,28 +538,23 @@ public class TestScanner {
       // run a major compact, column1 of firstRow will be cleaned.
       r.compactStores(true);
 
-      List<KeyValue> results = new ArrayList<KeyValue>();
+      List<Cell> results = new ArrayList<Cell>();
       s.next(results);
 
       // make sure returns column2 of firstRow
       assertTrue("result is not correct, keyValues : " + results,
           results.size() == 1);
-      assertTrue(Bytes.BYTES_COMPARATOR.compare(firstRowBytes, results.get(0)
-          .getRow()) == 0);
-      assertTrue(Bytes.BYTES_COMPARATOR.compare(fam2, results.get(0)
-          .getFamily()) == 0);
+      assertTrue(CellUtil.matchingRow(results.get(0), firstRowBytes)); 
+      assertTrue(CellUtil.matchingFamily(results.get(0), fam2));
 
-      results = new ArrayList<KeyValue>();
+      results = new ArrayList<Cell>();
       s.next(results);
 
       // get secondRow
       assertTrue(results.size() == 2);
-      assertTrue(Bytes.BYTES_COMPARATOR.compare(secondRowBytes, results.get(0)
-          .getRow()) == 0);
-      assertTrue(Bytes.BYTES_COMPARATOR.compare(fam1, results.get(0)
-          .getFamily()) == 0);
-      assertTrue(Bytes.BYTES_COMPARATOR.compare(fam2, results.get(1)
-          .getFamily()) == 0);
+      assertTrue(CellUtil.matchingRow(results.get(0), secondRowBytes));
+      assertTrue(CellUtil.matchingFamily(results.get(0), fam1));
+      assertTrue(CellUtil.matchingFamily(results.get(1), fam2));
     } finally {
       HRegion.closeHRegion(this.r);
     }
@@ -577,7 +574,7 @@ public class TestScanner {
     LOG.info("Taking out counting scan");
     ScannerIncommon s = hri.getScanner(HConstants.CATALOG_FAMILY, EXPLICIT_COLS,
         HConstants.EMPTY_START_ROW, HConstants.LATEST_TIMESTAMP);
-    List<KeyValue> values = new ArrayList<KeyValue>();
+    List<Cell> values = new ArrayList<Cell>();
     int count = 0;
     boolean justFlushed = false;
     while (s.next(values)) {

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=1519077&r1=1519076&r2=1519077&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 Fri Aug 30 20:31:47 2013
@@ -35,6 +35,8 @@ import java.util.Set;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
@@ -110,7 +112,7 @@ public class TestSeekOptimizations {
   private Random rand;
   private Set<Long> putTimestamps = new HashSet<Long>();
   private Set<Long> delTimestamps = new HashSet<Long>();
-  private List<KeyValue> expectedKVs = new ArrayList<KeyValue>();
+  private List<Cell> expectedKVs = new ArrayList<Cell>();
 
   private Compression.Algorithm comprAlgo;
   private BloomType bloomType;
@@ -211,8 +213,8 @@ public class TestSeekOptimizations {
 
     final long initialSeekCount = StoreFileScanner.getSeekCount();
     final InternalScanner scanner = region.getScanner(scan);
-    final List<KeyValue> results = new ArrayList<KeyValue>();
-    final List<KeyValue> actualKVs = new ArrayList<KeyValue>();
+    final List<Cell> results = new ArrayList<Cell>();
+    final List<Cell> actualKVs = new ArrayList<Cell>();
 
     // Such a clumsy do-while loop appears to be the official way to use an
     // internalScanner. scanner.next() return value refers to the _next_
@@ -224,7 +226,7 @@ public class TestSeekOptimizations {
       results.clear();
     } while (hasNext);
 
-    List<KeyValue> filteredKVs = filterExpectedResults(qualSet,
+    List<Cell> filteredKVs = filterExpectedResults(qualSet,
         rowBytes(startRow), rowBytes(endRow), maxVersions);
     final String rowRestrictionStr =
         (startRow == -1 && endRow == -1) ? "all rows" : (
@@ -252,36 +254,33 @@ public class TestSeekOptimizations {
     assertKVListsEqual(testDesc, filteredKVs, actualKVs);
   }
 
-  private List<KeyValue> filterExpectedResults(Set<String> qualSet,
+  private List<Cell> filterExpectedResults(Set<String> qualSet,
       byte[] startRow, byte[] endRow, int maxVersions) {
-    final List<KeyValue> filteredKVs = new ArrayList<KeyValue>();
+    final List<Cell> filteredKVs = new ArrayList<Cell>();
     final Map<String, Integer> verCount = new HashMap<String, Integer>();
-    for (KeyValue kv : expectedKVs) {
+    for (Cell kv : expectedKVs) {
       if (startRow.length > 0 &&
-          Bytes.compareTo(kv.getBuffer(), kv.getRowOffset(), kv.getRowLength(),
+          Bytes.compareTo(kv.getRowArray(), kv.getRowOffset(), kv.getRowLength(),
               startRow, 0, startRow.length) < 0) {
         continue;
       }
 
       // In this unit test the end row is always inclusive.
       if (endRow.length > 0 &&
-          Bytes.compareTo(kv.getBuffer(), kv.getRowOffset(), kv.getRowLength(),
+          Bytes.compareTo(kv.getRowArray(), kv.getRowOffset(), kv.getRowLength(),
               endRow, 0, endRow.length) > 0) {
         continue;
       }
 
-      if (!qualSet.isEmpty() && (Bytes.compareTo(
-            kv.getBuffer(), kv.getFamilyOffset(), kv.getFamilyLength(),
-            FAMILY_BYTES, 0, FAMILY_BYTES.length
-          ) != 0 ||
-          !qualSet.contains(Bytes.toString(kv.getQualifier())))) {
+      if (!qualSet.isEmpty() && (!CellUtil.matchingFamily(kv, FAMILY_BYTES)
+          || !qualSet.contains(Bytes.toString(CellUtil.getQualifierArray(kv))))) {
         continue;
       }
 
       final String rowColStr =
-        Bytes.toStringBinary(kv.getRow()) + "/"
-            + Bytes.toStringBinary(kv.getFamily()) + ":"
-            + Bytes.toStringBinary(kv.getQualifier());
+        Bytes.toStringBinary(CellUtil.getRowArray(kv)) + "/"
+            + Bytes.toStringBinary(CellUtil.getFamilyArray(kv)) + ":"
+            + Bytes.toStringBinary(CellUtil.getQualifierArray(kv));
       final Integer curNumVer = verCount.get(rowColStr);
       final int newNumVer = curNumVer != null ? (curNumVer + 1) : 1;
       if (newNumVer <= maxVersions) {
@@ -294,8 +293,8 @@ public class TestSeekOptimizations {
   }
 
   private void prepareExpectedKVs(long latestDelTS) {
-    final List<KeyValue> filteredKVs = new ArrayList<KeyValue>();
-    for (KeyValue kv : expectedKVs) {
+    final List<Cell> filteredKVs = new ArrayList<Cell>();
+    for (Cell kv : expectedKVs) {
       if (kv.getTimestamp() > latestDelTS || latestDelTS == -1) {
         filteredKVs.add(kv);
       }

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java?rev=1519077&r1=1519076&r2=1519077&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitTransaction.java Fri Aug 30 20:31:47 2013
@@ -30,6 +30,7 @@ import java.util.List;
 
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
@@ -314,7 +315,7 @@ public class TestSplitTransaction {
     int rowcount = 0;
     InternalScanner scanner = r.getScanner(new Scan());
     try {
-      List<KeyValue> kvs = new ArrayList<KeyValue>();
+      List<Cell> kvs = new ArrayList<Cell>();
       boolean hasNext = true;
       while (hasNext) {
         hasNext = scanner.next(kvs);

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=1519077&r1=1519076&r2=1519077&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 Fri Aug 30 20:31:47 2013
@@ -42,6 +42,8 @@ import org.apache.hadoop.fs.FilterFileSy
 import org.apache.hadoop.fs.LocalFileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsPermission;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -49,6 +51,7 @@ import org.apache.hadoop.hbase.HRegionIn
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValue.KVComparator;
+import org.apache.hadoop.hbase.KeyValueUtil;
 import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Get;
@@ -96,8 +99,8 @@ public class TestStore extends TestCase 
   NavigableSet<byte[]> qualifiers =
     new ConcurrentSkipListSet<byte[]>(Bytes.BYTES_COMPARATOR);
 
-  List<KeyValue> expected = new ArrayList<KeyValue>();
-  List<KeyValue> result = new ArrayList<KeyValue>();
+  List<Cell> expected = new ArrayList<Cell>();
+  List<Cell> result = new ArrayList<Cell>();
 
   long id = System.currentTimeMillis();
   Get get = new Get(row);
@@ -483,7 +486,7 @@ public class TestStore extends TestCase 
     Get get = new Get(row);
     get.addColumn(family, qf1);
     get.setMaxVersions(); // all versions.
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
 
     results = HBaseTestingUtility.getFromStoreFile(store, get);
     assertEquals(2, results.size());
@@ -493,8 +496,8 @@ public class TestStore extends TestCase 
 
     assertTrue(ts1 > ts2);
 
-    assertEquals(newValue, Bytes.toLong(results.get(0).getValue()));
-    assertEquals(oldValue, Bytes.toLong(results.get(1).getValue()));
+    assertEquals(newValue, Bytes.toLong(CellUtil.getValueArray(results.get(0))));
+    assertEquals(oldValue, Bytes.toLong(CellUtil.getValueArray(results.get(1))));
   }
 
   @Override
@@ -599,7 +602,7 @@ public class TestStore extends TestCase 
     Get get = new Get(row);
     get.addColumn(family, qf1);
     get.setMaxVersions(); // all versions.
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
 
     results = HBaseTestingUtility.getFromStoreFile(store, get);
     assertEquals(2, results.size());
@@ -608,8 +611,8 @@ public class TestStore extends TestCase 
     long ts2 = results.get(1).getTimestamp();
 
     assertTrue(ts1 > ts2);
-    assertEquals(newValue, Bytes.toLong(results.get(0).getValue()));
-    assertEquals(oldValue, Bytes.toLong(results.get(1).getValue()));
+    assertEquals(newValue, Bytes.toLong(CellUtil.getValueArray(results.get(0))));
+    assertEquals(oldValue, Bytes.toLong(CellUtil.getValueArray(results.get(1))));
 
     mee.setValue(2); // time goes up slightly
     newValue += 1;
@@ -622,8 +625,8 @@ public class TestStore extends TestCase 
     ts2 = results.get(1).getTimestamp();
 
     assertTrue(ts1 > ts2);
-    assertEquals(newValue, Bytes.toLong(results.get(0).getValue()));
-    assertEquals(oldValue, Bytes.toLong(results.get(1).getValue()));
+    assertEquals(newValue, Bytes.toLong(CellUtil.getValueArray(results.get(0))));
+    assertEquals(oldValue, Bytes.toLong(CellUtil.getValueArray(results.get(1))));
   }
 
   public void testHandleErrorsInFlush() throws Exception {
@@ -747,9 +750,9 @@ public class TestStore extends TestCase 
    * @param family
    * @return
    */
-  List<KeyValue> getKeyValueSet(long[] timestamps, int numRows,
+  List<Cell> getKeyValueSet(long[] timestamps, int numRows,
       byte[] qualifier, byte[] family) {
-    List<KeyValue> kvList = new ArrayList<KeyValue>();
+    List<Cell> kvList = new ArrayList<Cell>();
     for (int i=1;i<=numRows;i++) {
       byte[] b = Bytes.toBytes(i);
       for (long timestamp: timestamps) {
@@ -770,20 +773,20 @@ public class TestStore extends TestCase 
 
     init(this.getName());
 
-    List<KeyValue> kvList1 = getKeyValueSet(timestamps1,numRows, qf1, family);
-    for (KeyValue kv : kvList1) {
-      this.store.add(kv);
+    List<Cell> kvList1 = getKeyValueSet(timestamps1,numRows, qf1, family);
+    for (Cell kv : kvList1) {
+      this.store.add(KeyValueUtil.ensureKeyValue(kv));
     }
 
     this.store.snapshot();
     flushStore(store, id++);
 
-    List<KeyValue> kvList2 = getKeyValueSet(timestamps2,numRows, qf1, family);
-    for(KeyValue kv : kvList2) {
-      this.store.add(kv);
+    List<Cell> kvList2 = getKeyValueSet(timestamps2,numRows, qf1, family);
+    for(Cell kv : kvList2) {
+      this.store.add(KeyValueUtil.ensureKeyValue(kv));
     }
 
-    List<KeyValue> result;
+    List<Cell> result;
     Get get = new Get(Bytes.toBytes(1));
     get.addColumn(family,qf1);
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java?rev=1519077&r1=1519076&r2=1519077&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestStoreScanner.java Fri Aug 30 20:31:47 2013
@@ -19,8 +19,7 @@
 
 package org.apache.hadoop.hbase.regionserver;
 
-import static org.apache.hadoop.hbase.regionserver.KeyValueScanFixture.
-    scanFixture;
+import static org.apache.hadoop.hbase.regionserver.KeyValueScanFixture.scanFixture;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -31,12 +30,12 @@ import java.util.TreeSet;
 
 import junit.framework.TestCase;
 
+import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.KeyValueTestUtil;
 import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.regionserver.ScanInfo;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.EnvironmentEdge;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManagerTestHelper;
@@ -88,7 +87,7 @@ public class TestStoreScanner extends Te
     scanSpec.setMaxVersions();
     StoreScanner scan = new StoreScanner(scanSpec, scanInfo, scanType,
         getCols("a"), scanners);
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     assertEquals(true, scan.next(results));
     assertEquals(5, results.size());
     assertEquals(kvs[kvs.length - 1], results.get(0));
@@ -98,7 +97,7 @@ public class TestStoreScanner extends Te
     scanSpec.setMaxVersions();
     scan = new StoreScanner(scanSpec, scanInfo, scanType, getCols("a"),
         scanners);
-    results = new ArrayList<KeyValue>();
+    results = new ArrayList<Cell>();
     assertEquals(true, scan.next(results));
     assertEquals(2, results.size());
     // Another range.
@@ -107,7 +106,7 @@ public class TestStoreScanner extends Te
     scanSpec.setMaxVersions();
     scan = new StoreScanner(scanSpec, scanInfo, scanType, getCols("a"),
         scanners);
-    results = new ArrayList<KeyValue>();
+    results = new ArrayList<Cell>();
     assertEquals(true, scan.next(results));
     assertEquals(1, results.size());
     // See how TimeRange and Versions interact.
@@ -117,7 +116,7 @@ public class TestStoreScanner extends Te
     scanSpec.setMaxVersions(3);
     scan = new StoreScanner(scanSpec, scanInfo, scanType, getCols("a"),
         scanners);
-    results = new ArrayList<KeyValue>();
+    results = new ArrayList<Cell>();
     assertEquals(true, scan.next(results));
     assertEquals(3, results.size());
   }
@@ -138,7 +137,7 @@ public class TestStoreScanner extends Te
     StoreScanner scan = new StoreScanner(scanSpec, scanInfo, scanType,
         getCols("a"), scanners);
 
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     assertEquals(true, scan.next(results));
     assertEquals(1, results.size());
     assertEquals(kvs[0], results.get(0));
@@ -165,7 +164,7 @@ public class TestStoreScanner extends Te
     StoreScanner scan = new StoreScanner(scanSpec, scanInfo, scanType,
         getCols("a"), scanners);
 
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     scan.next(results);
     assertEquals(1, results.size());
     assertEquals(kvs[0], results.get(0));
@@ -193,7 +192,7 @@ public class TestStoreScanner extends Te
     StoreScanner scan = new StoreScanner(scanSpec, scanInfo, scanType,
         getCols("a"), scanners);
 
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     assertFalse(scan.next(results));
     assertEquals(0, results.size());
   }
@@ -213,7 +212,7 @@ public class TestStoreScanner extends Te
     StoreScanner scan = new StoreScanner(scanSpec, scanInfo, scanType,
         getCols("a"), scanners);
 
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     assertEquals(true, scan.next(results));
     assertEquals(0, results.size());
 
@@ -239,7 +238,7 @@ public class TestStoreScanner extends Te
 
     StoreScanner scan = new StoreScanner(new Scan(Bytes.toBytes("R1")),
         scanInfo, scanType, getCols("a"), scanners);
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     // the two put at ts=now will be masked by the 1 delete, and
     // since the scan default returns 1 version we'll return the newest
     // key, which is kvs[2], now-100.
@@ -264,7 +263,7 @@ public class TestStoreScanner extends Te
     Scan scanSpec = new Scan(Bytes.toBytes("R1")).setMaxVersions(2);
     StoreScanner scan = new StoreScanner(scanSpec, scanInfo, scanType,
         getCols("a"), scanners);
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     assertEquals(true, scan.next(results));
     assertEquals(2, results.size());
     assertEquals(kvs2[1], results.get(0));
@@ -280,7 +279,7 @@ public class TestStoreScanner extends Te
     List<KeyValueScanner> scanners = scanFixture(kvs);
     StoreScanner scan = new StoreScanner(new Scan(Bytes.toBytes("R1")),
         scanInfo, scanType, null, scanners);
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     assertEquals(true, scan.next(results));
     assertEquals(2, results.size());
     assertEquals(kvs[0], results.get(0));
@@ -309,7 +308,7 @@ public class TestStoreScanner extends Te
     List<KeyValueScanner> scanners = scanFixture(kvs);
     StoreScanner scan = new StoreScanner(new Scan().setMaxVersions(2),
         scanInfo, scanType, null, scanners);
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     assertEquals(true, scan.next(results));
     assertEquals(5, results.size());
     assertEquals(kvs[0], results.get(0));
@@ -338,7 +337,7 @@ public class TestStoreScanner extends Te
     StoreScanner scan = new StoreScanner(
         new Scan().setMaxVersions(Integer.MAX_VALUE), scanInfo, scanType, null,
         scanners);
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     assertEquals(true, scan.next(results));
     assertEquals(0, results.size());
     assertEquals(true, scan.next(results));
@@ -358,7 +357,7 @@ public class TestStoreScanner extends Te
     List<KeyValueScanner> scanners = scanFixture(kvs);
     StoreScanner scan = new StoreScanner(new Scan(), scanInfo, scanType, null,
         scanners);
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     assertEquals(true, scan.next(results));
     assertEquals(1, results.size());
     assertEquals(kvs[3], results.get(0));
@@ -382,7 +381,7 @@ public class TestStoreScanner extends Te
     StoreScanner scan = new StoreScanner(new Scan(), scanInfo, scanType,
         getCols("a", "d"), scanners);
 
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     assertEquals(true, scan.next(results));
     assertEquals(2, results.size());
     assertEquals(kvs[0], results.get(0));
@@ -423,7 +422,7 @@ public class TestStoreScanner extends Te
       new StoreScanner(scan, scanInfo, scanType,
           null, scanners);
 
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     assertEquals(true, scanner.next(results));
     assertEquals(2, results.size());
     assertEquals(kvs[1], results.get(0));
@@ -493,7 +492,7 @@ public class TestStoreScanner extends Te
     StoreScanner scanner =
         new StoreScanner(scan, scanInfo, scanType, null, scanners);
 
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     assertEquals(true, scanner.next(results));
     assertEquals(1, results.size());
     assertEquals(kvs[1], results.get(0));
@@ -557,8 +556,8 @@ public class TestStoreScanner extends Te
         new StoreScanner(scan, scanInfo,
           ScanType.COMPACT_DROP_DELETES, null, scanners,
           HConstants.OLDEST_TIMESTAMP);
-      List<KeyValue> results = new ArrayList<KeyValue>();
-      results = new ArrayList<KeyValue>();
+      List<Cell> results = new ArrayList<Cell>();
+      results = new ArrayList<Cell>();
       assertEquals(true, scanner.next(results));
       assertEquals(kvs[0], results.get(0));
       assertEquals(kvs[2], results.get(1));

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=1519077&r1=1519076&r2=1519077&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 Fri Aug 30 20:31:47 2013
@@ -27,13 +27,17 @@ import java.util.Random;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.*;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.HBaseTestCase;
+import org.apache.hadoop.hbase.HColumnDescriptor;
+import org.apache.hadoop.hbase.HTableDescriptor;
+import org.apache.hadoop.hbase.SmallTests;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.Durability;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.client.Durability;
-import org.apache.hadoop.hbase.io.compress.Compression;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.junit.experimental.categories.Category;
 
 @Category(SmallTests.class)
@@ -85,7 +89,7 @@ public class TestWideScanner extends HBa
     try {
       this.r = createNewHRegion(TESTTABLEDESC, null, null);
       int inserted = addWideContent(this.r);
-      List<KeyValue> results = new ArrayList<KeyValue>();
+      List<Cell> results = new ArrayList<Cell>();
       Scan scan = new Scan();
       scan.addFamily(A);
       scan.addFamily(B);
@@ -108,9 +112,9 @@ public class TestWideScanner extends HBa
 
         if (results.size() > 0) {
           // assert that all results are from the same row
-          byte[] row = results.get(0).getRow();
-          for (KeyValue kv: results) {
-            assertTrue(Bytes.equals(row, kv.getRow()));
+          byte[] row = CellUtil.getRowArray(results.get(0));
+          for (Cell kv: results) {
+            assertTrue(Bytes.equals(row, CellUtil.getRowArray(kv)));
           }
         }
 

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java?rev=1519077&r1=1519076&r2=1519077&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/wal/TestWALReplay.java Fri Aug 30 20:31:47 2013
@@ -37,7 +37,7 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -49,6 +49,7 @@ import org.apache.hadoop.hbase.MasterNot
 import org.apache.hadoop.hbase.MediumTests;
 import org.apache.hadoop.hbase.MiniHBaseCluster;
 import org.apache.hadoop.hbase.ServerName;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.ZooKeeperConnectionException;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Get;
@@ -71,9 +72,9 @@ import org.apache.hadoop.hbase.regionser
 import org.apache.hadoop.hbase.regionserver.TimeRangeTracker;
 import org.apache.hadoop.hbase.security.User;
 import org.apache.hadoop.hbase.util.Bytes;
-import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.util.EnvironmentEdge;
 import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
+import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.util.Pair;
 import org.junit.After;
 import org.junit.AfterClass;
@@ -669,7 +670,7 @@ public class TestWALReplay {
 
   private int getScannedCount(RegionScanner scanner) throws IOException {
     int scannedCount = 0;
-    List<KeyValue> results = new ArrayList<KeyValue>();
+    List<Cell> results = new ArrayList<Cell>();
     while (true) {
       boolean existMore = scanner.next(results);
       if (!results.isEmpty())

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java?rev=1519077&r1=1519076&r2=1519077&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java Fri Aug 30 20:31:47 2013
@@ -28,6 +28,7 @@ import java.util.Random;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.Cell;
 import org.apache.hadoop.hbase.HBaseConfiguration;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.HColumnDescriptor;
@@ -428,8 +429,8 @@ public class TestMasterReplication {
     }
 
     @Override
-    public void preGet(final ObserverContext<RegionCoprocessorEnvironment> c, final Get get,
-        final List<KeyValue> result) throws IOException {
+    public void preGetOp(final ObserverContext<RegionCoprocessorEnvironment> c,
+        final Get get, final List<Cell> result) throws IOException {
       if (get.getAttribute("count") != null) {
         result.clear();
         // order is important!
@@ -440,4 +441,4 @@ public class TestMasterReplication {
     }
   }
 
-}
\ No newline at end of file
+}

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=1519077&r1=1519076&r2=1519077&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 Fri Aug 30 20:31:47 2013
@@ -18,18 +18,31 @@
 
 package org.apache.hadoop.hbase.replication;
 
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.util.HashMap;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HColumnDescriptor;
 import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.HTableDescriptor;
-import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.LargeTests;
 import org.apache.hadoop.hbase.TableName;
-import org.apache.hadoop.hbase.client.*;
+import org.apache.hadoop.hbase.client.Delete;
+import org.apache.hadoop.hbase.client.Get;
+import org.apache.hadoop.hbase.client.HBaseAdmin;
+import org.apache.hadoop.hbase.client.HTable;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.client.Result;
+import org.apache.hadoop.hbase.client.ResultScanner;
+import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.client.replication.ReplicationAdmin;
 import org.apache.hadoop.hbase.mapreduce.replication.VerifyReplication;
 import org.apache.hadoop.hbase.protobuf.generated.WALProtos;
@@ -44,11 +57,6 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
-import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-import static org.junit.Assert.assertTrue;
-
 @Category(LargeTests.class)
 public class TestReplicationSmallTests extends TestReplicationBase {
 
@@ -132,9 +140,9 @@ public class TestReplicationSmallTests e
         LOG.info("Rows not available");
         Thread.sleep(SLEEP_TIME);
       } else {
-        assertArrayEquals(res.raw()[0].getValue(), v3);
-        assertArrayEquals(res.raw()[1].getValue(), v2);
-        assertArrayEquals(res.raw()[2].getValue(), v1);
+        assertArrayEquals(CellUtil.getValueArray(res.raw()[0]), v3);
+        assertArrayEquals(CellUtil.getValueArray(res.raw()[1]), v2);
+        assertArrayEquals(CellUtil.getValueArray(res.raw()[2]), v1);
         break;
       }
     }
@@ -154,8 +162,8 @@ public class TestReplicationSmallTests e
         LOG.info("Version not deleted");
         Thread.sleep(SLEEP_TIME);
       } else {
-        assertArrayEquals(res.raw()[0].getValue(), v3);
-        assertArrayEquals(res.raw()[1].getValue(), v2);
+        assertArrayEquals(CellUtil.getValueArray(res.raw()[0]), v3);
+        assertArrayEquals(CellUtil.getValueArray(res.raw()[1]), v2);
         break;
       }
     }
@@ -454,9 +462,9 @@ public class TestReplicationSmallTests e
     Put put = null;
     for (Result result : rs) {
       put = new Put(result.getRow());
-      KeyValue firstVal = result.raw()[0];
-      put.add(firstVal.getFamily(),
-          firstVal.getQualifier(), Bytes.toBytes("diff data"));
+      Cell firstVal = result.raw()[0];
+      put.add(CellUtil.getFamilyArray(firstVal),
+          CellUtil.getQualifierArray(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/rest/client/TestRemoteTable.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java?rev=1519077&r1=1519076&r2=1519077&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java (original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/rest/client/TestRemoteTable.java Fri Aug 30 20:31:47 2013
@@ -19,13 +19,24 @@
 
 package org.apache.hadoop.hbase.rest.client;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hbase.*;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.HColumnDescriptor;
+import org.apache.hadoop.hbase.HTableDescriptor;
+import org.apache.hadoop.hbase.MediumTests;
+import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Delete;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.HBaseAdmin;
@@ -35,12 +46,7 @@ import org.apache.hadoop.hbase.client.Re
 import org.apache.hadoop.hbase.client.ResultScanner;
 import org.apache.hadoop.hbase.client.Scan;
 import org.apache.hadoop.hbase.rest.HBaseRESTTestingUtility;
-import org.apache.hadoop.hbase.rest.client.Client;
-import org.apache.hadoop.hbase.rest.client.Cluster;
-import org.apache.hadoop.hbase.rest.client.RemoteHTable;
 import org.apache.hadoop.hbase.util.Bytes;
-
-import static org.junit.Assert.*;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -203,13 +209,13 @@ public class TestRemoteTable {
     get.setMaxVersions(2);
     result = remoteTable.get(get);
     int count = 0;
-    for (KeyValue kv: result.list()) {
-      if (Bytes.equals(COLUMN_1, kv.getFamily()) && TS_1 == kv.getTimestamp()) {
-        assertTrue(Bytes.equals(VALUE_1, kv.getValue())); // @TS_1
+    for (Cell kv: result.list()) {
+      if (CellUtil.matchingFamily(kv, COLUMN_1) && TS_1 == kv.getTimestamp()) {
+        assertTrue(CellUtil.matchingValue(kv, VALUE_1)); // @TS_1
         count++;
       }
-      if (Bytes.equals(COLUMN_1, kv.getFamily()) && TS_2 == kv.getTimestamp()) {
-        assertTrue(Bytes.equals(VALUE_2, kv.getValue())); // @TS_2
+      if (CellUtil.matchingFamily(kv, COLUMN_1) && TS_2 == kv.getTimestamp()) {
+        assertTrue(CellUtil.matchingValue(kv, VALUE_2)); // @TS_2
         count++;
       }
     }

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=1519077&r1=1519076&r2=1519077&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 Fri Aug 30 20:31:47 2013
@@ -33,8 +33,9 @@ import org.apache.commons.lang.math.Rand
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
 import org.apache.hadoop.hbase.HConstants;
-import org.apache.hadoop.hbase.KeyValue;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.Append;
 import org.apache.hadoop.hbase.client.Delete;
@@ -179,8 +180,8 @@ public class MultiThreadedUpdater extend
                 byte[] hashCodeBytes = Bytes.toBytes(hashCode);
                 byte[] checkedValue = HConstants.EMPTY_BYTE_ARRAY;
                 if (hashCode % 2 == 0) {
-                  KeyValue kv = result.getColumnLatest(cf, column);
-                  checkedValue = kv != null ? kv.getValue() : null;
+                  Cell kv = result.getColumnLatest(cf, column);
+                  checkedValue = kv != null ? CellUtil.getValueArray(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=1519077&r1=1519076&r2=1519077&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 Fri Aug 30 20:31:47 2013
@@ -26,15 +26,23 @@ import java.util.List;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hbase.*;
+import org.apache.hadoop.hbase.Cell;
+import org.apache.hadoop.hbase.CellUtil;
+import org.apache.hadoop.hbase.HBaseTestCase;
+import org.apache.hadoop.hbase.HBaseTestingUtility;
+import org.apache.hadoop.hbase.HColumnDescriptor;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.HRegionInfo;
+import org.apache.hadoop.hbase.HTableDescriptor;
+import org.apache.hadoop.hbase.LargeTests;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.Put;
 import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.client.Scan;
-import org.apache.hadoop.hbase.regionserver.wal.HLog;
-import org.apache.hadoop.hbase.regionserver.wal.HLogFactory;
 import org.apache.hadoop.hbase.regionserver.HRegion;
 import org.apache.hadoop.hbase.regionserver.InternalScanner;
+import org.apache.hadoop.hbase.regionserver.wal.HLog;
+import org.apache.hadoop.hbase.regionserver.wal.HLogFactory;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.util.ToolRunner;
 import org.junit.experimental.categories.Category;
@@ -215,9 +223,9 @@ public class TestMergeTool extends HBase
     scan.addFamily(FAMILY);
     InternalScanner scanner = merged.getScanner(scan);
     try {
-    List<KeyValue> testRes = null;
+    List<Cell> testRes = null;
       while (true) {
-        testRes = new ArrayList<KeyValue>();
+        testRes = new ArrayList<Cell>();
         boolean hasNext = scanner.next(testRes);
         if (!hasNext) {
           break;
@@ -235,7 +243,7 @@ public class TestMergeTool extends HBase
         get.addFamily(FAMILY);
         Result result = merged.get(get);
         assertEquals(1, result.size());
-        byte [] bytes = result.raw()[0].getValue();
+        byte [] bytes = CellUtil.getValueArray(result.raw()[0]);
         assertNotNull(Bytes.toStringBinary(rows[i][j]), bytes);
         assertTrue(Bytes.equals(bytes, rows[i][j]));
       }
@@ -254,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 = result.raw()[0].getValue();
+        byte [] bytes =  CellUtil.getValueArray(result.raw()[0]);
         assertNotNull(bytes);
         assertTrue(Bytes.equals(bytes, rows[i][j]));
       }



Mime
View raw message