当前位置: 首页>>代码示例>>Java>>正文


Java RegionServerObserver类代码示例

本文整理汇总了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;
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:27,代码来源:RegionServerCoprocessorHost.java

示例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);
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:24,代码来源:RegionServerCoprocessorHost.java

示例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;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:25,代码来源:RegionServerCoprocessorHost.java

示例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;
      }
    }
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:23,代码来源:RegionServerCoprocessorHost.java

示例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;
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:27,代码来源:RegionServerCoprocessorHost.java

示例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;
      }
    }
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:24,代码来源:RegionServerCoprocessorHost.java

示例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;
      }
    }
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:22,代码来源:RegionServerCoprocessorHost.java

示例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;
      }
    }
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:22,代码来源:RegionServerCoprocessorHost.java

示例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());
    }
  });
}
 
开发者ID:apache,项目名称:hbase,代码行数:20,代码来源:RegionServerCoprocessorHost.java

示例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;
      }
    }
  }
}
 
开发者ID:shenli-uiuc,项目名称:PyroDB,代码行数:22,代码来源:RegionServerCoprocessorHost.java

示例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);
    }
  });
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:RegionServerCoprocessorHost.java

示例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);
    }
  });
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:10,代码来源:RegionServerCoprocessorHost.java

示例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);
    }
  });
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:RegionServerCoprocessorHost.java

示例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);
    }
  });
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:RegionServerCoprocessorHost.java

示例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);
    }
  });
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:RegionServerCoprocessorHost.java


注:本文中的org.apache.hadoop.hbase.coprocessor.RegionServerObserver类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。