/** * Return the property value if it's non-negative and throw an exception if * it's not. * * @param key the property key * @param defaultValue the default value */ private long getNonNegative(String key, int defaultValue) { int flushOffsetIntervalMillis = properties.getInt(key, defaultValue); if (flushOffsetIntervalMillis < 0) { throw new MetricsException("The " + key + " property must be " + "non-negative. Value was " + flushOffsetIntervalMillis); } return flushOffsetIntervalMillis; }
multicastEnabled = conf.getBoolean(MULTICAST_ENABLED_PROPERTY, DEFAULT_MULTICAST_ENABLED); multicastTtl = conf.getInt(MULTICAST_TTL_PROPERTY, DEFAULT_MULTICAST_TTL);