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


Java HFile.FORMAT_VERSION_KEY属性代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.io.hfile.HFile.FORMAT_VERSION_KEY属性的典型用法代码示例。如果您正苦于以下问题:Java HFile.FORMAT_VERSION_KEY属性的具体用法?Java HFile.FORMAT_VERSION_KEY怎么用?Java HFile.FORMAT_VERSION_KEY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.hadoop.hbase.io.hfile.HFile的用法示例。


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

示例1: start

@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,代码行数:25,代码来源:VisibilityController.java

示例2: start

@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,代码行数:23,代码来源:VisibilityController.java

示例3: start

@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.");
  }
  ZooKeeperWatcher zk = null;
  if (env instanceof MasterCoprocessorEnvironment) {
    // if running on HMaster
    MasterCoprocessorEnvironment mEnv = (MasterCoprocessorEnvironment) env;
    zk = mEnv.getMasterServices().getZooKeeper();
  } else if (env instanceof RegionCoprocessorEnvironment) {
    // if running at region
    regionEnv = (RegionCoprocessorEnvironment) env;
    zk = regionEnv.getRegionServerServices().getZooKeeper();
  } else if (env instanceof RegionServerCoprocessorEnvironment) {
    throw new RuntimeException(
        "Visibility controller should not be configured as " +
        "'hbase.coprocessor.regionserver.classes'.");
  }

  // If zk is null or IOException while obtaining auth manager,
  // throw RuntimeException so that the coprocessor is unloaded.
  if (zk == null) {
    throw new RuntimeException("Error obtaining VisibilityLabelsManager, zk found null.");
  }
  try {
    this.visibilityManager = VisibilityLabelsManager.get(zk, this.conf);
  } catch (IOException ioe) {
    throw new RuntimeException("Error obtaining VisibilityLabelsManager", ioe);
  }
  if (env instanceof RegionCoprocessorEnvironment) {
    // ScanLabelGenerator to be instantiated only with Region Observer.
    scanLabelGenerators = VisibilityUtils.getScanLabelGenerators(this.conf);
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:38,代码来源:VisibilityController.java


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