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


Java RegionServerCoprocessorEnvironment类代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment的典型用法代码示例。如果您正苦于以下问题:Java RegionServerCoprocessorEnvironment类的具体用法?Java RegionServerCoprocessorEnvironment怎么用?Java RegionServerCoprocessorEnvironment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RegionServerCoprocessorEnvironment类属于org.apache.hadoop.hbase.coprocessor包,在下文中一共展示了RegionServerCoprocessorEnvironment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment; //导入依赖的package包/类
@Override
public void start(CoprocessorEnvironment env) throws IOException {
  this.conf = env.getConfiguration();

  authorizationEnabled = isAuthorizationSupported(conf);
  if (!authorizationEnabled) {
    LOG.warn("The VisibilityController has been loaded with authorization checks disabled.");
  }

  if (HFile.getFormatVersion(conf) < HFile.MIN_FORMAT_VERSION_WITH_TAGS) {
    throw new RuntimeException("A minimum HFile version of " + HFile.MIN_FORMAT_VERSION_WITH_TAGS
      + " is required to persist visibility labels. Consider setting " + HFile.FORMAT_VERSION_KEY
      + " accordingly.");
  }

  if (env instanceof RegionServerCoprocessorEnvironment) {
    throw new RuntimeException("Visibility controller should not be configured as "
        + "'hbase.coprocessor.regionserver.classes'.");
  }
  // Do not create for master CPs
  if (!(env instanceof MasterCoprocessorEnvironment)) {
    visibilityLabelService = VisibilityLabelServiceManager.getInstance()
        .getVisibilityLabelService(this.conf);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:26,代码来源:VisibilityController.java

示例2: start

import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment; //导入依赖的package包/类
@Override
public void start(CoprocessorEnvironment env) throws IOException {
  this.conf = env.getConfiguration();
  if (HFile.getFormatVersion(conf) < HFile.MIN_FORMAT_VERSION_WITH_TAGS) {
    throw new RuntimeException("A minimum HFile version of " + HFile.MIN_FORMAT_VERSION_WITH_TAGS
      + " is required to persist visibility labels. Consider setting " + HFile.FORMAT_VERSION_KEY
      + " accordingly.");
  }

  if (env instanceof RegionServerCoprocessorEnvironment) {
    throw new RuntimeException("Visibility controller should not be configured as "
        + "'hbase.coprocessor.regionserver.classes'.");
  }
  // Do not create for master CPs
  if (!(env instanceof MasterCoprocessorEnvironment)) {
    visibilityLabelService = VisibilityLabelServiceManager.getInstance()
        .getVisibilityLabelService(this.conf);
  }
  Pair<List<String>, List<String>> superUsersAndGroups =
      VisibilityUtils.getSystemAndSuperUsers(this.conf);
  this.superUsers = superUsersAndGroups.getFirst();
  this.superGroups = superUsersAndGroups.getSecond();
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:24,代码来源:VisibilityController.java

示例3: preStop

import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment; //导入依赖的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

示例4: preMerge

import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment; //导入依赖的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

示例5: postMerge

import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment; //导入依赖的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

示例6: preMergeCommit

import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment; //导入依赖的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

示例7: postMergeCommit

import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment; //导入依赖的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

示例8: preRollBackMerge

import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment; //导入依赖的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

示例9: postRollBackMerge

import org.apache.hadoop.hbase.coprocessor.RegionServerCoprocessorEnvironment; //导入依赖的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

示例10: preStop

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