/** * Datasource metadata loader fetches data from the druid coordinator and updates the datasource metadata service. * * @param physicalTableDictionary The physical tables with data sources to update * @param metadataService The service that will store the metadata loaded by this loader * @param druidWebService The druid webservice to query * @param mapper Object mapper to parse druid metadata */ public DataSourceMetadataLoadTask( PhysicalTableDictionary physicalTableDictionary, DataSourceMetadataService metadataService, DruidWebService druidWebService, ObjectMapper mapper ) { super( DataSourceMetadataLoadTask.class.getSimpleName(), SYSTEM_CONFIG.getLongProperty(DRUID_SEG_LOADER_TIMER_DELAY_KEY, 0), SYSTEM_CONFIG.getLongProperty( DRUID_SEG_LOADER_TIMER_DURATION_KEY, TimeUnit.MINUTES.toMillis(1) ) ); this.physicalTableDictionary = physicalTableDictionary; this.metadataService = metadataService; this.druidWebService = druidWebService; this.mapper = mapper; this.failureCallback = getFailureCallback(); this.lastRunTimestamp = new AtomicReference<>(); }
/** * DimensionLoaderTask tells all of the {@link DimensionValueLoader}s to update and add values to the dimension * cache. * * @param dimensionRowProviders A Collection of {@link DimensionValueLoader} to initialize dimensions. */ public DimensionValueLoadTask(Collection<DimensionValueLoader> dimensionRowProviders) { super( DimensionValueLoadTask.class.getSimpleName(), SYSTEM_CONFIG.getLongProperty(LOADER_TIMER_DELAY, 0), SYSTEM_CONFIG.getLongProperty( LOADER_TIMER_DURATION, TimeUnit.MINUTES.toMillis(1) ) ); this.dimensionRowProviders = dimensionRowProviders; lastRunTimestamp = new AtomicReference<>(); HttpErrorCallback errorCallback = getErrorCallback(); FailureCallback failureCallback = getFailureCallback(); dimensionRowProviders.forEach(dimensionRowProvider -> { dimensionRowProvider.setErrorCallback(errorCallback); dimensionRowProvider.setFailureCallback(failureCallback); }); }
/** * Constructor. * * @param druidClient The client to query Druid coordinator * @param dimensionDictionary A {@link com.yahoo.bard.webservice.data.dimension.DimensionDictionary} that is used * to obtain a list of lookups in Fili. */ public RegisteredLookupMetadataLoadTask(DruidWebService druidClient, DimensionDictionary dimensionDictionary) { super( RegisteredLookupMetadataLoadTask.class.getSimpleName(), SYSTEM_CONFIG.getLongProperty(INITIAL_LOOKUP_CHECKING_DELAY, 0), SYSTEM_CONFIG.getLongProperty(LOOKUP_NORMAL_CHECKING_PERIOD_KEY, TimeUnit.MINUTES.toMillis(1)) ); this.druidClient = druidClient; this.dimensionDictionary = dimensionDictionary; this.successCallback = buildLookupSuccessCallback(); this.failureCallback = getFailureCallback(); this.errorCallback = getErrorCallback(); this.pendingLookups = new HashSet<>(); this.lookupTiers = getTiers(SYSTEM_CONFIG.getStringProperty(TIERS_KEY, "__default")); }
long queryWeightLimit = SYSTEM_CONFIG.getLongProperty( QUERY_WEIGHT_LIMIT_KEY, QUERY_WEIGHT_LIMIT_DEFAULT