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

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

Introduction

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

Prototype

public static String getSrcChecksum() 

Source Link

Document

Get the checksum of the source files from which Hadoop was built.

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  . ja  va 2  s  .co m*/
 * @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 w  w . jav  a 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  ww .  j av  a 2s  .  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 w w . j a  v  a2s. 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 a  va 2  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());
}