/** * Load the version info and print it * @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(getHadoopVersionString()); }
@Override public int actionVersion() { SliderVersionInfo.loadAndPrintVersionInfo(log); return EXIT_SUCCESS; }
/** * Add the cluster build information; this will include Hadoop details too * @param info cluster info * @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()); }
/** * Add the cluster build information; this will include Hadoop details too * @param dest map to insert this too * @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()); } }
/** * Load the version info and print it * @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(getHadoopVersionString()); }
@Override public int actionVersion() { SliderVersionInfo.loadAndPrintVersionInfo(log); return EXIT_SUCCESS; }
/** * Add the cluster build information; this will include Hadoop details too * @param info cluster info * @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()); }
/** * this is called by service launcher; when it returns the application finishes * @return the exit code to return by the app * @throws Throwable */ @Override public int runService() throws Throwable { SliderVersionInfo.loadAndPrintVersionInfo(log); //dump the system properties if in debug mode if (log.isDebugEnabled()) { log.debug("System properties:\n" + SliderUtils.propertiesToString(System.getProperties())); } //choose the action String action = serviceArgs.getAction(); List<String> actionArgs = serviceArgs.getActionArgs(); int exitCode; switch (action) { case SliderActions.ACTION_HELP: log.info("{}: {}", getName(), serviceArgs.usage()); exitCode = SliderExitCodes.EXIT_USAGE; break; case SliderActions.ACTION_CREATE: exitCode = createAndRunCluster(actionArgs.get(0)); break; default: throw new SliderException("Unimplemented: " + action); } log.info("Exiting AM; final exit code = {}", exitCode); return exitCode; }
/** * Add the cluster build information; this will include Hadoop details too * @param dest map to insert this too * @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()); } }
/** * this is called by service launcher; when it returns the application finishes * @return the exit code to return by the app * @throws Throwable */ @Override public int runService() throws Throwable { SliderVersionInfo.loadAndPrintVersionInfo(log); //dump the system properties if in debug mode if (log.isDebugEnabled()) { log.debug("System properties:\n" + SliderUtils.propertiesToString(System.getProperties())); } //choose the action String action = serviceArgs.getAction(); List<String> actionArgs = serviceArgs.getActionArgs(); int exitCode; switch (action) { case SliderActions.ACTION_HELP: log.info("{}: {}", getName(), serviceArgs.usage()); exitCode = SliderExitCodes.EXIT_USAGE; break; case SliderActions.ACTION_CREATE: exitCode = createAndRunCluster(actionArgs.get(0)); break; default: throw new SliderException("Unimplemented: " + action); } log.info("Exiting AM; final exit code = {}", exitCode); return exitCode; }
/** * Retrieve the version of the current Slider install * * @return the version string of the Slider release */ public static String getSliderVersion() { if (isHdp()) { return getHdpVersion(); } else { Properties props = SliderVersionInfo.loadVersionProperties(); return props.getProperty(SliderVersionInfo.APP_VERSION); } }
try { String currentCommandPath = getCurrentCommandPath(); SliderVersionInfo.loadAndPrintVersionInfo(log); String clientConfigPath = getClientConfigPath(); String jdkInfo = getJDKInfo();
/** * Retrieve the version of the current Slider install * * @return the version string of the Slider release */ public static String getSliderVersion() { if (isHdp()) { return getHdpVersion(); } else { Properties props = SliderVersionInfo.loadVersionProperties(); return props.getProperty(SliderVersionInfo.APP_VERSION); } }
try { String currentCommandPath = getCurrentCommandPath(); SliderVersionInfo.loadAndPrintVersionInfo(log); String clientConfigPath = getClientConfigPath(); String jdkInfo = getJDKInfo();