HBASE-7134. incrementColumnValue hooks no longer called from anywhere
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1409968 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
54093f6560
commit
3e393dd4f8
|
@ -543,7 +543,9 @@ public interface RegionObserver extends Coprocessor {
|
|||
* @param writeToWAL true if the change should be written to the WAL
|
||||
* @return value to return to the client if bypassing default processing
|
||||
* @throws IOException if an error occurred on the coprocessor
|
||||
* @deprecated This hook is no longer called by the RegionServer
|
||||
*/
|
||||
@Deprecated
|
||||
long preIncrementColumnValue(final ObserverContext<RegionCoprocessorEnvironment> c,
|
||||
final byte [] row, final byte [] family, final byte [] qualifier,
|
||||
final long amount, final boolean writeToWAL)
|
||||
|
@ -563,7 +565,9 @@ public interface RegionObserver extends Coprocessor {
|
|||
* @param result the result returned by incrementColumnValue
|
||||
* @return the result to return to the client
|
||||
* @throws IOException if an error occurred on the coprocessor
|
||||
* @deprecated This hook is no longer called by the RegionServer
|
||||
*/
|
||||
@Deprecated
|
||||
long postIncrementColumnValue(final ObserverContext<RegionCoprocessorEnvironment> c,
|
||||
final byte [] row, final byte [] family, final byte [] qualifier,
|
||||
final long amount, final boolean writeToWAL, final long result)
|
||||
|
|
|
@ -1112,70 +1112,6 @@ public class RegionCoprocessorHost
|
|||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param row row to check
|
||||
* @param family column family
|
||||
* @param qualifier column qualifier
|
||||
* @param amount long amount to increment
|
||||
* @param writeToWAL true if the change should be written to the WAL
|
||||
* @return return value for client if default operation should be bypassed,
|
||||
* or null otherwise
|
||||
* @throws IOException if an error occurred on the coprocessor
|
||||
*/
|
||||
public Long preIncrementColumnValue(final byte [] row, final byte [] family,
|
||||
final byte [] qualifier, long amount, final boolean writeToWAL)
|
||||
throws IOException {
|
||||
boolean bypass = false;
|
||||
ObserverContext<RegionCoprocessorEnvironment> ctx = null;
|
||||
for (RegionEnvironment env: coprocessors) {
|
||||
if (env.getInstance() instanceof RegionObserver) {
|
||||
ctx = ObserverContext.createAndPrepare(env, ctx);
|
||||
try {
|
||||
amount = ((RegionObserver)env.getInstance()).preIncrementColumnValue(ctx,
|
||||
row, family, qualifier, amount, writeToWAL);
|
||||
} catch (Throwable e) {
|
||||
handleCoprocessorThrowable(env, e);
|
||||
}
|
||||
bypass |= ctx.shouldBypass();
|
||||
if (ctx.shouldComplete()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return bypass ? amount : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param row row to check
|
||||
* @param family column family
|
||||
* @param qualifier column qualifier
|
||||
* @param amount long amount to increment
|
||||
* @param writeToWAL true if the change should be written to the WAL
|
||||
* @param result the result returned by incrementColumnValue
|
||||
* @return the result to return to the client
|
||||
* @throws IOException if an error occurred on the coprocessor
|
||||
*/
|
||||
public long postIncrementColumnValue(final byte [] row, final byte [] family,
|
||||
final byte [] qualifier, final long amount, final boolean writeToWAL,
|
||||
long result) throws IOException {
|
||||
ObserverContext<RegionCoprocessorEnvironment> ctx = null;
|
||||
for (RegionEnvironment env: coprocessors) {
|
||||
if (env.getInstance() instanceof RegionObserver) {
|
||||
ctx = ObserverContext.createAndPrepare(env, ctx);
|
||||
try {
|
||||
result = ((RegionObserver)env.getInstance()).postIncrementColumnValue(ctx,
|
||||
row, family, qualifier, amount, writeToWAL, result);
|
||||
} catch (Throwable e) {
|
||||
handleCoprocessorThrowable(env, e);
|
||||
}
|
||||
if (ctx.shouldComplete()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param append append object
|
||||
* @return result to return to client if default operation should be
|
||||
|
|
Loading…
Reference in New Issue