private SchedulerDaemon(Properties defaultProperties, Properties customProperties) throws Exception { this(PropertiesUtils.combineProperties(defaultProperties, customProperties)); }
public SchedulerService(Properties props) { this(Boolean.parseBoolean( props.getProperty(ConfigurationKeys.SCHEDULER_WAIT_FOR_JOB_COMPLETION_KEY, ConfigurationKeys.DEFAULT_SCHEDULER_WAIT_FOR_JOB_COMPLETION)), Optional.of(PropertiesUtils.extractPropertiesWithPrefix(props, Optional.of("org.quartz.")))); }
/** * Check whether metrics collection and reporting are enabled or not. * * @param properties Configuration properties * @return whether metrics collection and reporting are enabled */ public static boolean isEnabled(Properties properties) { return PropertiesUtils .getPropAsBoolean(properties, ConfigurationKeys.METRICS_ENABLED_KEY, ConfigurationKeys.DEFAULT_METRICS_ENABLED); }
/** * Constructs a {@link Deserializer}, using the value of {@link #KAFKA_DESERIALIZER_TYPE}. */ private static Deserializer<?> getDeserializer(Properties props, Optional<Deserializers> deserializerType) throws ReflectiveOperationException { Deserializer<?> deserializer; if (deserializerType.isPresent()) { deserializer = ConstructorUtils.invokeConstructor(deserializerType.get().getDeserializerClass()); } else { deserializer = Deserializer.class .cast(ConstructorUtils.invokeConstructor(Class.forName(props.getProperty(KAFKA_DESERIALIZER_TYPE)))); } deserializer.configure(PropertiesUtils.propsToStringKeyMap(props), false); return deserializer; }
/** * create a complete property file based on the given template */ public static Properties mergeTemplateWithUserCustomizedFile(Properties template, Properties userCustomized) { Properties cleanedTemplate = new Properties(); cleanedTemplate.putAll(template); if (cleanedTemplate.containsKey(ConfigurationKeys.REQUIRED_ATRRIBUTES_LIST)) { cleanedTemplate.remove(ConfigurationKeys.REQUIRED_ATRRIBUTES_LIST); } Properties cleanedUserCustomized = new Properties(); cleanedUserCustomized.putAll(userCustomized); if (cleanedUserCustomized.containsKey(ConfigurationKeys.JOB_TEMPLATE_PATH)) { cleanedUserCustomized.remove(ConfigurationKeys.JOB_TEMPLATE_PATH); } return PropertiesUtils.combineProperties(cleanedTemplate, cleanedUserCustomized); } }
private void buildGraphiteMetricReporter(Properties properties) { boolean metricsEnabled = PropertiesUtils .getPropAsBoolean(properties, ConfigurationKeys.METRICS_REPORTING_GRAPHITE_METRICS_ENABLED_KEY, ConfigurationKeys.DEFAULT_METRICS_REPORTING_GRAPHITE_METRICS_ENABLED); if (metricsEnabled) { .getPropAsBoolean(properties, ConfigurationKeys.METRICS_REPORTING_GRAPHITE_EVENTS_ENABLED_KEY, ConfigurationKeys.DEFAULT_METRICS_REPORTING_GRAPHITE_EVENTS_ENABLED); if (eventsEnabled) { .getPropAsBoolean(properties, ConfigurationKeys.METRICS_REPORTING_GRAPHITE_EVENTS_VALUE_AS_KEY, ConfigurationKeys.DEFAULT_METRICS_REPORTING_GRAPHITE_EVENTS_VALUE_AS_KEY); String eventsPortProp = properties.getProperty(ConfigurationKeys.METRICS_REPORTING_GRAPHITE_EVENTS_PORT);
private void buildInfluxDBMetricReporter(Properties properties) { boolean metricsEnabled = PropertiesUtils .getPropAsBoolean(properties, ConfigurationKeys.METRICS_REPORTING_INFLUXDB_METRICS_ENABLED_KEY, ConfigurationKeys.DEFAULT_METRICS_REPORTING_INFLUXDB_METRICS_ENABLED); if (metricsEnabled) { .getPropAsBoolean(properties, ConfigurationKeys.METRICS_REPORTING_INFLUXDB_EVENTS_ENABLED_KEY, ConfigurationKeys.DEFAULT_METRICS_REPORTING_INFLUXDB_EVENTS_ENABLED); if (eventsEnabled) {