/** * @return The hostname to use in the hostname field of the encoded * LoggingEvents. */ public static String getHostname() { try { return Util.getLocalHost().getHostName(); } catch (Exception e) { return "unknown-host"; } }
/** * @return The hostname to use in the hostname field of the encoded * LoggingEvents. */ public static String getHostname() { try { return Util.getLocalHost().getHostName(); } catch (Exception e) { return "unknown-host"; } }
@Override public LocationIdProvider getLocationIdProvider(Config config) { return () -> new LocationId(Util.getLocalHost().getHostName()); } }
@Override public LocationIdProvider getLocationIdProvider(Config config) { return () -> new LocationId(Util.getLocalHost().getHostName()); } }
@Override public LocationIdProvider getLocationIdProvider(Config config) { return () -> new LocationId(Util.getLocalHost().getHostName()); } }
@Override public LocationIdProvider getLocationIdProvider(Config config) { return () -> new LocationId(Util.getLocalHost().getHostName()); } }
@Override public LocationIdProvider getLocationIdProvider(Config config) { return () -> new LocationId(Util.getLocalHost().getHostName()); } }
public CoordinatorStreamMessage(String source, Object[] keyArray, Map<String, Object> messageMap) { this(keyArray, messageMap); if (!isDelete) { this.messageMap.put("values", new HashMap<String, String>()); setSource(source); setUsername(System.getProperty("user.name")); setTimestamp(System.currentTimeMillis()); try { setHost(Util.getLocalHost().getHostAddress()); } catch (Exception e) { log.warn("Unable to retrieve host for current machine. Setting coordinator stream message host field to an empty string."); setHost(""); } } setVersion(VERSION); }
public CoordinatorStreamMessage(String source, Object[] keyArray, Map<String, Object> messageMap) { this(keyArray, messageMap); if (!isDelete) { this.messageMap.put("values", new HashMap<String, String>()); setSource(source); setUsername(System.getProperty("user.name")); setTimestamp(System.currentTimeMillis()); try { setHost(Util.getLocalHost().getHostAddress()); } catch (Exception e) { log.warn("Unable to retrieve host for current machine. Setting coordinator stream message host field to an empty string."); setHost(""); } } setVersion(VERSION); }
public CoordinatorStreamMessage(String source, Object[] keyArray, Map<String, Object> messageMap) { this(keyArray, messageMap); if (!isDelete) { this.messageMap.put("values", new HashMap<String, String>()); setSource(source); setUsername(System.getProperty("user.name")); setTimestamp(System.currentTimeMillis()); try { setHost(Util.getLocalHost().getHostAddress()); } catch (Exception e) { log.warn("Unable to retrieve host for current machine. Setting coordinator stream message host field to an empty string."); setHost(""); } } setVersion(VERSION); }
public CoordinatorStreamMessage(String source, Object[] keyArray, Map<String, Object> messageMap) { this(keyArray, messageMap); if (!isDelete) { this.messageMap.put("values", new HashMap<String, String>()); setSource(source); setUsername(System.getProperty("user.name")); setTimestamp(System.currentTimeMillis()); try { setHost(Util.getLocalHost().getHostAddress()); } catch (Exception e) { log.warn("Unable to retrieve host for current machine. Setting coordinator stream message host field to an empty string."); setHost(""); } } setVersion(VERSION); }
public CoordinatorStreamMessage(String source, Object[] keyArray, Map<String, Object> messageMap) { this(keyArray, messageMap); if (!isDelete) { this.messageMap.put("values", new HashMap<String, String>()); setSource(source); setUsername(System.getProperty("user.name")); setTimestamp(System.currentTimeMillis()); try { setHost(Util.getLocalHost().getHostAddress()); } catch (Exception e) { log.warn("Unable to retrieve host for current machine. Setting coordinator stream message host field to an empty string."); setHost(""); } } setVersion(VERSION); }
MetricsConfig metricsConfig = new MetricsConfig(config); Map<String, MetricsReporter> metricsReporters = MetricsReporterLoader.getMetricsReporters(metricsConfig, Util.getLocalHost().getHostName()); SamzaRestService restService = new SamzaRestService(new Server(config.getPort()), metricsRegistry, metricsReporters, new ServletContextHandler(ServletContextHandler.SESSIONS));