sunhelly commented on a change in pull request #3436:
URL: https://github.com/apache/hbase/pull/3436#discussion_r663794570
##########
File path:
hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBuffAllocator.java
##########
@@ -70,6 +71,8 @@
public static final String MIN_ALLOCATE_SIZE_KEY =
"hbase.server.allocator.minimal.allocate.size";
+ public static final String BYTEBUFF_ALLOCATOR_CLASS =
"hbase.bytebuff.allocator.class";
Review comment:
Thanks, I'll change it.
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/coprocessor/MultiRowMutationEndpoint.java
##########
@@ -221,22 +223,25 @@ private boolean matches(Region region,
ClientProtos.Condition condition) throws
get.setTimeRange(timeRange.getMin(), timeRange.getMax());
}
- List<Cell> result = region.get(get, false);
boolean matches = false;
- if (filter != null) {
- if (!result.isEmpty()) {
- matches = true;
- }
- } else {
- boolean valueIsNull = comparator.getValue() == null ||
comparator.getValue().length == 0;
- if (result.isEmpty() && valueIsNull) {
- matches = true;
- } else if (result.size() > 0 && result.get(0).getValueLength() == 0 &&
valueIsNull) {
- matches = true;
- } else if (result.size() == 1 && !valueIsNull) {
- Cell kv = result.get(0);
- int compareResult = PrivateCellUtil.compareValue(kv, comparator);
- matches = matches(op, compareResult);
+ try (RegionScanner scanner = region.getScanner(new Scan(get))) {
+ List<Cell> result = new ArrayList<>();
Review comment:
Thanks @saintstack @Apache9 , I'll change the HRegion.get() to make a
heap copy of the results use it in the CPs, while in the checkAndMutate method,
I'll add comments for the background and why not using a get().
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
##########
@@ -3244,18 +3244,21 @@ private void prepareDeleteTimestamps(Mutation mutation,
Map<byte[], List<Cell>>
private void updateDeleteLatestVersionTimestamp(Cell cell, Get get, int
count, byte[] byteNow)
throws IOException {
- List<Cell> result = get(get, false);
+ try (RegionScanner scanner = getScanner(new Scan(get))) {
+ List<Cell> result = new ArrayList<>();
Review comment:
Yes, I'll add comments, thanks.
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
##########
@@ -4044,60 +4047,58 @@ private static Get toGet(final Mutation mutation)
throws IOException {
get.setTimeRange(tr.getMin(), tr.getMax());
}
- List<Cell> currentValues = region.get(get, false);
-
- // Iterate the input columns and update existing values if they were
found, otherwise
- // add new column initialized to the delta amount
- int currentValuesIndex = 0;
- for (int i = 0; i < deltas.size(); i++) {
- Cell delta = deltas.get(i);
- Cell currentValue = null;
- if (currentValuesIndex < currentValues.size() &&
- CellUtil.matchingQualifier(currentValues.get(currentValuesIndex),
delta)) {
- currentValue = currentValues.get(currentValuesIndex);
- if (i < (deltas.size() - 1) && !CellUtil.matchingQualifier(delta,
deltas.get(i + 1))) {
- currentValuesIndex++;
+ List<Cell> currentValues = new ArrayList<>();
Review comment:
Thanks, I'll change it.
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java
##########
@@ -476,6 +476,7 @@ boolean checkAndRowMutate(byte [] row, Filter filter,
TimeRange timeRange,
/**
* Do a get based on the get parameter.
+ * Only used for test purpose.
Review comment:
I'll delete this change, and make HRegion.get() be used in CP.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]