Example usage for org.apache.hadoop.util VersionInfo getBranch

List of usage examples for org.apache.hadoop.util VersionInfo getBranch

Introduction

In this page you can find the example usage for org.apache.hadoop.util VersionInfo getBranch.

Prototype

public static String getBranch() 

Source Link

Document

Get the branch on which this originated.

Usage

From source file:org.apache.hoya.core.build.BuildHelper.java

License:Apache License

/**
 * Add the cluster build information; this will include Hadoop details too
 * @param dest map to insert this too//from   w w  w. j  av  a2s .  c  om
 * @param prefix prefix for the build info
 */
public static void addBuildMetadata(Map dest, String prefix) {

    Properties props = HoyaVersionInfo.loadVersionProperties();
    dest.put(prefix + "." + HoyaVersionInfo.APP_BUILD_INFO, props.getProperty(HoyaVersionInfo.APP_BUILD_INFO));
    dest.put(prefix + "." + HoyaVersionInfo.HADOOP_BUILD_INFO,
            props.getProperty(HoyaVersionInfo.HADOOP_BUILD_INFO));

    dest.put(prefix + "." + HoyaVersionInfo.HADOOP_DEPLOYED_INFO,
            VersionInfo.getBranch() + " @" + VersionInfo.getSrcChecksum());
}

From source file:org.apache.hoya.tools.HoyaUtils.java

License:Apache License

/**
 * Add the cluster build information; this will include Hadoop details too
 * @param cd cluster//from w ww . ja va 2 s.c o  m
 * @param prefix prefix for the build info
 */
public static void addBuildInfo(Map<String, String> info, String prefix) {

    Properties props = HoyaVersionInfo.loadVersionProperties();
    info.put(prefix + "." + HoyaVersionInfo.APP_BUILD_INFO, props.getProperty(HoyaVersionInfo.APP_BUILD_INFO));
    info.put(prefix + "." + HoyaVersionInfo.HADOOP_BUILD_INFO,
            props.getProperty(HoyaVersionInfo.HADOOP_BUILD_INFO));

    info.put(prefix + "." + HoyaVersionInfo.HADOOP_DEPLOYED_INFO,
            VersionInfo.getBranch() + " @" + VersionInfo.getSrcChecksum());
}

From source file:org.apache.hoya.tools.HoyaVersionInfo.java

License:Apache License

/**
 * Load the version info and print it/*from w w  w.j  av  a2 s.  c o  m*/
 * @param logger logger
 */
public static void loadAndPrintVersionInfo(Logger logger) {
    Properties props = loadVersionProperties();
    logger.info(props.getProperty(APP_BUILD_INFO));
    logger.info("Compiled against Hadoop {}", props.getProperty(HADOOP_BUILD_INFO));
    logger.info("Hadoop runtime version {} with source checksum {} and build date {}", VersionInfo.getBranch(),
            VersionInfo.getSrcChecksum(), VersionInfo.getDate());
}

From source file:org.apache.slider.common.tools.SliderUtils.java

License:Apache License

/**
 * Add the cluster build information; this will include Hadoop details too
 * @param info cluster info//from w  ww.  j av  a2  s. co m
 * @param prefix prefix for the build info
 */
public static void addBuildInfo(Map<String, String> info, String prefix) {

    Properties props = SliderVersionInfo.loadVersionProperties();
    info.put(prefix + "." + SliderVersionInfo.APP_BUILD_INFO,
            props.getProperty(SliderVersionInfo.APP_BUILD_INFO));
    info.put(prefix + "." + SliderVersionInfo.HADOOP_BUILD_INFO,
            props.getProperty(SliderVersionInfo.HADOOP_BUILD_INFO));

    info.put(prefix + "." + SliderVersionInfo.HADOOP_DEPLOYED_INFO,
            VersionInfo.getBranch() + " @" + VersionInfo.getSrcChecksum());
}

From source file:org.apache.slider.common.tools.SliderVersionInfo.java

License:Apache License

public static String getHadoopVersionString() {
    return String.format(Locale.ENGLISH, "Hadoop runtime version %s with source checksum %s and build date %s",
            VersionInfo.getBranch(), VersionInfo.getSrcChecksum(), VersionInfo.getDate());
}

From source file:org.apache.slider.core.build.BuildHelper.java

License:Apache License

/**
 * Add the cluster build information; this will include Hadoop details too
 * @param dest map to insert this too//from   w w  w. j  ava2 s  .c  om
 * @param prefix prefix for the build info
 */
public static void addBuildMetadata(Map<String, Object> dest, String prefix) {

    Properties props = SliderVersionInfo.loadVersionProperties();
    dest.put(prefix + "." + SliderVersionInfo.APP_BUILD_INFO,
            props.getProperty(SliderVersionInfo.APP_BUILD_INFO));
    dest.put(prefix + "." + SliderVersionInfo.HADOOP_BUILD_INFO,
            props.getProperty(SliderVersionInfo.HADOOP_BUILD_INFO));

    dest.put(prefix + "." + SliderVersionInfo.HADOOP_DEPLOYED_INFO,
            VersionInfo.getBranch() + " @" + VersionInfo.getSrcChecksum());
}