diff --git a/CHANGELOG.md b/CHANGELOG.md index 56503a951d..f0328c3352 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -122,6 +122,10 @@ Current ### Changed: +- [Lift required override on deprecated method in MetricLoader](https://github.com/yahoo/fili/pull/609) + * Add default implementation to deprecated `loadMetricDictionary` in `MetricLoader` so that downstream projects are + able to implement the new version without worrying about the deprecated version. + - [Added DataApiRequestFactory layer](https://github.com/yahoo/fili/issues/603) * Replaced static construction of DataApiRequest with an injectableFactory * Create an additional constructor for DataApiRequestImpl which unpacks the config resources bundle to make it easier to override dictionaries. diff --git a/fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/MetricLoader.java b/fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/MetricLoader.java index fb98bf86fd..ff36a3146a 100644 --- a/fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/MetricLoader.java +++ b/fili-core/src/main/java/com/yahoo/bard/webservice/data/config/metric/MetricLoader.java @@ -5,6 +5,8 @@ import com.yahoo.bard.webservice.data.dimension.DimensionDictionary; import com.yahoo.bard.webservice.data.metric.MetricDictionary; +import org.slf4j.LoggerFactory; + /** * Defines the core interactions for loading metrics into a metric dictionary. */ @@ -18,7 +20,12 @@ public interface MetricLoader { * @deprecated in favor of loadMetricDictionary(MetricDictionary, DimensionDictionary) */ @Deprecated - void loadMetricDictionary(MetricDictionary metricDictionary); + default void loadMetricDictionary(MetricDictionary metricDictionary) { + String message = "loadMetricDictionary(MetricDictionary) is not implemented. It has been deprecated. " + + "Implement and use loadMetricDictionary(MetricDictionary, DimensionDictionary) instead."; + LoggerFactory.getLogger(MetricLoader.class).error(message); + throw new UnsupportedOperationException(message); + } /** * Load metrics and populate the metric dictionary with dimension dictionary for dimension dependent metrics.