本文整理汇总了Java中org.apache.hadoop.hbase.coprocessor.RegionServerObserver类的典型用法代码示例。如果您正苦于以下问题:Java RegionServerObserver类的具体用法?Java RegionServerObserver怎么用?Java RegionServerObserver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RegionServerObserver类属于org.apache.hadoop.hbase.coprocessor包,在下文中一共展示了RegionServerObserver类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execOperation
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
private boolean execOperation(final CoprocessorOperation ctx) throws IOException {
if (ctx == null) return false;
boolean bypass = false;
for (RegionServerEnvironment env: coprocessors) {
if (env.getInstance() instanceof RegionServerObserver) {
ctx.prepare(env);
Thread currentThread = Thread.currentThread();
ClassLoader cl = currentThread.getContextClassLoader();
try {
currentThread.setContextClassLoader(env.getClassLoader());
ctx.call((RegionServerObserver)env.getInstance(), ctx);
} catch (Throwable e) {
handleCoprocessorThrowable(env, e);
} finally {
currentThread.setContextClassLoader(cl);
}
bypass |= ctx.shouldBypass();
if (ctx.shouldComplete()) {
break;
}
}
ctx.postEnvCall(env);
}
return bypass;
}
示例2: preStop
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public void preStop(String message) throws IOException {
ObserverContext<RegionServerCoprocessorEnvironment> ctx = null;
for (RegionServerEnvironment env : coprocessors) {
if (env.getInstance() instanceof RegionServerObserver) {
ctx = ObserverContext.createAndPrepare(env, ctx);
Thread currentThread = Thread.currentThread();
ClassLoader cl = currentThread.getContextClassLoader();
try {
currentThread.setContextClassLoader(env.getClassLoader());
((RegionServerObserver) env.getInstance()).preStopRegionServer(ctx);
} catch (Throwable e) {
handleCoprocessorThrowable(env, e);
} finally {
currentThread.setContextClassLoader(cl);
}
if (ctx.shouldComplete()) {
break;
}
}
// invoke coprocessor stop method
shutdown(env);
}
}
示例3: preMerge
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public boolean preMerge(final HRegion regionA, final HRegion regionB) throws IOException {
boolean bypass = false;
ObserverContext<RegionServerCoprocessorEnvironment> ctx = null;
for (RegionServerEnvironment env : coprocessors) {
if (env.getInstance() instanceof RegionServerObserver) {
ctx = ObserverContext.createAndPrepare(env, ctx);
Thread currentThread = Thread.currentThread();
ClassLoader cl = currentThread.getContextClassLoader();
try {
currentThread.setContextClassLoader(env.getClassLoader());
((RegionServerObserver) env.getInstance()).preMerge(ctx, regionA, regionB);
} catch (Throwable e) {
handleCoprocessorThrowable(env, e);
} finally {
currentThread.setContextClassLoader(cl);
}
bypass |= ctx.shouldBypass();
if (ctx.shouldComplete()) {
break;
}
}
}
return bypass;
}
示例4: postMerge
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public void postMerge(final HRegion regionA, final HRegion regionB, final HRegion mergedRegion)
throws IOException {
ObserverContext<RegionServerCoprocessorEnvironment> ctx = null;
for (RegionServerEnvironment env : coprocessors) {
if (env.getInstance() instanceof RegionServerObserver) {
ctx = ObserverContext.createAndPrepare(env, ctx);
Thread currentThread = Thread.currentThread();
ClassLoader cl = currentThread.getContextClassLoader();
try {
currentThread.setContextClassLoader(env.getClassLoader());
((RegionServerObserver) env.getInstance()).postMerge(ctx, regionA, regionB, mergedRegion);
} catch (Throwable e) {
handleCoprocessorThrowable(env, e);
} finally {
currentThread.setContextClassLoader(cl);
}
if (ctx.shouldComplete()) {
break;
}
}
}
}
示例5: preMergeCommit
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public boolean preMergeCommit(final HRegion regionA, final HRegion regionB,
final @MetaMutationAnnotation List<Mutation> metaEntries) throws IOException {
boolean bypass = false;
ObserverContext<RegionServerCoprocessorEnvironment> ctx = null;
for (RegionServerEnvironment env : coprocessors) {
if (env.getInstance() instanceof RegionServerObserver) {
ctx = ObserverContext.createAndPrepare(env, ctx);
Thread currentThread = Thread.currentThread();
ClassLoader cl = currentThread.getContextClassLoader();
try {
currentThread.setContextClassLoader(env.getClassLoader());
((RegionServerObserver) env.getInstance()).preMergeCommit(ctx, regionA, regionB,
metaEntries);
} catch (Throwable e) {
handleCoprocessorThrowable(env, e);
} finally {
currentThread.setContextClassLoader(cl);
}
bypass |= ctx.shouldBypass();
if (ctx.shouldComplete()) {
break;
}
}
}
return bypass;
}
示例6: postMergeCommit
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public void postMergeCommit(final HRegion regionA, final HRegion regionB,
final HRegion mergedRegion) throws IOException {
ObserverContext<RegionServerCoprocessorEnvironment> ctx = null;
for (RegionServerEnvironment env : coprocessors) {
if (env.getInstance() instanceof RegionServerObserver) {
ctx = ObserverContext.createAndPrepare(env, ctx);
Thread currentThread = Thread.currentThread();
ClassLoader cl = currentThread.getContextClassLoader();
try {
currentThread.setContextClassLoader(env.getClassLoader());
((RegionServerObserver) env.getInstance()).postMergeCommit(ctx, regionA, regionB,
mergedRegion);
} catch (Throwable e) {
handleCoprocessorThrowable(env, e);
} finally {
currentThread.setContextClassLoader(cl);
}
if (ctx.shouldComplete()) {
break;
}
}
}
}
示例7: preRollBackMerge
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public void preRollBackMerge(final HRegion regionA, final HRegion regionB) throws IOException {
ObserverContext<RegionServerCoprocessorEnvironment> ctx = null;
for (RegionServerEnvironment env : coprocessors) {
if (env.getInstance() instanceof RegionServerObserver) {
ctx = ObserverContext.createAndPrepare(env, ctx);
Thread currentThread = Thread.currentThread();
ClassLoader cl = currentThread.getContextClassLoader();
try {
currentThread.setContextClassLoader(env.getClassLoader());
((RegionServerObserver) env.getInstance()).preRollBackMerge(ctx, regionA, regionB);
} catch (Throwable e) {
handleCoprocessorThrowable(env, e);
} finally {
currentThread.setContextClassLoader(cl);
}
if (ctx.shouldComplete()) {
break;
}
}
}
}
示例8: postRollBackMerge
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public void postRollBackMerge(final HRegion regionA, final HRegion regionB) throws IOException {
ObserverContext<RegionServerCoprocessorEnvironment> ctx = null;
for (RegionServerEnvironment env : coprocessors) {
if (env.getInstance() instanceof RegionServerObserver) {
ctx = ObserverContext.createAndPrepare(env, ctx);
Thread currentThread = Thread.currentThread();
ClassLoader cl = currentThread.getContextClassLoader();
try {
currentThread.setContextClassLoader(env.getClassLoader());
((RegionServerObserver) env.getInstance()).postRollBackMerge(ctx, regionA, regionB);
} catch (Throwable e) {
handleCoprocessorThrowable(env, e);
} finally {
currentThread.setContextClassLoader(cl);
}
if (ctx.shouldComplete()) {
break;
}
}
}
}
示例9: preStop
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public void preStop(String message, User user) throws IOException {
// While stopping the region server all coprocessors method should be executed first then the
// coprocessor should be cleaned up.
if (coprocEnvironments.isEmpty()) {
return;
}
execShutdown(new RegionServerObserverOperation(user) {
@Override
public void call(RegionServerObserver observer) throws IOException {
observer.preStopRegionServer(this);
}
@Override
public void postEnvCall() {
// invoke coprocessor stop method
shutdown(this.getEnvironment());
}
});
}
示例10: preStop
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public void preStop(String message) throws IOException {
ObserverContext<RegionServerCoprocessorEnvironment> ctx = null;
for (RegionServerEnvironment env : coprocessors) {
if (env.getInstance() instanceof RegionServerObserver) {
ctx = ObserverContext.createAndPrepare(env, ctx);
Thread currentThread = Thread.currentThread();
ClassLoader cl = currentThread.getContextClassLoader();
try {
currentThread.setContextClassLoader(env.getClassLoader());
((RegionServerObserver) env.getInstance()).preStopRegionServer(ctx);
} catch (Throwable e) {
handleCoprocessorThrowable(env, e);
} finally {
currentThread.setContextClassLoader(cl);
}
if (ctx.shouldComplete()) {
break;
}
}
}
}
示例11: preStop
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public void preStop(String message) throws IOException {
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override
public void call(RegionServerObserver oserver,
ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException {
oserver.preStopRegionServer(ctx);
}
@Override
public void postEnvCall(RegionServerEnvironment env) {
// invoke coprocessor stop method
shutdown(env);
}
});
}
示例12: preMerge
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public boolean preMerge(final HRegion regionA, final HRegion regionB) throws IOException {
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override
public void call(RegionServerObserver oserver,
ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException {
oserver.preMerge(ctx, regionA, regionB);
}
});
}
示例13: postMerge
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public void postMerge(final HRegion regionA, final HRegion regionB, final HRegion mergedRegion)
throws IOException {
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override
public void call(RegionServerObserver oserver,
ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException {
oserver.postMerge(ctx, regionA, regionB, mergedRegion);
}
});
}
示例14: preMergeCommit
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public boolean preMergeCommit(final HRegion regionA, final HRegion regionB,
final @MetaMutationAnnotation List<Mutation> metaEntries) throws IOException {
return execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override
public void call(RegionServerObserver oserver,
ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException {
oserver.preMergeCommit(ctx, regionA, regionB, metaEntries);
}
});
}
示例15: postMergeCommit
import org.apache.hadoop.hbase.coprocessor.RegionServerObserver; //导入依赖的package包/类
public void postMergeCommit(final HRegion regionA, final HRegion regionB,
final HRegion mergedRegion) throws IOException {
execOperation(coprocessors.isEmpty() ? null : new CoprocessorOperation() {
@Override
public void call(RegionServerObserver oserver,
ObserverContext<RegionServerCoprocessorEnvironment> ctx) throws IOException {
oserver.postMergeCommit(ctx, regionA, regionB, mergedRegion);
}
});
}