HBASE-9477 Add deprecation compat shim for Result#raw and Result#list for 0.96

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1521633 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Hsieh 2013-09-10 20:39:07 +00:00
parent 5e6b63d6fc
commit 95b202008d
53 changed files with 189 additions and 154 deletions

View File

@ -376,7 +376,7 @@ public class ClientScanner extends AbstractClientScanner {
if (values != null && values.length > 0) { if (values != null && values.length > 0) {
for (Result rs : values) { for (Result rs : values) {
cache.add(rs); cache.add(rs);
for (Cell kv : rs.raw()) { for (Cell kv : rs.rawCells()) {
// TODO make method in Cell or CellUtil // TODO make method in Cell or CellUtil
remainingResultSize -= KeyValueUtil.ensureKeyValue(kv).heapSize(); remainingResultSize -= KeyValueUtil.ensureKeyValue(kv).heapSize();
} }

View File

@ -61,7 +61,7 @@ import org.apache.hadoop.hbase.util.Bytes;
* A Result is backed by an array of {@link KeyValue} objects, each representing * A Result is backed by an array of {@link KeyValue} objects, each representing
* an HBase cell defined by the row, family, qualifier, timestamp, and value.<p> * an HBase cell defined by the row, family, qualifier, timestamp, and value.<p>
* *
* The underlying {@link KeyValue} objects can be accessed through the method {@link #list()}. * The underlying {@link KeyValue} objects can be accessed through the method {@link #listCells()}.
* Each KeyValue can then be accessed through * Each KeyValue can then be accessed through
* {@link KeyValue#getRow()}, {@link KeyValue#getFamily()}, {@link KeyValue#getQualifier()}, * {@link KeyValue#getRow()}, {@link KeyValue#getFamily()}, {@link KeyValue#getQualifier()},
* {@link KeyValue#getTimestamp()}, and {@link KeyValue#getValue()}.<p> * {@link KeyValue#getTimestamp()}, and {@link KeyValue#getValue()}.<p>
@ -85,7 +85,7 @@ public class Result implements CellScannable {
public static final Result EMPTY_RESULT = new Result(); public static final Result EMPTY_RESULT = new Result();
/** /**
* Creates an empty Result w/ no KeyValue payload; returns null if you call {@link #raw()}. * Creates an empty Result w/ no KeyValue payload; returns null if you call {@link #rawCells()}.
* Use this to represent no results if <code>null</code> won't do or in old 'mapred' as oppposed to 'mapreduce' package * Use this to represent no results if <code>null</code> won't do or in old 'mapred' as oppposed to 'mapreduce' package
* MapReduce where you need to overwrite a Result * MapReduce where you need to overwrite a Result
* instance with a {@link #copyFrom(Result)} call. * instance with a {@link #copyFrom(Result)} call.
@ -147,20 +147,55 @@ public class Result implements CellScannable {
* *
* @return array of Cells; can be null if nothing in the result * @return array of Cells; can be null if nothing in the result
*/ */
public Cell[] raw() { public Cell[] rawCells() {
return cells; return cells;
} }
/**
* Return an cells of a Result as an array of KeyValues
*
* WARNING do not use, expensive. This does an arraycopy of the cell[]'s value.
*
* Added to ease transition from 0.94 -> 0.96.
*
* @deprecated as of 0.96, use {@link #rawCells()}
* @return array of KeyValues, empty array if nothing in result.
*/
@Deprecated
public KeyValue[] raw() {
KeyValue[] kvs = new KeyValue[cells.length];
for (int i = 0 ; i < kvs.length; i++) {
kvs[i] = KeyValueUtil.ensureKeyValue(cells[i]);
}
return kvs;
}
/** /**
* Create a sorted list of the Cell's in this result. * Create a sorted list of the Cell's in this result.
* *
* Since HBase 0.20.5 this is equivalent to raw(). * Since HBase 0.20.5 this is equivalent to raw().
* *
* @return The sorted list of Cell's. * @return sorted List of Cells; can be null if no cells in the result
*/ */
public List<Cell> list() { public List<Cell> listCells() {
return isEmpty()? null: Arrays.asList(raw()); return isEmpty()? null: Arrays.asList(rawCells());
} }
/**
* Return an cells of a Result as an array of KeyValues
*
* WARNING do not use, expensive. This does an arraycopy of the cell[]'s value.
*
* Added to ease transition from 0.94 -> 0.96.
*
* @deprecated as of 0.96, use {@link #listCells()}
* @return all sorted List of KeyValues; can be null if no cells in the result
*/
@Deprecated
public List<KeyValue> list() {
return isEmpty() ? null : Arrays.asList(raw());
}
/** /**
* Return the Cells for the specific column. The Cells are sorted in * Return the Cells for the specific column. The Cells are sorted in
@ -180,7 +215,7 @@ public class Result implements CellScannable {
public List<Cell> getColumn(byte [] family, byte [] qualifier) { public List<Cell> getColumn(byte [] family, byte [] qualifier) {
List<Cell> result = new ArrayList<Cell>(); List<Cell> result = new ArrayList<Cell>();
Cell [] kvs = raw(); Cell [] kvs = rawCells();
if (kvs == null || kvs.length == 0) { if (kvs == null || kvs.length == 0) {
return result; return result;
@ -275,7 +310,7 @@ public class Result implements CellScannable {
* selected in the query (Get/Scan) * selected in the query (Get/Scan)
*/ */
public Cell getColumnLatest(byte [] family, byte [] qualifier) { public Cell getColumnLatest(byte [] family, byte [] qualifier) {
Cell [] kvs = raw(); // side effect possibly. Cell [] kvs = rawCells(); // side effect possibly.
if (kvs == null || kvs.length == 0) { if (kvs == null || kvs.length == 0) {
return null; return null;
} }
@ -306,7 +341,7 @@ public class Result implements CellScannable {
public Cell getColumnLatest(byte [] family, int foffset, int flength, public Cell getColumnLatest(byte [] family, int foffset, int flength,
byte [] qualifier, int qoffset, int qlength) { byte [] qualifier, int qoffset, int qlength) {
Cell [] kvs = raw(); // side effect possibly. Cell [] kvs = rawCells(); // side effect possibly.
if (kvs == null || kvs.length == 0) { if (kvs == null || kvs.length == 0) {
return null; return null;
} }
@ -692,8 +727,8 @@ public class Result implements CellScannable {
throw new Exception("This row doesn't have the same number of KVs: " throw new Exception("This row doesn't have the same number of KVs: "
+ res1.toString() + " compared to " + res2.toString()); + res1.toString() + " compared to " + res2.toString());
} }
Cell[] ourKVs = res1.raw(); Cell[] ourKVs = res1.rawCells();
Cell[] replicatedKVs = res2.raw(); Cell[] replicatedKVs = res2.rawCells();
for (int i = 0; i < res1.size(); i++) { for (int i = 0; i < res1.size(); i++) {
if (!ourKVs[i].equals(replicatedKVs[i]) || if (!ourKVs[i].equals(replicatedKVs[i]) ||
!Bytes.equals(CellUtil.getValueArray(ourKVs[i]), CellUtil.getValueArray(replicatedKVs[i]))) { !Bytes.equals(CellUtil.getValueArray(ourKVs[i]), CellUtil.getValueArray(replicatedKVs[i]))) {

View File

@ -253,7 +253,7 @@ public class ScannerCallable extends RegionServerCallable<Result[]> {
} }
long resultSize = 0; long resultSize = 0;
for (Result rr : rrs) { for (Result rr : rrs) {
for (Cell kv : rr.raw()) { for (Cell kv : rr.rawCells()) {
// TODO add getLength to Cell/use CellUtil#estimatedSizeOf // TODO add getLength to Cell/use CellUtil#estimatedSizeOf
resultSize += KeyValueUtil.ensureKeyValue(kv).getLength(); resultSize += KeyValueUtil.ensureKeyValue(kv).getLength();
} }

View File

@ -1026,7 +1026,7 @@ public final class ProtobufUtil {
*/ */
public static ClientProtos.Result toResult(final Result result) { public static ClientProtos.Result toResult(final Result result) {
ClientProtos.Result.Builder builder = ClientProtos.Result.newBuilder(); ClientProtos.Result.Builder builder = ClientProtos.Result.newBuilder();
Cell [] cells = result.raw(); Cell [] cells = result.rawCells();
if (cells != null) { if (cells != null) {
for (Cell c : cells) { for (Cell c : cells) {
builder.addCell(toCell(c)); builder.addCell(toCell(c));

View File

@ -154,7 +154,7 @@ public class IntegrationTestImportTsv implements Configurable, Tool {
Iterator<KeyValue> expectedIt = simple_expected.iterator(); Iterator<KeyValue> expectedIt = simple_expected.iterator();
while (resultsIt.hasNext() && expectedIt.hasNext()) { while (resultsIt.hasNext() && expectedIt.hasNext()) {
Result r = resultsIt.next(); Result r = resultsIt.next();
for (Cell actual : r.raw()) { for (Cell actual : r.rawCells()) {
assertTrue( assertTrue(
"Ran out of expected values prematurely!", "Ran out of expected values prematurely!",
expectedIt.hasNext()); expectedIt.hasNext());

View File

@ -248,7 +248,7 @@ public class IntegrationTestLoadAndVerify extends IntegrationTestBase {
throws IOException, InterruptedException { throws IOException, InterruptedException {
BytesWritable bwKey = new BytesWritable(key.get()); BytesWritable bwKey = new BytesWritable(key.get());
BytesWritable bwVal = new BytesWritable(); BytesWritable bwVal = new BytesWritable();
for (Cell kv : value.list()) { for (Cell kv : value.listCells()) {
if (Bytes.compareTo(TEST_QUALIFIER, 0, TEST_QUALIFIER.length, if (Bytes.compareTo(TEST_QUALIFIER, 0, TEST_QUALIFIER.length,
kv.getQualifierArray(), kv.getQualifierOffset(), kv.getQualifierLength()) == 0) { kv.getQualifierArray(), kv.getQualifierOffset(), kv.getQualifierLength()) == 0) {
context.write(bwKey, EMPTY); context.write(bwKey, EMPTY);

View File

@ -116,7 +116,7 @@ implements TableMap<ImmutableBytesWritable,Result> {
ArrayList<byte[]> foundList = new ArrayList<byte[]>(); ArrayList<byte[]> foundList = new ArrayList<byte[]>();
int numCols = columns.length; int numCols = columns.length;
if (numCols > 0) { if (numCols > 0) {
for (Cell value: r.list()) { for (Cell value: r.listCells()) {
byte [] column = KeyValue.makeColumn(CellUtil.getFamilyArray(value), byte [] column = KeyValue.makeColumn(CellUtil.getFamilyArray(value),
CellUtil.getQualifierArray(value)); CellUtil.getQualifierArray(value));
for (int i = 0; i < numCols; i++) { for (int i = 0; i < numCols; i++) {

View File

@ -116,7 +116,7 @@ public class CellCounter {
context.getCounter(Counters.ROWS).increment(1); context.getCounter(Counters.ROWS).increment(1);
context.write(new Text("Total ROWS"), new IntWritable(1)); context.write(new Text("Total ROWS"), new IntWritable(1));
for (Cell value : values.list()) { for (Cell value : values.listCells()) {
currentRowKey = Bytes.toStringBinary(CellUtil.getRowArray(value)); currentRowKey = Bytes.toStringBinary(CellUtil.getRowArray(value));
String thisRowFamilyName = Bytes.toStringBinary(CellUtil.getFamilyArray(value)); String thisRowFamilyName = Bytes.toStringBinary(CellUtil.getFamilyArray(value));
if (!thisRowFamilyName.equals(currentFamilyName)) { if (!thisRowFamilyName.equals(currentFamilyName)) {

View File

@ -109,7 +109,7 @@ extends TableMapper<ImmutableBytesWritable,Result> implements Configurable {
ArrayList<byte[]> foundList = new ArrayList<byte[]>(); ArrayList<byte[]> foundList = new ArrayList<byte[]>();
int numCols = columns.length; int numCols = columns.length;
if (numCols > 0) { if (numCols > 0) {
for (Cell value: r.list()) { for (Cell value: r.listCells()) {
byte [] column = KeyValue.makeColumn(CellUtil.getFamilyArray(value), byte [] column = KeyValue.makeColumn(CellUtil.getFamilyArray(value),
CellUtil.getQualifierArray(value)); CellUtil.getQualifierArray(value));
for (int i = 0; i < numCols; i++) { for (int i = 0; i < numCols; i++) {

View File

@ -93,7 +93,7 @@ public class Import {
Context context) Context context)
throws IOException { throws IOException {
try { try {
for (Cell kv : value.raw()) { for (Cell kv : value.rawCells()) {
kv = filterKv(kv); kv = filterKv(kv);
// skip if we filtered it out // skip if we filtered it out
if (kv == null) continue; if (kv == null) continue;
@ -143,7 +143,7 @@ public class Import {
throws IOException, InterruptedException { throws IOException, InterruptedException {
Put put = null; Put put = null;
Delete delete = null; Delete delete = null;
for (Cell kv : result.raw()) { for (Cell kv : result.rawCells()) {
kv = filterKv(kv); kv = filterKv(kv);
// skip if we filter it out // skip if we filter it out
if (kv == null) continue; if (kv == null) continue;

View File

@ -3070,7 +3070,7 @@ public class HRegionServer implements ClientProtos.ClientService.BlockingInterfa
if (!results.isEmpty()) { if (!results.isEmpty()) {
for (Result r : results) { for (Result r : results) {
if (maxScannerResultSize < Long.MAX_VALUE){ if (maxScannerResultSize < Long.MAX_VALUE){
for (Cell kv : r.raw()) { for (Cell kv : r.rawCells()) {
// TODO // TODO
currentScanResultSize += KeyValueUtil.ensureKeyValue(kv).heapSize(); currentScanResultSize += KeyValueUtil.ensureKeyValue(kv).heapSize();
} }

View File

@ -64,7 +64,7 @@ public class RowResultGenerator extends ResultGenerator {
} }
Result result = table.get(get); Result result = table.get(get);
if (result != null && !result.isEmpty()) { if (result != null && !result.isEmpty()) {
valuesI = result.list().iterator(); valuesI = result.listCells().iterator();
} }
} catch (DoNotRetryIOException e) { } catch (DoNotRetryIOException e) {
// Warn here because Stargate will return 404 in the case if multiple // Warn here because Stargate will return 404 in the case if multiple

View File

@ -149,7 +149,7 @@ public class ScannerResultGenerator extends ResultGenerator {
} }
} }
if (cached != null) { if (cached != null) {
rowI = cached.list().iterator(); rowI = cached.listCells().iterator();
loop = true; loop = true;
cached = null; cached = null;
} else { } else {
@ -162,7 +162,7 @@ public class ScannerResultGenerator extends ResultGenerator {
LOG.error(StringUtils.stringifyException(e)); LOG.error(StringUtils.stringifyException(e));
} }
if (result != null && !result.isEmpty()) { if (result != null && !result.isEmpty()) {
rowI = result.list().iterator(); rowI = result.listCells().iterator();
loop = true; loop = true;
} }
} }

View File

@ -513,7 +513,7 @@ public class AccessControlLists {
byte[] entryName, Result result) { byte[] entryName, Result result) {
ListMultimap<String, TablePermission> perms = ArrayListMultimap.create(); ListMultimap<String, TablePermission> perms = ArrayListMultimap.create();
if (result != null && result.size() > 0) { if (result != null && result.size() > 0) {
for (Cell kv : result.raw()) { for (Cell kv : result.rawCells()) {
Pair<String,TablePermission> permissionsOfUserOnTable = Pair<String,TablePermission> permissionsOfUserOnTable =
parsePermissionRecord(entryName, kv); parsePermissionRecord(entryName, kv);

View File

@ -672,7 +672,7 @@ public class ThriftServerRunner implements Runnable {
get.addColumn(family, qualifier); get.addColumn(family, qualifier);
} }
Result result = table.get(get); Result result = table.get(get);
return ThriftUtilities.cellFromHBase(result.raw()); return ThriftUtilities.cellFromHBase(result.rawCells());
} catch (IOException e) { } catch (IOException e) {
LOG.warn(e.getMessage(), e); LOG.warn(e.getMessage(), e);
throw new IOError(e.getMessage()); throw new IOError(e.getMessage());
@ -704,7 +704,7 @@ public class ThriftServerRunner implements Runnable {
get.addColumn(family, qualifier); get.addColumn(family, qualifier);
get.setMaxVersions(numVersions); get.setMaxVersions(numVersions);
Result result = table.get(get); Result result = table.get(get);
return ThriftUtilities.cellFromHBase(result.raw()); return ThriftUtilities.cellFromHBase(result.rawCells());
} catch (IOException e) { } catch (IOException e) {
LOG.warn(e.getMessage(), e); LOG.warn(e.getMessage(), e);
throw new IOError(e.getMessage()); throw new IOError(e.getMessage());
@ -740,7 +740,7 @@ public class ThriftServerRunner implements Runnable {
get.setTimeRange(0, timestamp); get.setTimeRange(0, timestamp);
get.setMaxVersions(numVersions); get.setMaxVersions(numVersions);
Result result = table.get(get); Result result = table.get(get);
return ThriftUtilities.cellFromHBase(result.raw()); return ThriftUtilities.cellFromHBase(result.rawCells());
} catch (IOException e) { } catch (IOException e) {
LOG.warn(e.getMessage(), e); LOG.warn(e.getMessage(), e);
throw new IOError(e.getMessage()); throw new IOError(e.getMessage());
@ -1371,7 +1371,7 @@ public class ThriftServerRunner implements Runnable {
try { try {
HTable table = getTable(getBytes(tableName)); HTable table = getTable(getBytes(tableName));
Result result = table.getRowOrBefore(getBytes(row), getBytes(family)); Result result = table.getRowOrBefore(getBytes(row), getBytes(family));
return ThriftUtilities.cellFromHBase(result.raw()); return ThriftUtilities.cellFromHBase(result.rawCells());
} catch (IOException e) { } catch (IOException e) {
LOG.warn(e.getMessage(), e); LOG.warn(e.getMessage(), e);
throw new IOError(e.getMessage()); throw new IOError(e.getMessage());

View File

@ -152,7 +152,7 @@ public class ThriftUtilities {
result.row = ByteBuffer.wrap(result_.getRow()); result.row = ByteBuffer.wrap(result_.getRow());
if (sortColumns) { if (sortColumns) {
result.sortedColumns = new ArrayList<TColumn>(); result.sortedColumns = new ArrayList<TColumn>();
for (Cell kv : result_.raw()) { for (Cell kv : result_.rawCells()) {
result.sortedColumns.add(new TColumn( result.sortedColumns.add(new TColumn(
ByteBuffer.wrap(KeyValue.makeColumn(CellUtil.getFamilyArray(kv), ByteBuffer.wrap(KeyValue.makeColumn(CellUtil.getFamilyArray(kv),
CellUtil.getQualifierArray(kv))), CellUtil.getQualifierArray(kv))),
@ -160,7 +160,7 @@ public class ThriftUtilities {
} }
} else { } else {
result.columns = new TreeMap<ByteBuffer, TCell>(); result.columns = new TreeMap<ByteBuffer, TCell>();
for (Cell kv : result_.raw()) { for (Cell kv : result_.rawCells()) {
result.columns.put( result.columns.put(
ByteBuffer.wrap(KeyValue.makeColumn(CellUtil.getFamilyArray(kv), ByteBuffer.wrap(KeyValue.makeColumn(CellUtil.getFamilyArray(kv),
CellUtil.getQualifierArray(kv))), CellUtil.getQualifierArray(kv))),

View File

@ -140,7 +140,7 @@ public class ThriftUtilities {
* @return converted result, returns an empty result if the input is <code>null</code> * @return converted result, returns an empty result if the input is <code>null</code>
*/ */
public static TResult resultFromHBase(Result in) { public static TResult resultFromHBase(Result in) {
Cell[] raw = in.raw(); Cell[] raw = in.rawCells();
TResult out = new TResult(); TResult out = new TResult();
byte[] row = in.getRow(); byte[] row = in.getRow();
if (row != null) { if (row != null) {

View File

@ -2570,8 +2570,8 @@ public class HBaseFsck extends Configured implements Tool {
public boolean processRow(Result result) throws IOException { public boolean processRow(Result result) throws IOException {
try { try {
// record the latest modification of this hbase:meta record // record the latest modification of this META record
long ts = Collections.max(result.list(), comp).getTimestamp(); long ts = Collections.max(result.listCells(), comp).getTimestamp();
Pair<HRegionInfo, ServerName> pair = HRegionInfo.getHRegionInfoAndServerName(result); Pair<HRegionInfo, ServerName> pair = HRegionInfo.getHRegionInfoAndServerName(result);
if (pair == null || pair.getFirst() == null) { if (pair == null || pair.getFirst() == null) {
emptyRegionInfoQualifiers.add(result); emptyRegionInfoQualifiers.add(result);

View File

@ -535,7 +535,7 @@ public abstract class HBaseTestCase extends TestCase {
return false; return false;
} }
values.clear(); values.clear();
values.addAll(results.list()); values.addAll(results.listCells());
return true; return true;
} }

View File

@ -173,7 +173,7 @@ public class TestAcidGuarantees implements Tool {
msg.append("Failed after ").append(numVerified).append("!"); msg.append("Failed after ").append(numVerified).append("!");
msg.append("Expected=").append(Bytes.toStringBinary(expected)); msg.append("Expected=").append(Bytes.toStringBinary(expected));
msg.append("Got:\n"); msg.append("Got:\n");
for (Cell kv : res.list()) { for (Cell kv : res.listCells()) {
msg.append(kv.toString()); msg.append(kv.toString());
msg.append(" val= "); msg.append(" val= ");
msg.append(Bytes.toStringBinary(CellUtil.getValueArray(kv))); msg.append(Bytes.toStringBinary(CellUtil.getValueArray(kv)));
@ -230,7 +230,7 @@ public class TestAcidGuarantees implements Tool {
msg.append("Failed after ").append(numRowsScanned).append("!"); msg.append("Failed after ").append(numRowsScanned).append("!");
msg.append("Expected=").append(Bytes.toStringBinary(expected)); msg.append("Expected=").append(Bytes.toStringBinary(expected));
msg.append("Got:\n"); msg.append("Got:\n");
for (Cell kv : res.list()) { for (Cell kv : res.listCells()) {
msg.append(kv.toString()); msg.append(kv.toString());
msg.append(" val= "); msg.append(" val= ");
msg.append(Bytes.toStringBinary(CellUtil.getValueArray(kv))); msg.append(Bytes.toStringBinary(CellUtil.getValueArray(kv)));

View File

@ -236,7 +236,7 @@ public class TestMultiVersions {
get.setTimeStamp(timestamp[j]); get.setTimeStamp(timestamp[j]);
Result result = table.get(get); Result result = table.get(get);
int cellCount = 0; int cellCount = 0;
for(@SuppressWarnings("unused")Cell kv : result.list()) { for(@SuppressWarnings("unused")Cell kv : result.listCells()) {
cellCount++; cellCount++;
} }
assertTrue(cellCount == 1); assertTrue(cellCount == 1);

View File

@ -107,7 +107,7 @@ public class TimestampTestBase extends HBaseTestCase {
get.setMaxVersions(3); get.setMaxVersions(3);
Result result = incommon.get(get); Result result = incommon.get(get);
assertEquals(1, result.size()); assertEquals(1, result.size());
long time = Bytes.toLong(CellUtil.getValueArray(result.raw()[0])); long time = Bytes.toLong(CellUtil.getValueArray(result.rawCells()[0]));
assertEquals(time, currentTime); assertEquals(time, currentTime);
} }
@ -136,7 +136,7 @@ public class TimestampTestBase extends HBaseTestCase {
get.addColumn(FAMILY_NAME, QUALIFIER_NAME); get.addColumn(FAMILY_NAME, QUALIFIER_NAME);
get.setMaxVersions(tss.length); get.setMaxVersions(tss.length);
Result result = incommon.get(get); Result result = incommon.get(get);
Cell [] kvs = result.raw(); Cell [] kvs = result.rawCells();
assertEquals(kvs.length, tss.length); assertEquals(kvs.length, tss.length);
for(int i=0;i<kvs.length;i++) { for(int i=0;i<kvs.length;i++) {
t = Bytes.toLong(CellUtil.getValueArray(kvs[i])); t = Bytes.toLong(CellUtil.getValueArray(kvs[i]));
@ -152,7 +152,7 @@ public class TimestampTestBase extends HBaseTestCase {
get.setTimeRange(0, maxStamp); get.setTimeRange(0, maxStamp);
get.setMaxVersions(kvs.length - 1); get.setMaxVersions(kvs.length - 1);
result = incommon.get(get); result = incommon.get(get);
kvs = result.raw(); kvs = result.rawCells();
assertEquals(kvs.length, tss.length - 1); assertEquals(kvs.length, tss.length - 1);
for(int i=1;i<kvs.length;i++) { for(int i=1;i<kvs.length;i++) {
t = Bytes.toLong(CellUtil.getValueArray(kvs[i-1])); t = Bytes.toLong(CellUtil.getValueArray(kvs[i-1]));

View File

@ -207,7 +207,7 @@ public class TestFromClientSide {
s.setTimeRange(0, ts+3); s.setTimeRange(0, ts+3);
s.setMaxVersions(); s.setMaxVersions();
ResultScanner scanner = h.getScanner(s); ResultScanner scanner = h.getScanner(s);
Cell[] kvs = scanner.next().raw(); Cell[] kvs = scanner.next().rawCells();
assertArrayEquals(T2, CellUtil.getValueArray(kvs[0])); assertArrayEquals(T2, CellUtil.getValueArray(kvs[0]));
assertArrayEquals(T1, CellUtil.getValueArray(kvs[1])); assertArrayEquals(T1, CellUtil.getValueArray(kvs[1]));
scanner.close(); scanner.close();
@ -216,7 +216,7 @@ public class TestFromClientSide {
s.setRaw(true); s.setRaw(true);
s.setMaxVersions(); s.setMaxVersions();
scanner = h.getScanner(s); scanner = h.getScanner(s);
kvs = scanner.next().raw(); kvs = scanner.next().rawCells();
assertTrue(CellUtil.isDeleteFamily(kvs[0])); assertTrue(CellUtil.isDeleteFamily(kvs[0]));
assertArrayEquals(T3, CellUtil.getValueArray(kvs[1])); assertArrayEquals(T3, CellUtil.getValueArray(kvs[1]));
assertTrue(CellUtil.isDelete(kvs[2])); assertTrue(CellUtil.isDelete(kvs[2]));
@ -477,7 +477,7 @@ public class TestFromClientSide {
while (scanner.hasNext()) { while (scanner.hasNext()) {
Result result = scanner.next(); Result result = scanner.next();
System.out.println("Got back key: " + Bytes.toString(result.getRow())); System.out.println("Got back key: " + Bytes.toString(result.getRow()));
for (Cell kv : result.raw()) { for (Cell kv : result.rawCells()) {
System.out.println("kv=" + kv.toString() + ", " System.out.println("kv=" + kv.toString() + ", "
+ Bytes.toString(CellUtil.getValueArray(kv))); + Bytes.toString(CellUtil.getValueArray(kv)));
} }
@ -748,8 +748,8 @@ public class TestFromClientSide {
int expectedIndex = 1; int expectedIndex = 1;
for(Result result : ht.getScanner(scan)) { for(Result result : ht.getScanner(scan)) {
assertEquals(result.size(), 1); assertEquals(result.size(), 1);
assertTrue(Bytes.equals(CellUtil.getRowArray(result.raw()[0]), ROWS[expectedIndex])); assertTrue(Bytes.equals(CellUtil.getRowArray(result.rawCells()[0]), ROWS[expectedIndex]));
assertTrue(Bytes.equals(CellUtil.getQualifierArray(result.raw()[0]), assertTrue(Bytes.equals(CellUtil.getQualifierArray(result.rawCells()[0]),
QUALIFIERS[expectedIndex])); QUALIFIERS[expectedIndex]));
expectedIndex++; expectedIndex++;
} }
@ -783,8 +783,8 @@ public class TestFromClientSide {
int count = 0; int count = 0;
for(Result result : ht.getScanner(scan)) { for(Result result : ht.getScanner(scan)) {
assertEquals(result.size(), 1); assertEquals(result.size(), 1);
assertEquals(result.raw()[0].getValueLength(), Bytes.SIZEOF_INT); assertEquals(result.rawCells()[0].getValueLength(), Bytes.SIZEOF_INT);
assertEquals(Bytes.toInt(CellUtil.getValueArray(result.raw()[0])), VALUE.length); assertEquals(Bytes.toInt(CellUtil.getValueArray(result.rawCells()[0])), VALUE.length);
count++; count++;
} }
assertEquals(count, 10); assertEquals(count, 10);
@ -2135,15 +2135,15 @@ public class TestFromClientSide {
result = scanner.next(); result = scanner.next();
assertTrue("Expected 1 key but received " + result.size(), assertTrue("Expected 1 key but received " + result.size(),
result.size() == 1); result.size() == 1);
assertTrue(Bytes.equals(CellUtil.getRowArray(result.raw()[0]), ROWS[3])); assertTrue(Bytes.equals(CellUtil.getRowArray(result.rawCells()[0]), ROWS[3]));
assertTrue(Bytes.equals(CellUtil.getValueArray(result.raw()[0]), VALUES[0])); assertTrue(Bytes.equals(CellUtil.getValueArray(result.rawCells()[0]), VALUES[0]));
result = scanner.next(); result = scanner.next();
assertTrue("Expected 2 keys but received " + result.size(), assertTrue("Expected 2 keys but received " + result.size(),
result.size() == 2); result.size() == 2);
assertTrue(Bytes.equals(CellUtil.getRowArray(result.raw()[0]), ROWS[4])); assertTrue(Bytes.equals(CellUtil.getRowArray(result.rawCells()[0]), ROWS[4]));
assertTrue(Bytes.equals(CellUtil.getRowArray(result.raw()[1]), ROWS[4])); assertTrue(Bytes.equals(CellUtil.getRowArray(result.rawCells()[1]), ROWS[4]));
assertTrue(Bytes.equals(CellUtil.getValueArray(result.raw()[0]), VALUES[1])); assertTrue(Bytes.equals(CellUtil.getValueArray(result.rawCells()[0]), VALUES[1]));
assertTrue(Bytes.equals(CellUtil.getValueArray(result.raw()[1]), VALUES[2])); assertTrue(Bytes.equals(CellUtil.getValueArray(result.rawCells()[1]), VALUES[2]));
scanner.close(); scanner.close();
// Add test of bulk deleting. // Add test of bulk deleting.
@ -2271,7 +2271,7 @@ public class TestFromClientSide {
Get get = new Get(ROWS[numRows-1]); Get get = new Get(ROWS[numRows-1]);
Result result = ht.get(get); Result result = ht.get(get);
assertNumKeys(result, numColsPerRow); assertNumKeys(result, numColsPerRow);
Cell [] keys = result.raw(); Cell [] keys = result.rawCells();
for(int i=0;i<result.size();i++) { for(int i=0;i<result.size();i++) {
assertKey(keys[i], ROWS[numRows-1], FAMILY, QUALIFIERS[i], QUALIFIERS[i]); assertKey(keys[i], ROWS[numRows-1], FAMILY, QUALIFIERS[i], QUALIFIERS[i]);
} }
@ -2282,7 +2282,7 @@ public class TestFromClientSide {
int rowCount = 0; int rowCount = 0;
while((result = scanner.next()) != null) { while((result = scanner.next()) != null) {
assertNumKeys(result, numColsPerRow); assertNumKeys(result, numColsPerRow);
Cell [] kvs = result.raw(); Cell [] kvs = result.rawCells();
for(int i=0;i<numColsPerRow;i++) { for(int i=0;i<numColsPerRow;i++) {
assertKey(kvs[i], ROWS[rowCount], FAMILY, QUALIFIERS[i], QUALIFIERS[i]); assertKey(kvs[i], ROWS[rowCount], FAMILY, QUALIFIERS[i], QUALIFIERS[i]);
} }
@ -2300,7 +2300,7 @@ public class TestFromClientSide {
get = new Get(ROWS[numRows-1]); get = new Get(ROWS[numRows-1]);
result = ht.get(get); result = ht.get(get);
assertNumKeys(result, numColsPerRow); assertNumKeys(result, numColsPerRow);
keys = result.raw(); keys = result.rawCells();
for(int i=0;i<result.size();i++) { for(int i=0;i<result.size();i++) {
assertKey(keys[i], ROWS[numRows-1], FAMILY, QUALIFIERS[i], QUALIFIERS[i]); assertKey(keys[i], ROWS[numRows-1], FAMILY, QUALIFIERS[i], QUALIFIERS[i]);
} }
@ -2311,7 +2311,7 @@ public class TestFromClientSide {
rowCount = 0; rowCount = 0;
while((result = scanner.next()) != null) { while((result = scanner.next()) != null) {
assertNumKeys(result, numColsPerRow); assertNumKeys(result, numColsPerRow);
Cell [] kvs = result.raw(); Cell [] kvs = result.rawCells();
for(int i=0;i<numColsPerRow;i++) { for(int i=0;i<numColsPerRow;i++) {
assertKey(kvs[i], ROWS[rowCount], FAMILY, QUALIFIERS[i], QUALIFIERS[i]); assertKey(kvs[i], ROWS[rowCount], FAMILY, QUALIFIERS[i], QUALIFIERS[i]);
} }
@ -3133,7 +3133,7 @@ public class TestFromClientSide {
assertTrue("Expected " + idxs.length + " keys but result contains " assertTrue("Expected " + idxs.length + " keys but result contains "
+ result.size(), result.size() == idxs.length); + result.size(), result.size() == idxs.length);
Cell [] keys = result.raw(); Cell [] keys = result.rawCells();
for(int i=0;i<keys.length;i++) { for(int i=0;i<keys.length;i++) {
byte [] family = families[idxs[i][0]]; byte [] family = families[idxs[i][0]];
@ -3166,7 +3166,7 @@ public class TestFromClientSide {
int expectedResults = end - start + 1; int expectedResults = end - start + 1;
assertEquals(expectedResults, result.size()); assertEquals(expectedResults, result.size());
Cell[] keys = result.raw(); Cell[] keys = result.rawCells();
for (int i=0; i<keys.length; i++) { for (int i=0; i<keys.length; i++) {
byte [] value = values[end-i]; byte [] value = values[end-i];
@ -3200,7 +3200,7 @@ public class TestFromClientSide {
equals(row, result.getRow())); equals(row, result.getRow()));
assertTrue("Expected two keys but result contains " + result.size(), assertTrue("Expected two keys but result contains " + result.size(),
result.size() == 2); result.size() == 2);
Cell [] kv = result.raw(); Cell [] kv = result.rawCells();
Cell kvA = kv[0]; Cell kvA = kv[0];
assertTrue("(A) Expected family [" + Bytes.toString(familyA) + "] " + assertTrue("(A) Expected family [" + Bytes.toString(familyA) + "] " +
"Got family [" + Bytes.toString(CellUtil.getFamilyArray(kvA)) + "]", "Got family [" + Bytes.toString(CellUtil.getFamilyArray(kvA)) + "]",
@ -3231,7 +3231,7 @@ public class TestFromClientSide {
equals(row, result.getRow())); equals(row, result.getRow()));
assertTrue("Expected a single key but result contains " + result.size(), assertTrue("Expected a single key but result contains " + result.size(),
result.size() == 1); result.size() == 1);
Cell kv = result.raw()[0]; Cell kv = result.rawCells()[0];
assertTrue("Expected family [" + Bytes.toString(family) + "] " + assertTrue("Expected family [" + Bytes.toString(family) + "] " +
"Got family [" + Bytes.toString(CellUtil.getFamilyArray(kv)) + "]", "Got family [" + Bytes.toString(CellUtil.getFamilyArray(kv)) + "]",
equals(family, CellUtil.getFamilyArray(kv))); equals(family, CellUtil.getFamilyArray(kv)));
@ -3251,7 +3251,7 @@ public class TestFromClientSide {
equals(row, result.getRow())); equals(row, result.getRow()));
assertTrue("Expected a single key but result contains " + result.size(), assertTrue("Expected a single key but result contains " + result.size(),
result.size() == 1); result.size() == 1);
Cell kv = result.raw()[0]; Cell kv = result.rawCells()[0];
assertTrue("Expected family [" + Bytes.toString(family) + "] " + assertTrue("Expected family [" + Bytes.toString(family) + "] " +
"Got family [" + Bytes.toString(CellUtil.getFamilyArray(kv)) + "]", "Got family [" + Bytes.toString(CellUtil.getFamilyArray(kv)) + "]",
equals(family, CellUtil.getFamilyArray(kv))); equals(family, CellUtil.getFamilyArray(kv)));
@ -3814,7 +3814,7 @@ public class TestFromClientSide {
scan.addColumn(CONTENTS_FAMILY, null); scan.addColumn(CONTENTS_FAMILY, null);
ResultScanner scanner = table.getScanner(scan); ResultScanner scanner = table.getScanner(scan);
for (Result r : scanner) { for (Result r : scanner) {
for(Cell key : r.raw()) { for(Cell key : r.rawCells()) {
System.out.println(Bytes.toString(r.getRow()) + ": " + key.toString()); System.out.println(Bytes.toString(r.getRow()) + ": " + key.toString());
} }
} }
@ -4016,7 +4016,7 @@ public class TestFromClientSide {
int index = 0; int index = 0;
Result r = null; Result r = null;
while ((r = s.next()) != null) { while ((r = s.next()) != null) {
for(Cell key : r.raw()) { for(Cell key : r.rawCells()) {
times[index++] = key.getTimestamp(); times[index++] = key.getTimestamp();
} }
} }
@ -4050,7 +4050,7 @@ public class TestFromClientSide {
int index = 0; int index = 0;
Result r = null; Result r = null;
while ((r = s.next()) != null) { while ((r = s.next()) != null) {
for(Cell key : r.raw()) { for(Cell key : r.rawCells()) {
times[index++] = key.getTimestamp(); times[index++] = key.getTimestamp();
} }
} }
@ -4177,7 +4177,7 @@ public class TestFromClientSide {
for (Result r : s) { for (Result r : s) {
put = new Put(r.getRow()); put = new Put(r.getRow());
put.setDurability(Durability.SKIP_WAL); put.setDurability(Durability.SKIP_WAL);
for (Cell kv : r.raw()) { for (Cell kv : r.rawCells()) {
put.add(kv); put.add(kv);
} }
b.put(put); b.put(put);
@ -4526,7 +4526,7 @@ public class TestFromClientSide {
// Verify expected results // Verify expected results
Result r = ht.get(new Get(ROW)); Result r = ht.get(new Get(ROW));
Cell [] kvs = r.raw(); Cell [] kvs = r.rawCells();
assertEquals(5, kvs.length); assertEquals(5, kvs.length);
assertIncrementKey(kvs[0], ROW, FAMILY, QUALIFIERS[0], 1); assertIncrementKey(kvs[0], ROW, FAMILY, QUALIFIERS[0], 1);
assertIncrementKey(kvs[1], ROW, FAMILY, QUALIFIERS[1], 3); assertIncrementKey(kvs[1], ROW, FAMILY, QUALIFIERS[1], 3);
@ -4542,7 +4542,7 @@ public class TestFromClientSide {
ht.increment(inc); ht.increment(inc);
// Verify // Verify
r = ht.get(new Get(ROWS[0])); r = ht.get(new Get(ROWS[0]));
kvs = r.raw(); kvs = r.rawCells();
assertEquals(QUALIFIERS.length, kvs.length); assertEquals(QUALIFIERS.length, kvs.length);
for (int i=0;i<QUALIFIERS.length;i++) { for (int i=0;i<QUALIFIERS.length;i++) {
assertIncrementKey(kvs[i], ROWS[0], FAMILY, QUALIFIERS[i], i+1); assertIncrementKey(kvs[i], ROWS[0], FAMILY, QUALIFIERS[i], i+1);
@ -4556,7 +4556,7 @@ public class TestFromClientSide {
ht.increment(inc); ht.increment(inc);
// Verify // Verify
r = ht.get(new Get(ROWS[0])); r = ht.get(new Get(ROWS[0]));
kvs = r.raw(); kvs = r.rawCells();
assertEquals(QUALIFIERS.length, kvs.length); assertEquals(QUALIFIERS.length, kvs.length);
for (int i=0;i<QUALIFIERS.length;i++) { for (int i=0;i<QUALIFIERS.length;i++) {
assertIncrementKey(kvs[i], ROWS[0], FAMILY, QUALIFIERS[i], 2*(i+1)); assertIncrementKey(kvs[i], ROWS[0], FAMILY, QUALIFIERS[i], 2*(i+1));
@ -5199,7 +5199,7 @@ public class TestFromClientSide {
ResultScanner scanner = table.getScanner(s); ResultScanner scanner = table.getScanner(s);
int count = 0; int count = 0;
for (Result r : scanner) { for (Result r : scanner) {
assertEquals("Found an unexpected number of results for the row!", versions, r.list().size()); assertEquals("Found an unexpected number of results for the row!", versions, r.listCells().size());
count++; count++;
} }
assertEquals("Found more than a single row when raw scanning the table with a single row!", 1, assertEquals("Found more than a single row when raw scanning the table with a single row!", 1,
@ -5213,7 +5213,7 @@ public class TestFromClientSide {
scanner = table.getScanner(s); scanner = table.getScanner(s);
count = 0; count = 0;
for (Result r : scanner) { for (Result r : scanner) {
assertEquals("Found an unexpected number of results for the row!", versions, r.list().size()); assertEquals("Found an unexpected number of results for the row!", versions, r.listCells().size());
count++; count++;
} }
assertEquals("Found more than a single row when raw scanning the table with a single row!", 1, assertEquals("Found more than a single row when raw scanning the table with a single row!", 1,
@ -5227,7 +5227,7 @@ public class TestFromClientSide {
scanner = table.getScanner(s); scanner = table.getScanner(s);
count = 0; count = 0;
for (Result r : scanner) { for (Result r : scanner) {
assertEquals("Found an unexpected number of results for the row!", versions, r.list().size()); assertEquals("Found an unexpected number of results for the row!", versions, r.listCells().size());
count++; count++;
} }
assertEquals("Found more than a single row when raw scanning the table with a single row!", 1, assertEquals("Found more than a single row when raw scanning the table with a single row!", 1,

View File

@ -86,7 +86,7 @@ public class TestFromClientSideNoCodec {
ResultScanner scanner = ht.getScanner(new Scan()); ResultScanner scanner = ht.getScanner(new Scan());
int count = 0; int count = 0;
while ((r = scanner.next()) != null) { while ((r = scanner.next()) != null) {
assertTrue(r.list().size() == 3); assertTrue(r.listCells().size() == 3);
count++; count++;
} }
assertTrue(count == 1); assertTrue(count == 1);

View File

@ -184,8 +184,8 @@ public class TestMultiParallel {
Assert.assertEquals(singleRes.size(), multiRes.length); Assert.assertEquals(singleRes.size(), multiRes.length);
for (int i = 0; i < singleRes.size(); i++) { for (int i = 0; i < singleRes.size(); i++) {
Assert.assertTrue(singleRes.get(i).containsColumn(BYTES_FAMILY, QUALIFIER)); Assert.assertTrue(singleRes.get(i).containsColumn(BYTES_FAMILY, QUALIFIER));
Cell[] singleKvs = singleRes.get(i).raw(); Cell[] singleKvs = singleRes.get(i).rawCells();
Cell[] multiKvs = multiRes[i].raw(); Cell[] multiKvs = multiRes[i].rawCells();
for (int j = 0; j < singleKvs.length; j++) { for (int j = 0; j < singleKvs.length; j++) {
Assert.assertEquals(singleKvs[j], multiKvs[j]); Assert.assertEquals(singleKvs[j], multiKvs[j]);
Assert.assertEquals(0, Bytes.compareTo(CellUtil.getValueArray(singleKvs[j]), Assert.assertEquals(0, Bytes.compareTo(CellUtil.getValueArray(singleKvs[j]),
@ -587,7 +587,7 @@ public class TestMultiParallel {
Result result = (Result)r1; Result result = (Result)r1;
Assert.assertTrue(result != null); Assert.assertTrue(result != null);
Assert.assertTrue(result.getRow() == null); Assert.assertTrue(result.getRow() == null);
Assert.assertEquals(0, result.raw().length); Assert.assertEquals(0, result.rawCells().length);
} }
private void validateSizeAndEmpty(Object[] results, int expectedSize) { private void validateSizeAndEmpty(Object[] results, int expectedSize) {

View File

@ -107,11 +107,11 @@ public class TestMultipleTimestamps {
Cell [] kvs; Cell [] kvs;
kvs = scanner.next().raw(); kvs = scanner.next().rawCells();
assertEquals(2, kvs.length); assertEquals(2, kvs.length);
checkOneCell(kvs[0], FAMILY, 3, 3, 4); checkOneCell(kvs[0], FAMILY, 3, 3, 4);
checkOneCell(kvs[1], FAMILY, 3, 3, 3); checkOneCell(kvs[1], FAMILY, 3, 3, 3);
kvs = scanner.next().raw(); kvs = scanner.next().rawCells();
assertEquals(2, kvs.length); assertEquals(2, kvs.length);
checkOneCell(kvs[0], FAMILY, 5, 3, 4); checkOneCell(kvs[0], FAMILY, 5, 3, 4);
checkOneCell(kvs[1], FAMILY, 5, 3, 3); checkOneCell(kvs[1], FAMILY, 5, 3, 3);
@ -149,10 +149,10 @@ public class TestMultipleTimestamps {
Cell[] kvs; Cell[] kvs;
kvs = scanner.next().raw(); kvs = scanner.next().rawCells();
assertEquals(1, kvs.length); assertEquals(1, kvs.length);
checkOneCell(kvs[0], FAMILY, 3, 3, 3); checkOneCell(kvs[0], FAMILY, 3, 3, 3);
kvs = scanner.next().raw(); kvs = scanner.next().rawCells();
assertEquals(1, kvs.length); assertEquals(1, kvs.length);
checkOneCell(kvs[0], FAMILY, 5, 3, 3); checkOneCell(kvs[0], FAMILY, 5, 3, 3);
@ -198,13 +198,13 @@ public class TestMultipleTimestamps {
// This looks like wrong answer. Should be 2. Even then we are returning wrong result, // This looks like wrong answer. Should be 2. Even then we are returning wrong result,
// timestamps that are 3 whereas should be 2 since min is inclusive. // timestamps that are 3 whereas should be 2 since min is inclusive.
kvs = scanner.next().raw(); kvs = scanner.next().rawCells();
assertEquals(4, kvs.length); assertEquals(4, kvs.length);
checkOneCell(kvs[0], FAMILY, 5, 3, 3); checkOneCell(kvs[0], FAMILY, 5, 3, 3);
checkOneCell(kvs[1], FAMILY, 5, 3, 2); checkOneCell(kvs[1], FAMILY, 5, 3, 2);
checkOneCell(kvs[2], FAMILY, 5, 5, 3); checkOneCell(kvs[2], FAMILY, 5, 5, 3);
checkOneCell(kvs[3], FAMILY, 5, 5, 2); checkOneCell(kvs[3], FAMILY, 5, 5, 2);
kvs = scanner.next().raw(); kvs = scanner.next().rawCells();
assertEquals(4, kvs.length); assertEquals(4, kvs.length);
checkOneCell(kvs[0], FAMILY, 7, 3, 3); checkOneCell(kvs[0], FAMILY, 7, 3, 3);
checkOneCell(kvs[1], FAMILY, 7, 3, 2); checkOneCell(kvs[1], FAMILY, 7, 3, 2);
@ -254,20 +254,20 @@ public class TestMultipleTimestamps {
Cell[] kvs; Cell[] kvs;
kvs = scanner.next().raw(); kvs = scanner.next().rawCells();
assertEquals(2, kvs.length); assertEquals(2, kvs.length);
checkOneCell(kvs[0], FAMILY, 3, 3, 4); checkOneCell(kvs[0], FAMILY, 3, 3, 4);
checkOneCell(kvs[1], FAMILY, 3, 5, 2); checkOneCell(kvs[1], FAMILY, 3, 5, 2);
kvs = scanner.next().raw(); kvs = scanner.next().rawCells();
assertEquals(1, kvs.length); assertEquals(1, kvs.length);
checkOneCell(kvs[0], FAMILY, 5, 3, 4); checkOneCell(kvs[0], FAMILY, 5, 3, 4);
kvs = scanner.next().raw(); kvs = scanner.next().rawCells();
assertEquals(1, kvs.length); assertEquals(1, kvs.length);
checkOneCell(kvs[0], FAMILY, 6, 3, 4); checkOneCell(kvs[0], FAMILY, 6, 3, 4);
kvs = scanner.next().raw(); kvs = scanner.next().rawCells();
assertEquals(1, kvs.length); assertEquals(1, kvs.length);
checkOneCell(kvs[0], FAMILY, 7, 3, 4); checkOneCell(kvs[0], FAMILY, 7, 3, 4);
@ -439,7 +439,7 @@ public class TestMultipleTimestamps {
get.setTimeRange(Collections.min(versions), Collections.max(versions)+1); get.setTimeRange(Collections.min(versions), Collections.max(versions)+1);
Result result = ht.get(get); Result result = ht.get(get);
return result.raw(); return result.rawCells();
} }
private ResultScanner scan(HTable ht, byte[] cf, private ResultScanner scan(HTable ht, byte[] cf,

View File

@ -320,7 +320,7 @@ public class TestScannersFromClientSide {
ResultScanner scanner = ht.getScanner(scan); ResultScanner scanner = ht.getScanner(scan);
kvListScan = new ArrayList<Cell>(); kvListScan = new ArrayList<Cell>();
while ((result = scanner.next()) != null) { while ((result = scanner.next()) != null) {
for (Cell kv : result.list()) { for (Cell kv : result.listCells()) {
kvListScan.add(kv); kvListScan.add(kv);
} }
} }
@ -434,7 +434,7 @@ public class TestScannersFromClientSide {
return; return;
int i = 0; int i = 0;
for (Cell kv : result.raw()) { for (Cell kv : result.rawCells()) {
if (i >= expKvList.size()) { if (i >= expKvList.size()) {
break; // we will check the size later break; // we will check the size later
} }

View File

@ -149,7 +149,7 @@ public class TestTimestampsFilter {
Arrays.asList(6L, 106L, 306L)); Arrays.asList(6L, 106L, 306L));
assertEquals("# of rows returned from scan", 5, results.length); assertEquals("# of rows returned from scan", 5, results.length);
for (int rowIdx = 0; rowIdx < 5; rowIdx++) { for (int rowIdx = 0; rowIdx < 5; rowIdx++) {
kvs = results[rowIdx].raw(); kvs = results[rowIdx].rawCells();
// each row should have 5 columns. // each row should have 5 columns.
// And we have requested 3 versions for each. // And we have requested 3 versions for each.
assertEquals("Number of KeyValues in result for row:" + rowIdx, assertEquals("Number of KeyValues in result for row:" + rowIdx,
@ -196,15 +196,15 @@ public class TestTimestampsFilter {
g.addColumn(FAMILY, Bytes.toBytes("column4")); g.addColumn(FAMILY, Bytes.toBytes("column4"));
Result result = ht.get(g); Result result = ht.get(g);
for (Cell kv : result.list()) { for (Cell kv : result.listCells()) {
System.out.println("found row " + Bytes.toString(CellUtil.getRowArray(kv)) + System.out.println("found row " + Bytes.toString(CellUtil.getRowArray(kv)) +
", column " + Bytes.toString(CellUtil.getQualifierArray(kv)) + ", value " ", column " + Bytes.toString(CellUtil.getQualifierArray(kv)) + ", value "
+ Bytes.toString(CellUtil.getValueArray(kv))); + Bytes.toString(CellUtil.getValueArray(kv)));
} }
assertEquals(result.list().size(), 2); assertEquals(result.listCells().size(), 2);
assertTrue(CellUtil.matchingValue(result.list().get(0), Bytes.toBytes("value2-3"))); assertTrue(CellUtil.matchingValue(result.listCells().get(0), Bytes.toBytes("value2-3")));
assertTrue(CellUtil.matchingValue(result.list().get(1), Bytes.toBytes("value4-3"))); assertTrue(CellUtil.matchingValue(result.listCells().get(1), Bytes.toBytes("value4-3")));
ht.close(); ht.close();
} }
@ -325,7 +325,7 @@ public class TestTimestampsFilter {
get.setMaxVersions(); get.setMaxVersions();
Result result = ht.get(get); Result result = ht.get(get);
return result.raw(); return result.rawCells();
} }
/** /**

View File

@ -123,7 +123,7 @@ public class TestOpenTableInCoprocessor {
ResultScanner results = table.getScanner(scan); ResultScanner results = table.getScanner(scan);
int count = 0; int count = 0;
for (Result res : results) { for (Result res : results) {
count += res.list().size(); count += res.listCells().size();
System.out.println(count + ") " + res); System.out.println(count + ") " + res);
} }
results.close(); results.close();

View File

@ -176,7 +176,7 @@ public class TestRegionObserverScannerOpenHook {
Result r = region.get(get); Result r = region.get(get);
assertNull( assertNull(
"Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor. Found: " "Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor. Found: "
+ r, r.list()); + r, r.listCells());
} }
@Test @Test
@ -201,7 +201,7 @@ public class TestRegionObserverScannerOpenHook {
Result r = region.get(get); Result r = region.get(get);
assertNull( assertNull(
"Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor. Found: " "Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor. Found: "
+ r, r.list()); + r, r.listCells());
} }
/** /**
@ -262,13 +262,13 @@ public class TestRegionObserverScannerOpenHook {
Result r = table.get(get); Result r = table.get(get);
assertNull( assertNull(
"Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor. Found: " "Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor. Found: "
+ r, r.list()); + r, r.listCells());
get = new Get(Bytes.toBytes("anotherrow")); get = new Get(Bytes.toBytes("anotherrow"));
r = table.get(get); r = table.get(get);
assertNull( assertNull(
"Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor Found: " "Got an unexpected number of rows - no data should be returned with the NoDataFromScan coprocessor Found: "
+ r, r.list()); + r, r.listCells());
table.close(); table.close();
UTIL.shutdownMiniCluster(); UTIL.shutdownMiniCluster();

View File

@ -166,7 +166,7 @@ public class TestRowProcessorEndpoint {
Set<String> expected = Set<String> expected =
new HashSet<String>(Arrays.asList(new String[]{"d", "e", "f", "g"})); new HashSet<String>(Arrays.asList(new String[]{"d", "e", "f", "g"}));
Get get = new Get(ROW); Get get = new Get(ROW);
LOG.debug("row keyvalues:" + stringifyKvs(table.get(get).list())); LOG.debug("row keyvalues:" + stringifyKvs(table.get(get).listCells()));
assertEquals(expected, result); assertEquals(expected, result);
} }
@ -177,7 +177,7 @@ public class TestRowProcessorEndpoint {
int numThreads = 1000; int numThreads = 1000;
concurrentExec(new IncrementRunner(), numThreads); concurrentExec(new IncrementRunner(), numThreads);
Get get = new Get(ROW); Get get = new Get(ROW);
LOG.debug("row keyvalues:" + stringifyKvs(table.get(get).list())); LOG.debug("row keyvalues:" + stringifyKvs(table.get(get).listCells()));
int finalCounter = incrementCounter(table); int finalCounter = incrementCounter(table);
assertEquals(numThreads + 1, finalCounter); assertEquals(numThreads + 1, finalCounter);
assertEquals(0, failures.get()); assertEquals(0, failures.get());
@ -238,11 +238,11 @@ public class TestRowProcessorEndpoint {
int numThreads = 1000; int numThreads = 1000;
concurrentExec(new SwapRowsRunner(), numThreads); concurrentExec(new SwapRowsRunner(), numThreads);
LOG.debug("row keyvalues:" + LOG.debug("row keyvalues:" +
stringifyKvs(table.get(new Get(ROW)).list())); stringifyKvs(table.get(new Get(ROW)).listCells()));
LOG.debug("row2 keyvalues:" + LOG.debug("row2 keyvalues:" +
stringifyKvs(table.get(new Get(ROW2)).list())); stringifyKvs(table.get(new Get(ROW2)).listCells()));
assertEquals(rowSize, table.get(new Get(ROW)).list().size()); assertEquals(rowSize, table.get(new Get(ROW)).listCells().size());
assertEquals(row2Size, table.get(new Get(ROW2)).list().size()); assertEquals(row2Size, table.get(new Get(ROW2)).listCells().size());
assertEquals(0, failures.get()); assertEquals(0, failures.get());
} }

View File

@ -219,7 +219,7 @@ public class TestColumnRangeFilter {
Result result; Result result;
while ((result = scanner.next()) != null) { while ((result = scanner.next()) != null) {
for (Cell kv : result.list()) { for (Cell kv : result.listCells()) {
results.add(kv); results.add(kv);
} }
} }

View File

@ -93,7 +93,7 @@ public class TestFilterWithScanLimits {
// row2 => <f1:c5, 2_c5> // row2 => <f1:c5, 2_c5>
for (Result result : scanner) { for (Result result : scanner) {
for (Cell kv : result.list()) { for (Cell kv : result.listCells()) {
kv_number++; kv_number++;
LOG.debug(kv_number + ". kv: " + kv); LOG.debug(kv_number + ". kv: " + kv);
} }

View File

@ -89,7 +89,7 @@ public class TestFilterWrapper {
// row2 (c1-c4) and row3(c1-c4) are returned // row2 (c1-c4) and row3(c1-c4) are returned
for (Result result : scanner) { for (Result result : scanner) {
row_number++; row_number++;
for (Cell kv : result.list()) { for (Cell kv : result.listCells()) {
LOG.debug(kv_number + ". kv: " + kv); LOG.debug(kv_number + ". kv: " + kv);
kv_number++; kv_number++;
assertEquals("Returned row is not correct", new String(CellUtil.getRowArray(kv)), assertEquals("Returned row is not correct", new String(CellUtil.getRowArray(kv)),

View File

@ -163,7 +163,7 @@ public class TestFuzzyRowAndColumnRangeFilter {
Result result; Result result;
long timeBeforeScan = System.currentTimeMillis(); long timeBeforeScan = System.currentTimeMillis();
while ((result = scanner.next()) != null) { while ((result = scanner.next()) != null) {
for (Cell kv : result.list()) { for (Cell kv : result.listCells()) {
LOG.info("Got rk: " + Bytes.toStringBinary(CellUtil.getRowArray(kv)) + " cq: " LOG.info("Got rk: " + Bytes.toStringBinary(CellUtil.getRowArray(kv)) + " cq: "
+ Bytes.toStringBinary(CellUtil.getQualifierArray(kv))); + Bytes.toStringBinary(CellUtil.getQualifierArray(kv)));
results.add(kv); results.add(kv);

View File

@ -213,7 +213,7 @@ public class TestTableMapReduce {
byte[] firstValue = null; byte[] firstValue = null;
byte[] secondValue = null; byte[] secondValue = null;
int count = 0; int count = 0;
for(Cell kv : r.list()) { for(Cell kv : r.listCells()) {
if (count == 0) { if (count == 0) {
firstValue = CellUtil.getValueArray(kv); firstValue = CellUtil.getValueArray(kv);
} }

View File

@ -106,7 +106,7 @@ public class TestCopyTable {
Get g = new Get(Bytes.toBytes("row" + i)); Get g = new Get(Bytes.toBytes("row" + i));
Result r = t2.get(g); Result r = t2.get(g);
assertEquals(1, r.size()); assertEquals(1, r.size());
assertTrue(CellUtil.matchingQualifier(r.raw()[0], COLUMN1)); assertTrue(CellUtil.matchingQualifier(r.rawCells()[0], COLUMN1));
} }
t1.close(); t1.close();
@ -150,7 +150,7 @@ public class TestCopyTable {
Get g = new Get(ROW1); Get g = new Get(ROW1);
Result r = t2.get(g); Result r = t2.get(g);
assertEquals(1, r.size()); assertEquals(1, r.size());
assertTrue(CellUtil.matchingQualifier(r.raw()[0], COLUMN1)); assertTrue(CellUtil.matchingQualifier(r.rawCells()[0], COLUMN1));
g = new Get(ROW0); g = new Get(ROW0);
r = t2.get(g); r = t2.get(g);

View File

@ -56,7 +56,7 @@ public class TestGroupingTableMapper {
.toBytes("value1"))); .toBytes("value1")));
keyValue.add(new KeyValue(row, Bytes.toBytes("family1"), Bytes.toBytes("clm"), Bytes keyValue.add(new KeyValue(row, Bytes.toBytes("family1"), Bytes.toBytes("clm"), Bytes
.toBytes("value2"))); .toBytes("value2")));
when(result.list()).thenReturn(keyValue); when(result.listCells()).thenReturn(keyValue);
mapper.map(null, result, context); mapper.map(null, result, context);
// template data // template data
byte[][] data = { Bytes.toBytes("value1"), Bytes.toBytes("value2") }; byte[][] data = { Bytes.toBytes("value1"), Bytes.toBytes("value2") };

View File

@ -427,9 +427,9 @@ public class TestHFileOutputFormat {
Scan scan = new Scan(); Scan scan = new Scan();
ResultScanner results = table.getScanner(scan); ResultScanner results = table.getScanner(scan);
for (Result res : results) { for (Result res : results) {
assertEquals(FAMILIES.length, res.raw().length); assertEquals(FAMILIES.length, res.rawCells().length);
Cell first = res.raw()[0]; Cell first = res.rawCells()[0];
for (Cell kv : res.raw()) { for (Cell kv : res.rawCells()) {
assertTrue(CellUtil.matchingRow(first, kv)); assertTrue(CellUtil.matchingRow(first, kv));
assertTrue(Bytes.equals(CellUtil.getValueArray(first), CellUtil.getValueArray(kv))); assertTrue(Bytes.equals(CellUtil.getValueArray(first), CellUtil.getValueArray(kv)));
} }

View File

@ -286,7 +286,7 @@ public class TestImportExport {
s.setRaw(true); s.setRaw(true);
ResultScanner scanner = t.getScanner(s); ResultScanner scanner = t.getScanner(s);
Result r = scanner.next(); Result r = scanner.next();
Cell[] res = r.raw(); Cell[] res = r.rawCells();
assertTrue(CellUtil.isDeleteFamily(res[0])); assertTrue(CellUtil.isDeleteFamily(res[0]));
assertEquals(now+4, res[1].getTimestamp()); assertEquals(now+4, res[1].getTimestamp());
assertEquals(now+3, res[2].getTimestamp()); assertEquals(now+3, res[2].getTimestamp());
@ -467,7 +467,7 @@ public class TestImportExport {
Bytes.toBytes("value")), Bytes.toBytes("value")),
new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("family"), Bytes.toBytes("qualifier"), new KeyValue(Bytes.toBytes("row"), Bytes.toBytes("family"), Bytes.toBytes("qualifier"),
Bytes.toBytes("value1")) }; Bytes.toBytes("value1")) };
when(value.raw()).thenReturn(keys); when(value.rawCells()).thenReturn(keys);
importer.map(new ImmutableBytesWritable(Bytes.toBytes("Key")), value, ctx); importer.map(new ImmutableBytesWritable(Bytes.toBytes("Key")), value, ctx);
} }

View File

@ -316,7 +316,7 @@ public class TestImportTsv implements Configurable {
ResultScanner resScanner = table.getScanner(scan); ResultScanner resScanner = table.getScanner(scan);
for (Result res : resScanner) { for (Result res : resScanner) {
assertTrue(res.size() == 2); assertTrue(res.size() == 2);
List<Cell> kvs = res.list(); List<Cell> kvs = res.listCells();
assertTrue(CellUtil.matchingRow(kvs.get(0), Bytes.toBytes("KEY"))); assertTrue(CellUtil.matchingRow(kvs.get(0), Bytes.toBytes("KEY")));
assertTrue(CellUtil.matchingRow(kvs.get(1), Bytes.toBytes("KEY"))); assertTrue(CellUtil.matchingRow(kvs.get(1), Bytes.toBytes("KEY")));
assertTrue(CellUtil.matchingValue(kvs.get(0), Bytes.toBytes("VALUE" + valueMultiplier))); assertTrue(CellUtil.matchingValue(kvs.get(0), Bytes.toBytes("VALUE" + valueMultiplier)));

View File

@ -213,7 +213,7 @@ public class TestMultithreadedTableMapper {
byte[] firstValue = null; byte[] firstValue = null;
byte[] secondValue = null; byte[] secondValue = null;
int count = 0; int count = 0;
for(Cell kv : r.list()) { for(Cell kv : r.listCells()) {
if (count == 0) { if (count == 0) {
firstValue = CellUtil.getValueArray(kv); firstValue = CellUtil.getValueArray(kv);
}else if (count == 1) { }else if (count == 1) {

View File

@ -226,7 +226,7 @@ public class TestTableMapReduce {
byte[] firstValue = null; byte[] firstValue = null;
byte[] secondValue = null; byte[] secondValue = null;
int count = 0; int count = 0;
for(Cell kv : r.list()) { for(Cell kv : r.listCells()) {
if (count == 0) { if (count == 0) {
firstValue = CellUtil.getValueArray(kv); firstValue = CellUtil.getValueArray(kv);
} }

View File

@ -110,7 +110,7 @@ public class TestTimeRangeMapRed {
Context context) Context context)
throws IOException { throws IOException {
List<Long> tsList = new ArrayList<Long>(); List<Long> tsList = new ArrayList<Long>();
for (Cell kv : result.list()) { for (Cell kv : result.listCells()) {
tsList.add(kv.getTimestamp()); tsList.add(kv.getTimestamp());
} }
@ -196,7 +196,7 @@ public class TestTimeRangeMapRed {
scan.setMaxVersions(1); scan.setMaxVersions(1);
ResultScanner scanner = table.getScanner(scan); ResultScanner scanner = table.getScanner(scan);
for (Result r: scanner) { for (Result r: scanner) {
for (Cell kv : r.list()) { for (Cell kv : r.listCells()) {
log.debug(Bytes.toString(r.getRow()) + "\t" + Bytes.toString(CellUtil.getFamilyArray(kv)) log.debug(Bytes.toString(r.getRow()) + "\t" + Bytes.toString(CellUtil.getFamilyArray(kv))
+ "\t" + Bytes.toString(CellUtil.getQualifierArray(kv)) + "\t" + Bytes.toString(CellUtil.getQualifierArray(kv))
+ "\t" + kv.getTimestamp() + "\t" + Bytes.toBoolean(CellUtil.getValueArray(kv))); + "\t" + kv.getTimestamp() + "\t" + Bytes.toBoolean(CellUtil.getValueArray(kv)));

View File

@ -124,7 +124,7 @@ public class TestWALPlayer {
Get g = new Get(ROW); Get g = new Get(ROW);
Result r = t2.get(g); Result r = t2.get(g);
assertEquals(1, r.size()); assertEquals(1, r.size());
assertTrue(CellUtil.matchingQualifier(r.raw()[0], COLUMN2)); assertTrue(CellUtil.matchingQualifier(r.rawCells()[0], COLUMN2));
} }
/** /**

View File

@ -174,7 +174,7 @@ public class TestAtomicOperation {
Result result = region.get(get); Result result = region.get(get);
assertEquals(1, result.size()); assertEquals(1, result.size());
Cell kv = result.raw()[0]; Cell kv = result.rawCells()[0];
long r = Bytes.toLong(CellUtil.getValueArray(kv)); long r = Bytes.toLong(CellUtil.getValueArray(kv));
assertEquals(amount, r); assertEquals(amount, r);
} }

View File

@ -160,7 +160,7 @@ public class TestBlocksRead extends HBaseTestCase {
get.addColumn(cf, Bytes.toBytes(column)); get.addColumn(cf, Bytes.toBytes(column));
} }
kvs = region.get(get).raw(); kvs = region.get(get).rawCells();
long blocksEnd = getBlkAccessCount(cf); long blocksEnd = getBlkAccessCount(cf);
if (expBlocks[i] != -1) { if (expBlocks[i] != -1) {
assertEquals("Blocks Read Check for Bloom: " + bloomType, expBlocks[i], assertEquals("Blocks Read Check for Bloom: " + bloomType, expBlocks[i],

View File

@ -1066,7 +1066,7 @@ public class TestHRegion extends HBaseTestCase {
Get get = new Get(row1); Get get = new Get(row1);
get.addColumn(fam2, qf1); get.addColumn(fam2, qf1);
Cell [] actual = region.get(get).raw(); Cell [] actual = region.get(get).rawCells();
Cell [] expected = {kv}; Cell [] expected = {kv};
@ -1386,7 +1386,7 @@ public class TestHRegion extends HBaseTestCase {
Get get = new Get(row).addColumn(fam, qual); Get get = new Get(row).addColumn(fam, qual);
Result result = region.get(get); Result result = region.get(get);
assertEquals(1, result.size()); assertEquals(1, result.size());
Cell kv = result.raw()[0]; Cell kv = result.rawCells()[0];
LOG.info("Got: " + kv); LOG.info("Got: " + kv);
assertTrue("LATEST_TIMESTAMP was not replaced with real timestamp", assertTrue("LATEST_TIMESTAMP was not replaced with real timestamp",
kv.getTimestamp() != HConstants.LATEST_TIMESTAMP); kv.getTimestamp() != HConstants.LATEST_TIMESTAMP);
@ -1402,7 +1402,7 @@ public class TestHRegion extends HBaseTestCase {
get = new Get(row).addColumn(fam, qual); get = new Get(row).addColumn(fam, qual);
result = region.get(get); result = region.get(get);
assertEquals(1, result.size()); assertEquals(1, result.size());
kv = result.raw()[0]; kv = result.rawCells()[0];
LOG.info("Got: " + kv); LOG.info("Got: " + kv);
assertTrue("LATEST_TIMESTAMP was not replaced with real timestamp", assertTrue("LATEST_TIMESTAMP was not replaced with real timestamp",
kv.getTimestamp() != HConstants.LATEST_TIMESTAMP); kv.getTimestamp() != HConstants.LATEST_TIMESTAMP);
@ -1656,9 +1656,9 @@ public class TestHRegion extends HBaseTestCase {
Result res = region.get(get); Result res = region.get(get);
assertEquals(expected.length, res.size()); assertEquals(expected.length, res.size());
for(int i=0; i<res.size(); i++){ for(int i=0; i<res.size(); i++){
assertTrue(CellUtil.matchingRow(expected[i], res.raw()[i])); assertTrue(CellUtil.matchingRow(expected[i], res.rawCells()[i]));
assertTrue(CellUtil.matchingFamily(expected[i], res.raw()[i])); assertTrue(CellUtil.matchingFamily(expected[i], res.rawCells()[i]));
assertTrue(CellUtil.matchingQualifier(expected[i], res.raw()[i])); assertTrue(CellUtil.matchingQualifier(expected[i], res.rawCells()[i]));
} }
// Test using a filter on a Get // Test using a filter on a Get
@ -2366,7 +2366,7 @@ public class TestHRegion extends HBaseTestCase {
Result result = region.get(get); Result result = region.get(get);
assertEquals(1, result.size()); assertEquals(1, result.size());
Cell kv = result.raw()[0]; Cell kv = result.rawCells()[0];
long r = Bytes.toLong(CellUtil.getValueArray(kv)); long r = Bytes.toLong(CellUtil.getValueArray(kv));
assertEquals(amount, r); assertEquals(amount, r);
} }
@ -2381,7 +2381,7 @@ public class TestHRegion extends HBaseTestCase {
Result result = region.get(get); Result result = region.get(get);
assertEquals(1, result.size()); assertEquals(1, result.size());
Cell kv = result.raw()[0]; Cell kv = result.rawCells()[0];
int r = Bytes.toInt(CellUtil.getValueArray(kv)); int r = Bytes.toInt(CellUtil.getValueArray(kv));
assertEquals(amount, r); assertEquals(amount, r);
} }
@ -3117,7 +3117,7 @@ public class TestHRegion extends HBaseTestCase {
// TODO this was removed, now what dangit?! // TODO this was removed, now what dangit?!
// search looking for the qualifier in question? // search looking for the qualifier in question?
long timestamp = 0; long timestamp = 0;
for (Cell kv : result.raw()) { for (Cell kv : result.rawCells()) {
if (CellUtil.matchingFamily(kv, families[0]) if (CellUtil.matchingFamily(kv, families[0])
&& CellUtil.matchingQualifier(kv, qualifiers[0])) { && CellUtil.matchingQualifier(kv, qualifiers[0])) {
timestamp = kv.getTimestamp(); timestamp = kv.getTimestamp();
@ -3127,7 +3127,7 @@ public class TestHRegion extends HBaseTestCase {
prevTimestamp = timestamp; prevTimestamp = timestamp;
Cell previousKV = null; Cell previousKV = null;
for (Cell kv : result.raw()) { for (Cell kv : result.rawCells()) {
byte[] thisValue = CellUtil.getValueArray(kv); byte[] thisValue = CellUtil.getValueArray(kv);
if (previousKV != null) { if (previousKV != null) {
if (Bytes.compareTo(CellUtil.getValueArray(previousKV), thisValue) != 0) { if (Bytes.compareTo(CellUtil.getValueArray(previousKV), thisValue) != 0) {
@ -3324,7 +3324,7 @@ public class TestHRegion extends HBaseTestCase {
//Get rows //Get rows
Get get = new Get(row); Get get = new Get(row);
get.setMaxVersions(); get.setMaxVersions();
Cell[] kvs = region.get(get).raw(); Cell[] kvs = region.get(get).rawCells();
//Check if rows are correct //Check if rows are correct
assertEquals(4, kvs.length); assertEquals(4, kvs.length);
@ -3375,7 +3375,7 @@ public class TestHRegion extends HBaseTestCase {
Get get = new Get(row); Get get = new Get(row);
get.addColumn(familyName, col); get.addColumn(familyName, col);
Cell[] keyValues = region.get(get).raw(); Cell[] keyValues = region.get(get).rawCells();
assertTrue(keyValues.length == 0); assertTrue(keyValues.length == 0);
} finally { } finally {
HRegion.closeHRegion(this.region); HRegion.closeHRegion(this.region);
@ -3899,7 +3899,7 @@ public class TestHRegion extends HBaseTestCase {
get.addColumn(family, qf); get.addColumn(family, qf);
} }
Result result = newReg.get(get); Result result = newReg.get(get);
Cell [] raw = result.raw(); Cell [] raw = result.rawCells();
assertEquals(families.length, result.size()); assertEquals(families.length, result.size());
for(int j=0; j<families.length; j++) { for(int j=0; j<families.length; j++) {
assertTrue(CellUtil.matchingRow(raw[j], row)); assertTrue(CellUtil.matchingRow(raw[j], row));
@ -3913,7 +3913,7 @@ public class TestHRegion extends HBaseTestCase {
throws IOException { throws IOException {
// Now I have k, get values out and assert they are as expected. // Now I have k, get values out and assert they are as expected.
Get get = new Get(k).addFamily(family).setMaxVersions(); Get get = new Get(k).addFamily(family).setMaxVersions();
Cell [] results = r.get(get).raw(); Cell [] results = r.get(get).rawCells();
for (int j = 0; j < results.length; j++) { for (int j = 0; j < results.length; j++) {
byte [] tmp = CellUtil.getValueArray(results[j]); byte [] tmp = CellUtil.getValueArray(results[j]);
// Row should be equal to value every time. // Row should be equal to value every time.

View File

@ -140,7 +140,7 @@ public class TestParallelPut extends HBaseTestCase {
Result result = region.get(get); Result result = region.get(get);
assertEquals(1, result.size()); assertEquals(1, result.size());
Cell kv = result.raw()[0]; Cell kv = result.rawCells()[0];
byte[] r = CellUtil.getValueArray(kv); byte[] r = CellUtil.getValueArray(kv);
assertTrue(Bytes.compareTo(r, value) == 0); assertTrue(Bytes.compareTo(r, value) == 0);
} }

View File

@ -91,7 +91,7 @@ public class TestResettingCounters {
// increment all qualifiers, should have value=6 for all // increment all qualifiers, should have value=6 for all
Result result = region.increment(all); Result result = region.increment(all);
assertEquals(numQualifiers, result.size()); assertEquals(numQualifiers, result.size());
Cell [] kvs = result.raw(); Cell [] kvs = result.rawCells();
for (int i=0;i<kvs.length;i++) { for (int i=0;i<kvs.length;i++) {
System.out.println(kvs[i].toString()); System.out.println(kvs[i].toString());
assertTrue(CellUtil.matchingQualifier(kvs[i], qualifiers[i])); assertTrue(CellUtil.matchingQualifier(kvs[i], qualifiers[i]));

View File

@ -140,9 +140,9 @@ public class TestReplicationSmallTests extends TestReplicationBase {
LOG.info("Rows not available"); LOG.info("Rows not available");
Thread.sleep(SLEEP_TIME); Thread.sleep(SLEEP_TIME);
} else { } else {
assertArrayEquals(CellUtil.getValueArray(res.raw()[0]), v3); assertArrayEquals(CellUtil.getValueArray(res.rawCells()[0]), v3);
assertArrayEquals(CellUtil.getValueArray(res.raw()[1]), v2); assertArrayEquals(CellUtil.getValueArray(res.rawCells()[1]), v2);
assertArrayEquals(CellUtil.getValueArray(res.raw()[2]), v1); assertArrayEquals(CellUtil.getValueArray(res.rawCells()[2]), v1);
break; break;
} }
} }
@ -162,8 +162,8 @@ public class TestReplicationSmallTests extends TestReplicationBase {
LOG.info("Version not deleted"); LOG.info("Version not deleted");
Thread.sleep(SLEEP_TIME); Thread.sleep(SLEEP_TIME);
} else { } else {
assertArrayEquals(CellUtil.getValueArray(res.raw()[0]), v3); assertArrayEquals(CellUtil.getValueArray(res.rawCells()[0]), v3);
assertArrayEquals(CellUtil.getValueArray(res.raw()[1]), v2); assertArrayEquals(CellUtil.getValueArray(res.rawCells()[1]), v2);
break; break;
} }
} }
@ -462,7 +462,7 @@ public class TestReplicationSmallTests extends TestReplicationBase {
Put put = null; Put put = null;
for (Result result : rs) { for (Result result : rs) {
put = new Put(result.getRow()); put = new Put(result.getRow());
Cell firstVal = result.raw()[0]; Cell firstVal = result.rawCells()[0];
put.add(CellUtil.getFamilyArray(firstVal), put.add(CellUtil.getFamilyArray(firstVal),
CellUtil.getQualifierArray(firstVal), Bytes.toBytes("diff data")); CellUtil.getQualifierArray(firstVal), Bytes.toBytes("diff data"));
htable2.put(put); htable2.put(put);

View File

@ -209,7 +209,7 @@ public class TestRemoteTable {
get.setMaxVersions(2); get.setMaxVersions(2);
result = remoteTable.get(get); result = remoteTable.get(get);
int count = 0; int count = 0;
for (Cell kv: result.list()) { for (Cell kv: result.listCells()) {
if (CellUtil.matchingFamily(kv, COLUMN_1) && TS_1 == kv.getTimestamp()) { if (CellUtil.matchingFamily(kv, COLUMN_1) && TS_1 == kv.getTimestamp()) {
assertTrue(CellUtil.matchingValue(kv, VALUE_1)); // @TS_1 assertTrue(CellUtil.matchingValue(kv, VALUE_1)); // @TS_1
count++; count++;

View File

@ -243,7 +243,7 @@ public class TestMergeTool extends HBaseTestCase {
get.addFamily(FAMILY); get.addFamily(FAMILY);
Result result = merged.get(get); Result result = merged.get(get);
assertEquals(1, result.size()); assertEquals(1, result.size());
byte [] bytes = CellUtil.getValueArray(result.raw()[0]); byte [] bytes = CellUtil.getValueArray(result.rawCells()[0]);
assertNotNull(Bytes.toStringBinary(rows[i][j]), bytes); assertNotNull(Bytes.toStringBinary(rows[i][j]), bytes);
assertTrue(Bytes.equals(bytes, rows[i][j])); assertTrue(Bytes.equals(bytes, rows[i][j]));
} }
@ -262,7 +262,7 @@ public class TestMergeTool extends HBaseTestCase {
Get get = new Get(rows[i][j]); Get get = new Get(rows[i][j]);
get.addFamily(FAMILY); get.addFamily(FAMILY);
Result result = regions[i].get(get); Result result = regions[i].get(get);
byte [] bytes = CellUtil.getValueArray(result.raw()[0]); byte [] bytes = CellUtil.getValueArray(result.rawCells()[0]);
assertNotNull(bytes); assertNotNull(bytes);
assertTrue(Bytes.equals(bytes, rows[i][j])); assertTrue(Bytes.equals(bytes, rows[i][j]));
} }