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

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

Introduction

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

Prototype

public static String getRevision() 

Source Link

Document

Get the Git commit hash of the repository when compiled.

Usage

From source file:fr.ens.biologie.genomique.eoulsan.MainHadoop.java

License:LGPL

/**
 * Log some Hadoop information./*  w  w w  .jav  a 2  s . co m*/
 */
private static void HadoopInfo() {

    getLogger().info("SYSINFO Hadoop version: " + VersionInfo.getVersion());
    getLogger().info("SYSINFO Hadoop revision: " + VersionInfo.getRevision());
    getLogger().info("SYSINFO Hadoop date: " + VersionInfo.getDate());
    getLogger().info("SYSINFO Hadoop user: " + VersionInfo.getUser());
    getLogger().info("SYSINFO Hadoop url: " + VersionInfo.getUrl());
}

From source file:fr.ens.biologie.genomique.eoulsan.util.hadoop.HadoopInfo.java

License:LGPL

private static void logHadoopVersionInfo() {

    getLogger().info("SYSINFO Hadoop version: " + VersionInfo.getVersion());
    getLogger().info("SYSINFO Hadoop revision: " + VersionInfo.getRevision());
    getLogger().info("SYSINFO Hadoop date: " + VersionInfo.getDate());
    getLogger().info("SYSINFO Hadoop user: " + VersionInfo.getUser());
    getLogger().info("SYSINFO Hadoop url: " + VersionInfo.getUrl());
}

From source file:org.apache.falcon.resource.admin.AdminResource.java

License:Apache License

/**
 * Get version of the falcon server./*from  w ww .j a v a  2s .  c o  m*/
 * @return Version of the server.
 */
@GET
@Path("version")
@Produces({ MediaType.TEXT_XML, MediaType.APPLICATION_JSON })
public PropertyList getVersion() {
    if (version == null) {
        List<Property> props = new ArrayList<Property>();

        Property property = new Property();
        property.key = "Version";
        property.value = BuildProperties.get().getProperty("build.version");
        props.add(property);

        property = new Property();
        property.key = "Mode";
        property.value = DeploymentProperties.get().getProperty("deploy.mode");
        props.add(property);

        property = new Property();
        property.key = "Hadoop";
        property.value = VersionInfo.getVersion() + "-r" + VersionInfo.getRevision();
        props.add(property);

        property = new Property();
        property.key = "authentication";
        property.value = StartupProperties.get().getProperty("falcon.authentication.type", "simple");
        props.add(property);

        property = new Property();
        property.key = SAFEMODE;
        property.value = StartupProperties.get().getProperty(StartupProperties.SAFEMODE_PROPERTY, "false");
        props.add(property);

        version = new PropertyList();
        version.properties = props;
    }

    return version;
}

From source file:org.apache.slider.core.main.ServiceLauncher.java

License:Apache License

/**
 * Build a log message for starting up and shutting down. 
 * This was grabbed from the ToolRunner code.
 * @param classname the class of the server
 * @param args arguments//w  w w  .ja  va  2  s . c  o  m
 */
public static String startupShutdownMessage(String classname, List<String> args) {
    final String hostname = NetUtils.getHostname();

    return toStartupShutdownString("STARTUP_MSG: ",
            new String[] { "Starting " + classname, "  host = " + hostname, "  args = " + args,
                    "  version = " + VersionInfo.getVersion(),
                    "  classpath = " + System.getProperty("java.class.path"),
                    "  build = " + VersionInfo.getUrl() + " -r " + VersionInfo.getRevision() + "; compiled by '"
                            + VersionInfo.getUser() + "' on " + VersionInfo.getDate(),
                    "  java = " + System.getProperty("java.version") });
}

From source file:org.openflamingo.remote.thrift.thriftfs.ThriftHandlerBase.java

License:Apache License

/**
 * Return the version info of this server
 *///  www. ja  v a 2 s  .  co  m
public org.openflamingo.remote.thrift.thriftfs.api.VersionInfo getVersionInfo(RequestContext ctx) {
    org.openflamingo.remote.thrift.thriftfs.api.VersionInfo vi = new org.openflamingo.remote.thrift.thriftfs.api.VersionInfo();
    vi.version = VersionInfo.getVersion();
    vi.revision = VersionInfo.getRevision();
    vi.compileDate = VersionInfo.getDate();
    vi.compilingUser = VersionInfo.getUser();
    vi.url = VersionInfo.getUrl();
    vi.buildVersion = VersionInfo.getBuildVersion();
    return vi;
}

From source file:org.springframework.data.hadoop.impala.common.ConfigurationCommands.java

License:Apache License

@CliCommand(value = { PREFIX + "info" }, help = "Returns basic info about the Hadoop configuration")
public String info() {
    StringBuilder sb = new StringBuilder();
    sb.append("Hadoop [");
    sb.append(VersionInfo.getVersion());
    sb.append(" rev.");
    sb.append(VersionInfo.getRevision());
    sb.append("]");

    sb.append("[fs=");
    String fs = hadoopConfiguration.get("fs.default.name");
    if (fs != null && fs.length() > 0) {
        sb.append(fs);//from w  w w.  ja  va  2s .c o  m
    }
    sb.append("]");

    sb.append("[jt=");
    String jt = hadoopConfiguration.get("mapred.job.tracker");
    if (jt != null && jt.length() > 0) {
        sb.append(jt);
    }
    sb.append("]");

    // TODO: potentially add a check to see whether HDFS is running
    return sb.toString();
}

From source file:org.springframework.xd.shell.hadoop.ConfigurationCommands.java

License:Apache License

@CliCommand(value = { PREFIX + "info" }, help = "Returns basic info about the Hadoop configuration")
public String info() {
    StringBuilder sb = new StringBuilder();
    sb.append("Hadoop [");
    sb.append(VersionInfo.getVersion());
    sb.append(" rev.");
    sb.append(VersionInfo.getRevision());
    sb.append("]");

    sb.append("[fs=");
    String fs = hadoopConfiguration.get("fs.defaultFS");
    if (fs != null && fs.length() > 0) {
        sb.append(fs);//ww  w  .  java  2  s  .co m
    }
    sb.append("]");

    // TODO: potentially add a check to see whether HDFS is running
    return sb.toString();
}