File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
fili-core/src/main/java/com/yahoo/bard/webservice/data/dimension Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -143,6 +143,8 @@ Current
143143
144144### Fixed:
145145
146+ - [ Handle Number Format errors from empty or missing cardinality value] ( https://github.com/yahoo/fili/issues/549 )
147+
146148- [ Fix ConstantMaker make method with LogicalMetricInfo class] ( https://github.com/yahoo/fili/pull/540 )
147149 * The ConstantMaker make method needs to be rewritten with the LogicalMetricInfo class.
148150
Original file line number Diff line number Diff line change @@ -49,6 +49,18 @@ public interface KeyValueStore extends Closeable {
4949 */
5050 String get (@ NotNull String key );
5151
52+ /**
53+ * Get the value for a key from store or provide a default
54+ *
55+ * @param key Key to get the value for
56+ * @param defaultValue A default value in case key is null
57+ *
58+ * @return the value for corresponding key
59+ */
60+ default String getOrDefault (@ NotNull String key , String defaultValue ) {
61+ return get (key ) == null ? defaultValue : get (key );
62+ }
63+
5264 /**
5365 * Get the health status of the store.
5466 *
Original file line number Diff line number Diff line change @@ -205,7 +205,9 @@ public void setKeyValueStore(KeyValueStore keyValueStore) {
205205
206206 @ Override
207207 public int getDimensionCardinality () {
208- return Integer .parseInt (keyValueStore .get (DimensionStoreKeyUtils .getCardinalityKey ()));
208+ return Integer .parseInt (
209+ keyValueStore .getOrDefault (DimensionStoreKeyUtils .getCardinalityKey (), "0" )
210+ );
209211 }
210212
211213 @ Override
You can’t perform that action at this time.
0 commit comments