-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement LookupMetadataLoadTask #620
Conversation
4190dc7
to
72be3ea
Compare
@@ -306,6 +310,13 @@ protected void configure() { | |||
setupDataSourceMetaData(healthCheckRegistry, dataSourceMetadataLoader); | |||
} | |||
|
|||
if (DRUID_LOOKUP.isOn()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to druid_lookup_metadata to distinguish from a fact lookup feature.
@@ -306,6 +310,13 @@ protected void configure() { | |||
setupDataSourceMetaData(healthCheckRegistry, dataSourceMetadataLoader); | |||
} | |||
|
|||
if (DRUID_LOOKUP.isOn()) { | |||
setupLookUp( | |||
healthCheckRegistry, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setupLookupMetadataLoader I think to disambiguate.
setupLookUp( | ||
healthCheckRegistry, | ||
buildLookupLoader(metadataDruidWebService, loader.getDimensionDictionary()) | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lookupMetadaLoader
@@ -726,6 +737,19 @@ protected DataSourceMetadataLoadTask buildDataSourceMetadataLoader( | |||
); | |||
} | |||
|
|||
/** | |||
* Builds a lookup loader. | |||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lookup metadata loader
@@ -15,6 +15,7 @@ | |||
INTERSECTION_REPORTING("intersection_reporting_enabled"), | |||
UPDATED_METADATA_COLLECTION_NAMES("updated_metadata_collection_names_enabled"), | |||
DRUID_COORDINATOR_METADATA("druid_coordinator_metadata_enabled"), | |||
DRUID_LOOKUP("druid_lookup_enabled"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Druid_lookup_metadata
/** | ||
* Lookup Load task sends requests to Druid coordinator and returns list of configured lookup statuses in Druid. | ||
*/ | ||
public class LookupLoadTask extends LoadTask<Boolean> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LookupMetadata
lookupStatuses.put(entry.getKey(), entry.getValue().get("loaded").asBoolean()); | ||
} | ||
|
||
unloadedLookups = dimensionDictionary.findAll().stream() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are three states on lookups, loaded, toLoad and toDrop. I think 'unloaded' is confusing because we usually mean toLoad but it sounds like they're being dropped. how about 'pending' where you have 'unloaded'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
f6a8a99
to
8099a96
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only big change is to make the lookup namespace configurable. Multiple namespaces should be supported via a command delimited string config parameter.
* @param dimensionDictionary A {@link com.yahoo.bard.webservice.data.dimension.DimensionDictionary} that is used | ||
* to obtain a list of lookups in Fili. | ||
* | ||
* @return a lookup loader |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lookup metadata loader
@@ -768,6 +795,20 @@ protected final void setupDataSourceMetaData( | |||
healthCheckRegistry.register(HEALTH_CHECK_NAME_DATASOURCE_METADATA, dataSourceMetadataLoaderHealthCheck); | |||
} | |||
|
|||
/** | |||
* Schedule a lookup loader and register its health check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lookup metadata loader
*/ | ||
@Singleton | ||
public class LookupHealthCheck extends HealthCheck { | ||
private final LookupMetadataLoadTask lookupMetadataLoadTask; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is potentially modified in another thread, we may need to make this volatile or make it a reference.
/** | ||
* Location of lookup statuses on Druid coordinator. | ||
*/ | ||
public static final String LOOKUP_QUERY = "/lookups/status/__default"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__default namespace is not always going to be where lookups are loaded. We need to make a list of namespaces that is configurable, defaulting to __default if not configured.
0dd676a
to
058e15b
Compare
058e15b
to
7500070
Compare
41b4bcf
to
8556d5c
Compare
# A comma separated list of configured lookup tiers. See http://druid.io/docs/latest/querying/lookups.html | ||
# The default is a list of 1 tier called "__default" | ||
# If you have multiple tiers, write them like "tier1,tier2,tier3" | ||
bard__lookup_tiers=__default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make this explicit as druid_registered_lookup_tiers
Thanks for the approval, @michael-mclawhorn ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@michael-mclawhorn I am ok with this PR, but have concern whether this will significantly reduce the availability of webservice. If any of the lookup is not loaded, webservice will not be up, and I am afraid that this means if a single lookup fail to load for some reason, the whole webservice is down.
@garyluoex I assume this is the problem we are addressing in this PR. We don't want webservice to be running with a broken lookup online. @michael-mclawhorn ? |
@garyluoex Thank you for the approval! |
Addresses issue #624