Class DimensionKey
A metric advisor data feed schema DataFeedSchema defines dimension
names and metric for a data source, For example, a SQL data source for a
wholesale company can have "product_category" and "city" as dimension names
and "revenue" as a metric.
A combination of value for all dimension names identifies a metric time-series.
A DimensionKey can hold such a combination, for example,
[ product_category=men-shoes, city=redmond ] identifies one specific
time-series.
A DimensionKey can also have partial dimensions, for example,
[ city=redmond ] identifying a group of time-series having value for "city"
dimension as "redmond".
Two DimensionKey with same dimension name-value pairs identifies
the same time-series or time-series group, this means equals(Object)
return true.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of DimensionKey.DimensionKey(Map<String, String> dimensionNameValue) Creates a new instance of DimensionKey that is initialized with the provided map of dimension name-value pairs. -
Method Summary
-
Constructor Details
-
DimensionKey
public DimensionKey()Creates a new instance of DimensionKey. -
DimensionKey
Creates a new instance of DimensionKey that is initialized with the provided map of dimension name-value pairs.- Parameters:
dimensionNameValue- The map of dimension name values.
-
-
Method Details
-
put
Adds a dimension name-value to the key.- Parameters:
dimensionName- The dimension name.dimensionValue- The dimension value.- Returns:
- The DimensionKey object itself.
-
get
Gets dimension value for the givendimensionName.- Parameters:
dimensionName- The dimension name.- Returns:
- The dimension value if exists,
nullotherwise.
-
remove
Removes a dimension name-value from the key.- Parameters:
dimensionName- The name of the dimension to remove.- Returns:
- The DimensionKey object itself.
-
asMap
Gets the dimension name-value pairs in the key as a map.- Returns:
- The dimension name-value map.
-
equals
-
hashCode
public int hashCode()
-