HBASE-3978 Rowlock lease renew doesn't work when custom coprocessor indicates to bypass default action
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1134940 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d1c070f707
commit
006b4b189c
|
@ -120,6 +120,8 @@ Release 0.91.0 - Unreleased
|
||||||
HBASE-3979 Trivial fixes in code, document (Ming Ma)
|
HBASE-3979 Trivial fixes in code, document (Ming Ma)
|
||||||
HBASE-3794 Ability to Discard Bad HTable Puts
|
HBASE-3794 Ability to Discard Bad HTable Puts
|
||||||
HBASE-3923 HBASE-1502 Broke Shell's status 'simple' and 'detailed'
|
HBASE-3923 HBASE-1502 Broke Shell's status 'simple' and 'detailed'
|
||||||
|
HBASE-3978 Rowlock lease renew doesn't work when custom coprocessor
|
||||||
|
indicates to bypass default action (Ming Ma)
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)
|
HBASE-3290 Max Compaction Size (Nicolas Spiegelberg via Stack)
|
||||||
|
|
|
@ -1616,13 +1616,14 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
|
||||||
requestCount.incrementAndGet();
|
requestCount.incrementAndGet();
|
||||||
try {
|
try {
|
||||||
HRegion region = getRegion(regionName);
|
HRegion region = getRegion(regionName);
|
||||||
|
Integer lock = getLockFromId(get.getLockId());
|
||||||
if (region.getCoprocessorHost() != null) {
|
if (region.getCoprocessorHost() != null) {
|
||||||
Boolean result = region.getCoprocessorHost().preExists(get);
|
Boolean result = region.getCoprocessorHost().preExists(get);
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
return result.booleanValue();
|
return result.booleanValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Result r = region.get(get, getLockFromId(get.getLockId()));
|
Result r = region.get(get, lock);
|
||||||
boolean result = r != null && !r.isEmpty();
|
boolean result = r != null && !r.isEmpty();
|
||||||
if (region.getCoprocessorHost() != null) {
|
if (region.getCoprocessorHost() != null) {
|
||||||
result = region.getCoprocessorHost().postExists(get, result);
|
result = region.getCoprocessorHost().postExists(get, result);
|
||||||
|
@ -1723,6 +1724,7 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
|
||||||
+ "regionName is null");
|
+ "regionName is null");
|
||||||
}
|
}
|
||||||
HRegion region = getRegion(regionName);
|
HRegion region = getRegion(regionName);
|
||||||
|
Integer lock = getLockFromId(put.getLockId());
|
||||||
WritableByteArrayComparable comparator = new BinaryComparator(value);
|
WritableByteArrayComparable comparator = new BinaryComparator(value);
|
||||||
if (region.getCoprocessorHost() != null) {
|
if (region.getCoprocessorHost() != null) {
|
||||||
Boolean result = region.getCoprocessorHost()
|
Boolean result = region.getCoprocessorHost()
|
||||||
|
@ -1734,7 +1736,7 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
|
||||||
}
|
}
|
||||||
boolean result = checkAndMutate(regionName, row, family, qualifier,
|
boolean result = checkAndMutate(regionName, row, family, qualifier,
|
||||||
CompareOp.EQUAL, new BinaryComparator(value), put,
|
CompareOp.EQUAL, new BinaryComparator(value), put,
|
||||||
getLockFromId(put.getLockId()));
|
lock);
|
||||||
if (region.getCoprocessorHost() != null) {
|
if (region.getCoprocessorHost() != null) {
|
||||||
result = region.getCoprocessorHost().postCheckAndPut(row, family,
|
result = region.getCoprocessorHost().postCheckAndPut(row, family,
|
||||||
qualifier, CompareOp.EQUAL, comparator, put, result);
|
qualifier, CompareOp.EQUAL, comparator, put, result);
|
||||||
|
@ -1764,6 +1766,7 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
|
||||||
+ "regionName is null");
|
+ "regionName is null");
|
||||||
}
|
}
|
||||||
HRegion region = getRegion(regionName);
|
HRegion region = getRegion(regionName);
|
||||||
|
Integer lock = getLockFromId(put.getLockId());
|
||||||
if (region.getCoprocessorHost() != null) {
|
if (region.getCoprocessorHost() != null) {
|
||||||
Boolean result = region.getCoprocessorHost()
|
Boolean result = region.getCoprocessorHost()
|
||||||
.preCheckAndPut(row, family, qualifier, compareOp, comparator, put);
|
.preCheckAndPut(row, family, qualifier, compareOp, comparator, put);
|
||||||
|
@ -1772,7 +1775,7 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
boolean result = checkAndMutate(regionName, row, family, qualifier,
|
boolean result = checkAndMutate(regionName, row, family, qualifier,
|
||||||
compareOp, comparator, put, getLockFromId(put.getLockId()));
|
compareOp, comparator, put, lock);
|
||||||
if (region.getCoprocessorHost() != null) {
|
if (region.getCoprocessorHost() != null) {
|
||||||
result = region.getCoprocessorHost().postCheckAndPut(row, family,
|
result = region.getCoprocessorHost().postCheckAndPut(row, family,
|
||||||
qualifier, compareOp, comparator, put, result);
|
qualifier, compareOp, comparator, put, result);
|
||||||
|
@ -1802,6 +1805,7 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
|
||||||
+ "regionName is null");
|
+ "regionName is null");
|
||||||
}
|
}
|
||||||
HRegion region = getRegion(regionName);
|
HRegion region = getRegion(regionName);
|
||||||
|
Integer lock = getLockFromId(delete.getLockId());
|
||||||
WritableByteArrayComparable comparator = new BinaryComparator(value);
|
WritableByteArrayComparable comparator = new BinaryComparator(value);
|
||||||
if (region.getCoprocessorHost() != null) {
|
if (region.getCoprocessorHost() != null) {
|
||||||
Boolean result = region.getCoprocessorHost().preCheckAndDelete(row,
|
Boolean result = region.getCoprocessorHost().preCheckAndDelete(row,
|
||||||
|
@ -1811,7 +1815,7 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
boolean result = checkAndMutate(regionName, row, family, qualifier,
|
boolean result = checkAndMutate(regionName, row, family, qualifier,
|
||||||
CompareOp.EQUAL, comparator, delete, getLockFromId(delete.getLockId()));
|
CompareOp.EQUAL, comparator, delete, lock);
|
||||||
if (region.getCoprocessorHost() != null) {
|
if (region.getCoprocessorHost() != null) {
|
||||||
result = region.getCoprocessorHost().postCheckAndDelete(row, family,
|
result = region.getCoprocessorHost().postCheckAndDelete(row, family,
|
||||||
qualifier, CompareOp.EQUAL, comparator, delete, result);
|
qualifier, CompareOp.EQUAL, comparator, delete, result);
|
||||||
|
@ -1842,6 +1846,7 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
|
||||||
+ "regionName is null");
|
+ "regionName is null");
|
||||||
}
|
}
|
||||||
HRegion region = getRegion(regionName);
|
HRegion region = getRegion(regionName);
|
||||||
|
Integer lock = getLockFromId(delete.getLockId());
|
||||||
if (region.getCoprocessorHost() != null) {
|
if (region.getCoprocessorHost() != null) {
|
||||||
Boolean result = region.getCoprocessorHost().preCheckAndDelete(row,
|
Boolean result = region.getCoprocessorHost().preCheckAndDelete(row,
|
||||||
family, qualifier, compareOp, comparator, delete);
|
family, qualifier, compareOp, comparator, delete);
|
||||||
|
@ -1850,7 +1855,7 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
boolean result = checkAndMutate(regionName, row, family, qualifier,
|
boolean result = checkAndMutate(regionName, row, family, qualifier,
|
||||||
compareOp, comparator, delete, getLockFromId(delete.getLockId()));
|
compareOp, comparator, delete, lock);
|
||||||
if (region.getCoprocessorHost() != null) {
|
if (region.getCoprocessorHost() != null) {
|
||||||
result = region.getCoprocessorHost().postCheckAndDelete(row, family,
|
result = region.getCoprocessorHost().postCheckAndDelete(row, family,
|
||||||
qualifier, compareOp, comparator, delete, result);
|
qualifier, compareOp, comparator, delete, result);
|
||||||
|
@ -2618,6 +2623,7 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
|
||||||
requestCount.incrementAndGet();
|
requestCount.incrementAndGet();
|
||||||
try {
|
try {
|
||||||
HRegion region = getRegion(regionName);
|
HRegion region = getRegion(regionName);
|
||||||
|
Integer lock = getLockFromId(increment.getLockId());
|
||||||
Increment incVal = increment;
|
Increment incVal = increment;
|
||||||
Result resVal;
|
Result resVal;
|
||||||
if (region.getCoprocessorHost() != null) {
|
if (region.getCoprocessorHost() != null) {
|
||||||
|
@ -2626,7 +2632,7 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
|
||||||
return resVal;
|
return resVal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resVal = region.increment(incVal, getLockFromId(increment.getLockId()),
|
resVal = region.increment(incVal, lock,
|
||||||
increment.getWriteToWAL());
|
increment.getWriteToWAL());
|
||||||
if (region.getCoprocessorHost() != null) {
|
if (region.getCoprocessorHost() != null) {
|
||||||
region.getCoprocessorHost().postIncrement(incVal, resVal);
|
region.getCoprocessorHost().postIncrement(incVal, resVal);
|
||||||
|
|
Loading…
Reference in New Issue