public KafkaJobMonitor(String topic, MutableJobCatalog catalog, Config config) { super(topic, ConfigUtils.getConfigOrEmpty(config, KAFKA_JOB_MONITOR_PREFIX), 1); this.jobCatalog = catalog; }
public Config getPrioritizationConfig() { return ConfigUtils.getConfigOrEmpty(this.config, PRIORITIZATION_PREFIX); }
/** Instantiates a new instance using standard typesafe config defaults: * {@link ConfigFactory#load()} */ public SimpleHDFSConfigStoreFactory() { this(ConfigUtils.getConfigOrEmpty(ConfigFactory.load(), DEFAULT_CONFIG_NAMESPACE)); }
/** Instantiates a new instance using standard typesafe config defaults: * {@link ConfigFactory#load()} */ public SimpleHadoopFilesystemConfigStoreFactory() { this(ConfigUtils.getConfigOrEmpty(ConfigFactory.load(), DEFAULT_CONFIG_NAMESPACE)); }
public Config getScopedConfig() { if (this.scope == null) { return ConfigFactory.empty(); } return ConfigUtils.getConfigOrEmpty(this.fullConfig, this.scope.name()); }
@Override public ThrottlingPolicy createPolicy(SharedLimiterKey key, SharedResourcesBroker<ThrottlingServerScopes> broker, Config config) { try { Config resourceConfig = getConfigClient().getConfig(new URI(config.getString(CONFIG_KEY_URI_PREFIX_KEY) + key.getResourceLimitedPath())); ThrottlingPolicyFactory.SpecificPolicyFactory factory = ThrottlingPolicyFactory.POLICY_CLASS_RESOLVER.resolveClass(resourceConfig.getString(POLICY_KEY)).newInstance(); return factory.createPolicy(key, broker, ConfigUtils.getConfigOrEmpty(resourceConfig, THROTTLING_CONFIG_PREFIX)); } catch (URISyntaxException | ConfigStoreFactoryDoesNotExistsException | ConfigStoreCreationException | ReflectiveOperationException exc) { throw new RuntimeException(exc); } }
this.prioritizer = Optional.absent(); this.maxToCopy = CopyResourcePool.fromConfig(ConfigUtils.getConfigOrEmpty(this.config, MAX_COPY_PREFIX));
/** * Get a {@link gobblin.broker.iface.ConfigView} for the input scope, key, and factory. */ public <K extends SharedResourceKey> KeyedScopedConfigViewImpl<S, K> getConfigView(S scope, K key, String factoryName) { Config config = ConfigFactory.empty(); for (ScopedConfig<S> scopedConfig : this.scopedConfigs) { if (scopedConfig.getScopeType().equals(scopedConfig.getScopeType().rootScope())) { config = ConfigUtils.getConfigOrEmpty(scopedConfig.getConfig(), factoryName).withFallback(config); } else if (scope != null && SharedResourcesBrokerUtils.isScopeTypeAncestor(scope, scopedConfig.getScopeType())) { Config tmpConfig = ConfigUtils.getConfigOrEmpty(scopedConfig.getConfig(), factoryName); tmpConfig = ConfigUtils.getConfigOrEmpty(tmpConfig, scope.name()); config = tmpConfig.atKey(scope.name()).withFallback(config); } } return new KeyedScopedConfigViewImpl<>(scope, key, factoryName, config); }
public Config getKeyedConfig() { if (this.key == null) { return ConfigFactory.empty(); } String key = this.key.toConfigurationKey(); if (key == null) { return ConfigFactory.empty(); } return ConfigUtils.getConfigOrEmpty(this.fullConfig, this.key.toConfigurationKey()); }
public Config getKeyedScopedConfig() { if (this.scope == null || this.key.toConfigurationKey() == null) { return ConfigFactory.empty(); } return ConfigUtils.getConfigOrEmpty(this.fullConfig, chainConfigKeys(this.scope.name(), this.key.toConfigurationKey())); }
/** * Create a root {@link SharedResourcesBroker}. Subscoped brokers should be built using * {@link SharedResourcesBroker#newSubscopedBuilder(ScopeInstance)}. * * In general, this method will be called only once per application, and all other brokers will Nbe children of the root * application broker. * * @param config The global configuration of the broker. * @param globalScope The scope of the root broker. * @param <S> The {@link ScopeType} DAG used for this broker tree. */ public static <S extends ScopeType<S>> SharedResourcesBrokerImpl<S> createDefaultTopLevelBroker(Config config, ScopeInstance<S> globalScope) { if (!globalScope.getType().equals(globalScope.getType().rootScope())) { throw new IllegalArgumentException(String.format("The top level broker must be created at the root scope type. " + "%s is not a root scope type.", globalScope.getType())); } ScopeWrapper<S> scopeWrapper = new ScopeWrapper<>(globalScope.getType(), globalScope, Lists.<ScopeWrapper<S>>newArrayList()); return new SharedResourcesBrokerImpl<>(new DefaultBrokerCache<S>(), scopeWrapper, Lists.newArrayList(new SharedResourcesBrokerImpl.ScopedConfig<>(globalScope.getType(), ConfigUtils.getConfigOrEmpty(addSystemConfigurationToConfig(config), BrokerConstants.GOBBLIN_BROKER_CONFIG_PREFIX))), ImmutableMap.of(globalScope.getType(), scopeWrapper)); }
for (Map.Entry<String, ConfigValue> entry : ConfigUtils.getConfigOrEmpty(config.getConfig(), TAG_KEY).entrySet()) { builder.addTag(new Tag<>(entry.getKey(), entry.getValue().unwrapped()));