HBASE-669 MultiRegion transactions with Optimistic Concurrency Control; Fix silly copy in get
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@666356 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c23580b101
commit
c3bb630ef2
|
@ -481,18 +481,16 @@ public class HTable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the specified number of versions of the specified row and column
|
* Get the specified number of versions of the specified row and column
|
||||||
*
|
* @param row row key
|
||||||
* @param row - row key
|
* @param column column name
|
||||||
* @param column - column name
|
* @param numVersions number of versions to retrieve
|
||||||
* @param numVersions - number of versions to retrieve
|
* @return Array of Cells.
|
||||||
* @return - array byte values
|
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public Cell[] get(final byte [] row, final byte [] column,
|
public Cell[] get(final byte [] row, final byte [] column,
|
||||||
final int numVersions)
|
final int numVersions)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
Cell[] values = null;
|
return connection.getRegionServerWithRetries(
|
||||||
values = connection.getRegionServerWithRetries(
|
|
||||||
new ServerCallable<Cell[]>(connection, tableName, row) {
|
new ServerCallable<Cell[]>(connection, tableName, row) {
|
||||||
public Cell[] call() throws IOException {
|
public Cell[] call() throws IOException {
|
||||||
return server.get(location.getRegionInfo().getRegionName(), row,
|
return server.get(location.getRegionInfo().getRegionName(), row,
|
||||||
|
@ -500,15 +498,6 @@ public class HTable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (values != null) {
|
|
||||||
ArrayList<Cell> cellValues = new ArrayList<Cell>();
|
|
||||||
for (int i = 0 ; i < values.length; i++) {
|
|
||||||
cellValues.add(values[i]);
|
|
||||||
}
|
|
||||||
return cellValues.toArray(new Cell[values.length]);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue