/** * Build a log message for starting up and shutting down. * @param classname the class of the server * @param args arguments */ protected static String startupShutdownMessage(String classname, List<String> args) { final String hostname = NetUtils.getHostname(); return StringUtils.createStartupShutdownMessage(classname, hostname, args.toArray(new String[args.size()])); }
@Override public void register(String trackingUrl) throws YarnFacadeException { String thisHostName = NetUtils.getHostname(); LOG.debug("Host Name from YARN: " + thisHostName); if (trackingUrl != null) { // YARN seems to provide multiple names: MACHNAME.local/10.250.56.235 // The second seems to be the IP address, which is what we want. String names[] = thisHostName.split("/"); amHost = names[names.length - 1]; appMasterTrackingUrl = trackingUrl.replace("<host>", amHost); LOG.info("Tracking URL: " + appMasterTrackingUrl); } try { LOG.trace("Registering with YARN"); registration = resourceMgr.registerApplicationMaster(thisHostName, 0, appMasterTrackingUrl); } catch (YarnException | IOException e) { throw new YarnFacadeException("Register AM failed", e); } // Some distributions (but not the stock YARN) support Disk // resources. Since Drill compiles against Apache YARN, without disk // resources, we have to use an indirect mechnanism to look for the // disk enum at runtime when we don't have that enum value at compile time. for (SchedulerResourceTypes type : registration .getSchedulerResourceTypes()) { if (type.name().equals("DISK")) { supportsDisks = true; } } }
throw NetUtils.wrapException(address.getHostName(), address.getPort(), NetUtils.getHostname(), 0, call.error);
@Override public void init(SubsetConfiguration conf) { // Get StatsD host configurations. final String serverHost = conf.getString(SERVER_HOST_KEY); final int serverPort = Integer.parseInt(conf.getString(SERVER_PORT_KEY)); skipHostname = conf.getBoolean(SKIP_HOSTNAME_KEY, false); if (!skipHostname) { hostName = conf.getString(HOST_NAME_KEY, null); if (null == hostName) { hostName = NetUtils.getHostname(); } } serviceName = conf.getString(SERVICE_NAME_KEY, null); statsd = new StatsD(serverHost, serverPort); }
static void startupShutdownMessage(Class<?> clazz, String[] args, final LogAdapter LOG) { final String hostname = NetUtils.getHostname(); final String classname = clazz.getSimpleName(); LOG.info(createStartupShutdownMessage(classname, hostname, args)); if (SystemUtils.IS_OS_UNIX) { try { SignalLogger.INSTANCE.register(LOG); } catch (Throwable t) { LOG.warn("failed to register any UNIX signal loggers: ", t); } } ShutdownHookManager.get().addShutdownHook( new Runnable() { @Override public void run() { LOG.info(toStartupShutdownString("SHUTDOWN_MSG: ", new String[]{ "Shutting down " + classname + " at " + hostname})); } }, SHUTDOWN_HOOK_PRIORITY); }
jstormMasterContext.appMasterHostname = NetUtils.getHostname();
private boolean checkHostname(String appHostname) throws Exception { String hostname = NetUtils.getHostname(); if (hostname.equals(appHostname)) { return true; } Assert.assertTrue("Unknown format for hostname " + appHostname, appHostname.contains("/")); Assert.assertTrue("Unknown format for hostname " + hostname, hostname.contains("/")); String[] appHostnameParts = appHostname.split("/"); String[] hostnameParts = hostname.split("/"); return (compareFQDNs(appHostnameParts[0], hostnameParts[0]) && checkIPs( hostnameParts[0], hostnameParts[1], appHostnameParts[1])); }
public LlamaHAServer() { localNodeBytes = (NetUtils.getHostname() + "__" + new SecureRandom().nextLong()).getBytes(); }
yarnClient.init(new Configuration(conf)); yarnClient.start(); String hostName = NetUtils.getHostname();
appMasterHostname = NetUtils.getHostname(); RegisterApplicationMasterResponse response = amRMClient .registerApplicationMaster(appMasterHostname, appMasterRpcPort,
throw NetUtils.wrapException(address.getHostName(), address.getPort(), NetUtils.getHostname(), 0, call.error);
/** * 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 */ 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") }); }
@Override public void init(SubsetConfiguration conf) { // Get StatsD host configurations. final String serverHost = conf.getString(SERVER_HOST_KEY); final int serverPort = Integer.parseInt(conf.getString(SERVER_PORT_KEY)); skipHostname = conf.getBoolean(SKIP_HOSTNAME_KEY, false); if (!skipHostname) { hostName = conf.getString(HOST_NAME_KEY, null); if (null == hostName) { hostName = NetUtils.getHostname(); } } serviceName = conf.getString(SERVICE_NAME_KEY, null); statsd = new StatsD(serverHost, serverPort); }
final String hostname = org.apache.hadoop.net.NetUtils.getHostname(); final String classname = clazz.getSimpleName(); LOG.info(
/** * 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 */ 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") }); }
fileSplit.getLength()); String localHost = NetUtils.getHostname(); List<String> blocks = blockMap.get(localHost); int localBlocks = 0;
static void startupShutdownMessage(Class<?> clazz, String[] args, final LogAdapter LOG) { final String hostname = NetUtils.getHostname(); final String classname = clazz.getSimpleName(); LOG.info(
static void startupShutdownMessage(Class<?> clazz, String[] args, final LogAdapter LOG) { final String hostname = NetUtils.getHostname(); final String classname = clazz.getSimpleName(); LOG.info(
static void startupShutdownMessage(Class<?> clazz, String[] args, final LogAdapter LOG) { final String hostname = NetUtils.getHostname(); final String classname = clazz.getSimpleName(); LOG.info(
static void startupShutdownMessage(Class<?> clazz, String[] args, final LogAdapter LOG) { final String hostname = NetUtils.getHostname(); final String classname = clazz.getSimpleName(); LOG.info(