@Override public boolean apply(@Nullable S input) { return SharedResourcesBrokerUtils.isScopeTypeAncestor(scope, input); } }));
@Override public void onInvalidate() { if (this.closeOnInvalidation) { SharedResourcesBrokerUtils.shutdownObject(getResource(), log); } } }
/** * Get a {@link org.apache.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); }
SharedResourcesBrokerUtils.shutdownObject(obj, log); } catch (Throwable t) { exceptionsList.add(t);
if (obj instanceof ResourceCoordinate) { ResourceCoordinate<T, K, S> resourceCoordinate = (ResourceCoordinate<T, K, S>) obj; if (!SharedResourcesBrokerUtils.isScopeTypeAncestor((ScopeType) currentScope.getType(), ((ResourceCoordinate) obj).getScope())) { throw new RuntimeException(String .format("%s returned an invalid coordinate: scope %s is not an ancestor of %s.", currentFactory.getName(),
@Override public void onInvalidate() { if (this.closeOnInvalidation) { SharedResourcesBrokerUtils.shutdownObject(getResource(), log); } } }
@Override public boolean apply(@Nullable S input) { return SharedResourcesBrokerUtils.isScopeTypeAncestor(scope, input); } }));
SharedResourcesBrokerUtils.shutdownObject(obj, log); } catch (Throwable t) { exceptionsList.add(t);
/** * Get a {@link org.apache.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); }
if (obj instanceof ResourceCoordinate) { ResourceCoordinate<T, K, S> resourceCoordinate = (ResourceCoordinate<T, K, S>) obj; if (!SharedResourcesBrokerUtils.isScopeTypeAncestor((ScopeType) currentScope.getType(), ((ResourceCoordinate) obj).getScope())) { throw new RuntimeException(String .format("%s returned an invalid coordinate: scope %s is not an ancestor of %s.", currentFactory.getName(),