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


Java VersionInfo.getVersion方法代码示例

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


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

示例1: getVersionInfo

import org.apache.hadoop.hbase.util.VersionInfo; //导入方法依赖的package包/类
/**
 * Get a protocol buffer VersionInfo
 *
 * @return the converted protocol buffer VersionInfo
 */
public static HBaseProtos.VersionInfo getVersionInfo() {
  HBaseProtos.VersionInfo.Builder builder = HBaseProtos.VersionInfo.newBuilder();
  String version = VersionInfo.getVersion();
  builder.setVersion(version);
  String[] components = version.split("\\.");
  if (components != null && components.length > 2) {
    builder.setVersionMajor(Integer.parseInt(components[0]));
    builder.setVersionMinor(Integer.parseInt(components[1]));
  }
  builder.setUrl(VersionInfo.getUrl());
  builder.setRevision(VersionInfo.getRevision());
  builder.setUser(VersionInfo.getUser());
  builder.setDate(VersionInfo.getDate());
  builder.setSrcChecksum(VersionInfo.getSrcChecksum());
  return builder.build();
}
 
开发者ID:apache,项目名称:hbase,代码行数:22,代码来源:ProtobufUtil.java

示例2: getClusterStatus

import org.apache.hadoop.hbase.util.VersionInfo; //导入方法依赖的package包/类
/**
 * @return cluster status
 */
public ClusterStatus getClusterStatus() {
  // Build Set of backup masters from ZK nodes
  List<String> backupMasterStrings;
  try {
    backupMasterStrings = ZKUtil.listChildrenNoWatch(this.zooKeeper,
                            this.zooKeeper.backupMasterAddressesZNode);
  } catch (KeeperException e) {
    LOG.warn(this.zooKeeper.prefix("Unable to list backup servers"), e);
    backupMasterStrings = new ArrayList<String>(0);
  }
  List<ServerName> backupMasters = new ArrayList<ServerName>(
                                        backupMasterStrings.size());
  for (String s: backupMasterStrings) {
    backupMasters.add(new ServerName(s));
  }

  return new ClusterStatus(VersionInfo.getVersion(),
    this.fileSystemManager.getClusterId(),
    this.serverManager.getOnlineServers(),
    this.serverManager.getDeadServers(),
    this.serverName,
    backupMasters,
    this.assignmentManager.getRegionsInTransition(),
    this.getCoprocessors());
}
 
开发者ID:lifeng5042,项目名称:RStore,代码行数:29,代码来源:HMaster.java

示例3: chore

import org.apache.hadoop.hbase.util.VersionInfo; //导入方法依赖的package包/类
@Override
protected void chore() {
  if (!connected) {
    return;
  }

  List<ServerName> sns = generateDeadServersListToSend();
  if (sns.isEmpty()) {
    // Nothing to send. Done.
    return;
  }

  final long curTime = EnvironmentEdgeManager.currentTime();
  if (lastMessageTime > curTime - messagePeriod) {
    // We already sent something less than 10 second ago. Done.
    return;
  }

  // Ok, we're going to send something then.
  lastMessageTime = curTime;

  // We're reusing an existing protobuf message, but we don't send everything.
  // This could be extended in the future, for example if we want to send stuff like the
  //  hbase:meta server name.
  ClusterStatus cs = new ClusterStatus(VersionInfo.getVersion(),
      master.getMasterFileSystem().getClusterId().toString(),
      null,
      sns,
      master.getServerName(),
      null,
      null,
      null,
      null);


  publisher.publish(cs);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:38,代码来源:ClusterStatusPublisher.java

示例4: checkDefaultsVersion

import org.apache.hadoop.hbase.util.VersionInfo; //导入方法依赖的package包/类
private static void checkDefaultsVersion(Configuration conf) {
  if (conf.getBoolean("hbase.defaults.for.version.skip", Boolean.FALSE)) return;
  String defaultsVersion = conf.get("hbase.defaults.for.version");
  String thisVersion = VersionInfo.getVersion();
  if (!thisVersion.equals(defaultsVersion)) {
    throw new RuntimeException(
      "hbase-default.xml file seems to be for an older version of HBase (" +
      defaultsVersion + "), this version is " + thisVersion);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:11,代码来源:HBaseConfiguration.java

示例5: checkDefaultsVersion

import org.apache.hadoop.hbase.util.VersionInfo; //导入方法依赖的package包/类
private static void checkDefaultsVersion(Configuration conf) {
    if (conf.getBoolean("hbase.defaults.for.version.skip", Boolean.FALSE)) return;
    String defaultsVersion = conf.get("hbase.defaults.for.version");
    String thisVersion = VersionInfo.getVersion();
//    if (!thisVersion.equals(defaultsVersion)) {
//      throw new RuntimeException(
//        "hbase-default.xml file seems to be for and old version of HBase (" +
//        defaultsVersion + "), this version is " + thisVersion);
//    }
  }
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:11,代码来源:HBaseConfiguration.java

示例6: checkDefaultsVersion

import org.apache.hadoop.hbase.util.VersionInfo; //导入方法依赖的package包/类
private static void checkDefaultsVersion(Configuration conf) {
    if (conf.getBoolean("hbase.defaults.for.version.skip", Boolean.FALSE)) return;
    String defaultsVersion = conf.get("hbase.defaults.for.version");
    String thisVersion = VersionInfo.getVersion();
    if (!thisVersion.equals(defaultsVersion)) {
        throw new RuntimeException(
                "hbase-default.xml file seems to be for and old version of HBase (" +
                        defaultsVersion + "), this version is " + thisVersion);
    }
}
 
开发者ID:grokcoder,项目名称:pbase,代码行数:11,代码来源:HBaseConfiguration.java

示例7: chore

import org.apache.hadoop.hbase.util.VersionInfo; //导入方法依赖的package包/类
@Override
protected void chore() {
  if (!connected) {
    return;
  }

  List<ServerName> sns = generateDeadServersListToSend();
  if (sns.isEmpty()) {
    // Nothing to send. Done.
    return;
  }

  final long curTime = EnvironmentEdgeManager.currentTimeMillis();
  if (lastMessageTime > curTime - messagePeriod) {
    // We already sent something less than 10 second ago. Done.
    return;
  }

  // Ok, we're going to send something then.
  lastMessageTime = curTime;

  // We're reusing an existing protobuf message, but we don't send everything.
  // This could be extended in the future, for example if we want to send stuff like the
  //  hbase:meta server name.
  ClusterStatus cs = new ClusterStatus(VersionInfo.getVersion(),
      master.getMasterFileSystem().getClusterId().toString(),
      null,
      sns,
      master.getServerName(),
      null,
      null,
      null,
      null);


  publisher.publish(cs);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:38,代码来源:ClusterStatusPublisher.java

示例8: checkDefaultsVersion

import org.apache.hadoop.hbase.util.VersionInfo; //导入方法依赖的package包/类
private static void checkDefaultsVersion(Configuration conf) {
  if (conf.getBoolean("hbase.defaults.for.version.skip", Boolean.FALSE)) return;
  String defaultsVersion = conf.get("hbase.defaults.for.version");
  String thisVersion = VersionInfo.getVersion();
  if (!thisVersion.equals(defaultsVersion)) {
    throw new RuntimeException(
      "hbase-default.xml file seems to be for and old version of HBase (" +
      defaultsVersion + "), this version is " + thisVersion);
  }
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:11,代码来源:HBaseConfiguration.java

示例9: getHBaseVersion

import org.apache.hadoop.hbase.util.VersionInfo; //导入方法依赖的package包/类
/** @return the HBase release */
@Override
public String getHBaseVersion() {
  return VersionInfo.getVersion();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:6,代码来源:CoprocessorHost.java

示例10: getCompat

import org.apache.hadoop.hbase.util.VersionInfo; //导入方法依赖的package包/类
public synchronized static HBaseCompat getCompat(String classOverride) {

        if (null != cachedCompat) {
            log.debug("Returning cached HBase compatibility layer: {}", cachedCompat);
            return cachedCompat;
        }

        HBaseCompat compat;
        String className = null;
        String classNameSource = null;

        if (null != classOverride) {
            className = classOverride;
            classNameSource = "from explicit configuration";
        } else {
            String hbaseVersion = VersionInfo.getVersion();
            for (String supportedVersion : Arrays.asList("0.94", "0.96", "0.98", "1.0", "1.1")) {
                if (hbaseVersion.startsWith(supportedVersion + ".")) {
                    className = "com.thinkaurelius.titan.diskstorage.hbase.HBaseCompat" + supportedVersion.replaceAll("\\.", "_");
                    classNameSource = "supporting runtime HBase version " + hbaseVersion;
                    break;
                }
            }
            if (null == className) {
                log.info("The HBase version {} is not explicitly supported by Titan.  " +
                         "Loading Titan's compatibility layer for its most recent supported HBase version ({})",
                        hbaseVersion, DEFAULT_HBASE_COMPAT_VERSION);
                className = DEFAULT_HBASE_CLASS_NAME;
                classNameSource = " by default";
            }
        }

        final String errTemplate = " when instantiating HBase compatibility class " + className;

        try {
            compat = (HBaseCompat)Class.forName(className).newInstance();
            log.info("Instantiated HBase compatibility layer {}: {}", classNameSource, compat.getClass().getCanonicalName());
        } catch (IllegalAccessException | ClassNotFoundException | InstantiationException e) {
            throw new RuntimeException(e.getClass().getSimpleName() + errTemplate, e);
        }

        return cachedCompat = compat;
    }
 
开发者ID:apache,项目名称:incubator-atlas,代码行数:44,代码来源:HBaseCompatLoader.java

示例11: version

import org.apache.hadoop.hbase.util.VersionInfo; //导入方法依赖的package包/类
/**
    * get hbase version
    * 
    * @return
    */
   public static String version() {
return VersionInfo.getVersion();
   }
 
开发者ID:smartdengjie,项目名称:stats-hdfs,代码行数:9,代码来源:HBaseFactory.java


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