public class KeyValueStoreDimension extends Object implements Dimension
Supports point lookups:
DEFAULT_CATEGORY
Constructor and Description |
---|
KeyValueStoreDimension(DimensionConfig dimensionConfig)
Constructor.
|
KeyValueStoreDimension(String dimensionName,
String description,
LinkedHashSet<DimensionField> dimensionFields,
KeyValueStore keyValueStore,
SearchProvider searchProvider)
Constructor.
|
KeyValueStoreDimension(String dimensionName,
String description,
LinkedHashSet<DimensionField> dimensionFields,
KeyValueStore keyValueStore,
SearchProvider searchProvider,
boolean isAggregatable)
Constructor.
|
KeyValueStoreDimension(String dimensionName,
String description,
LinkedHashSet<DimensionField> dimensionFields,
KeyValueStore keyValueStore,
SearchProvider searchProvider,
Set<DimensionRow> dimensionRows)
Constructor.
|
KeyValueStoreDimension(String dimensionName,
String longName,
String category,
String description,
LinkedHashSet<DimensionField> dimensionFields,
KeyValueStore keyValueStore,
SearchProvider searchProvider,
LinkedHashSet<DimensionField> defaultDimensionFields,
boolean isAggregatable)
Constructor.
|
KeyValueStoreDimension(String dimensionName,
String longName,
String category,
String description,
LinkedHashSet<DimensionField> dimensionFields,
KeyValueStore keyValueStore,
SearchProvider searchProvider,
LinkedHashSet<DimensionField> defaultDimensionFields,
boolean isAggregatable,
StorageStrategy storageStrategy)
Constructor.
|
KeyValueStoreDimension(String dimensionName,
String longName,
String category,
String description,
LinkedHashSet<DimensionField> dimensionFields,
KeyValueStore keyValueStore,
SearchProvider searchProvider,
Set<DimensionRow> dimensionRows)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAllDimensionRows(Set<DimensionRow> dimensionRows)
Add all dimension rows to the dimension's set of rows.
|
void |
addDimensionRow(DimensionRow dimensionRow)
Add a dimension row to the dimension's set of rows.
|
DimensionRow |
createEmptyDimensionRow(String keyFieldValue)
Create an empty DimensionRow for this dimension.
|
void |
deleteAllDimensionRows()
Internal method for cleaning the dimension rows.
|
boolean |
equals(Object o) |
DimensionRow |
findDimensionRowByKeyValue(String value)
Get a dimension row given an id.
|
String |
getApiName()
Getter for api name.
|
int |
getCardinality()
Get the cardinality of the dimension.
|
String |
getCategory()
Get the category of the dimension.
|
LinkedHashSet<DimensionField> |
getDefaultDimensionFields()
Getter for default dimension fields.
|
String |
getDescription()
Getter for description.
|
LinkedHashSet<DimensionField> |
getDimensionFields()
Getter for dimension fields.
|
DimensionField |
getFieldByName(String name)
Find dimension field by name.
|
DimensionField |
getKey()
Get primary key field for this dimension.
|
org.joda.time.DateTime |
getLastUpdated()
Getter for lastUpdated.
|
String |
getLongName()
Get the long name of the dimension.
|
SearchProvider |
getSearchProvider()
Getter for search provider.
|
StorageStrategy |
getStorageStrategy()
Returns the
StorageStrategy of the dimension. |
int |
hashCode() |
boolean |
isAggregatable()
Return whether this dimension can be aggregated.
|
DimensionRow |
parseDimensionRow(Map<String,String> fieldNameValueMap)
Generate a DimensionRow for this dimension from a field name / value map.
|
void |
setLastUpdated(org.joda.time.DateTime lastUpdated)
Setter for lastUpdated.
|
String |
toString() |
KeyValueStoreDimension |
withStorageStrategy(StorageStrategy storageStrategy)
Constructs a new KeyValueStoreDimension with specified
StorageStrategy . |
public KeyValueStoreDimension(String dimensionName, String longName, String category, String description, @NotNull LinkedHashSet<DimensionField> dimensionFields, @NotNull KeyValueStore keyValueStore, SearchProvider searchProvider, @NotNull LinkedHashSet<DimensionField> defaultDimensionFields, boolean isAggregatable, StorageStrategy storageStrategy)
dimensionName
- API Name of the dimensionlongName
- Long API Name of the dimensioncategory
- Category of the dimensiondescription
- Description of the dimensiondimensionFields
- Metadata fields of the dimensionkeyValueStore
- Metadata store for the dimensionsearchProvider
- Search provider over the metadata for the dimensiondefaultDimensionFields
- Default fields for the dimensionisAggregatable
- Whether the dimension is aggregatablestorageStrategy
- Strategy of how dimension is loaded. See
StorageStrategy
public KeyValueStoreDimension(String dimensionName, String longName, String category, String description, @NotNull LinkedHashSet<DimensionField> dimensionFields, @NotNull KeyValueStore keyValueStore, SearchProvider searchProvider, @NotNull LinkedHashSet<DimensionField> defaultDimensionFields, boolean isAggregatable)
dimensionName
- API Name of the dimensionlongName
- Long API Name of the dimensioncategory
- Category of the dimensiondescription
- Description of the dimensiondimensionFields
- Metadata fields of the dimensionkeyValueStore
- Metadata store for the dimensionsearchProvider
- Search provider over the metadata for the dimensiondefaultDimensionFields
- Default fields for the dimensionisAggregatable
- Whether the dimension is aggregatable
StorageStrategy
public KeyValueStoreDimension(String dimensionName, String description, @NotNull LinkedHashSet<DimensionField> dimensionFields, @NotNull KeyValueStore keyValueStore, SearchProvider searchProvider)
It constructs an aggregatable dimension that defaults the Long Api Name to the Api Name and sets the Category to the default category.
dimensionName
- API Name of the dimensiondescription
- Description of the dimensiondimensionFields
- Metadata fields of the dimensionkeyValueStore
- Metadata store for the dimensionsearchProvider
- Search provider over the metadata for the dimensionpublic KeyValueStoreDimension(String dimensionName, String description, @NotNull LinkedHashSet<DimensionField> dimensionFields, @NotNull KeyValueStore keyValueStore, SearchProvider searchProvider, boolean isAggregatable)
Defaults the Long Api Name to the Api Name and sets the Category to the default category.
dimensionName
- API Name of the dimensiondescription
- Description of the dimensiondimensionFields
- Metadata fields of the dimensionkeyValueStore
- Metadata store for the dimensionsearchProvider
- Search provider over the metadata for the dimensionisAggregatable
- Whether the dimension is aggregatablepublic KeyValueStoreDimension(String dimensionName, String description, @NotNull LinkedHashSet<DimensionField> dimensionFields, @NotNull KeyValueStore keyValueStore, SearchProvider searchProvider, Set<DimensionRow> dimensionRows)
Build an aggregatable dimension that defaults the Long Api Name to the Api Name and sets the Category to the default category.
dimensionName
- API Name of the dimensiondescription
- Description of the dimensiondimensionFields
- Metadata fields of the dimensionkeyValueStore
- Metadata store for the dimensionsearchProvider
- Search provider over the metadata for the dimensiondimensionRows
- Dimension metadata rows for this dimensionpublic KeyValueStoreDimension(String dimensionName, String longName, String category, String description, @NotNull LinkedHashSet<DimensionField> dimensionFields, @NotNull KeyValueStore keyValueStore, SearchProvider searchProvider, Set<DimensionRow> dimensionRows)
dimensionName
- API Name of the dimensionlongName
- Long API Name of the dimensioncategory
- Category of the dimensiondescription
- Description of the dimensiondimensionFields
- Metadata fields of the dimensionkeyValueStore
- Metadata store for the dimensionsearchProvider
- Search provider over the metadata for the dimensiondimensionRows
- Dimension metadata rows for this dimensionpublic KeyValueStoreDimension(DimensionConfig dimensionConfig)
dimensionConfig
- Configuration holder for this dimensionpublic void setLastUpdated(org.joda.time.DateTime lastUpdated)
Dimension
setLastUpdated
in interface Dimension
lastUpdated
- The date and time at which this Dimension was last updatedpublic String getApiName()
Dimension
getApiName
in interface Dimension
public org.joda.time.DateTime getLastUpdated()
Dimension
getLastUpdated
in interface Dimension
public String getDescription()
Dimension
getDescription
in interface Dimension
public String getCategory()
Dimension
getCategory
in interface Dimension
public String getLongName()
Dimension
getLongName
in interface Dimension
public StorageStrategy getStorageStrategy()
Dimension
StorageStrategy
of the dimension.getStorageStrategy
in interface Dimension
public int getCardinality()
Dimension
getCardinality
in interface Dimension
public LinkedHashSet<DimensionField> getDimensionFields()
Dimension
getDimensionFields
in interface Dimension
public LinkedHashSet<DimensionField> getDefaultDimensionFields()
Dimension
getDefaultDimensionFields
in interface Dimension
public DimensionField getFieldByName(String name)
Dimension
getFieldByName
in interface Dimension
name
- field namepublic SearchProvider getSearchProvider()
Dimension
getSearchProvider
in interface Dimension
public void addDimensionRow(DimensionRow dimensionRow)
Dimension
addDimensionRow
in interface Dimension
dimensionRow
- DimensionRow to addpublic void addAllDimensionRows(Set<DimensionRow> dimensionRows)
Dimension
addAllDimensionRows
in interface Dimension
dimensionRows
- Set of DimensionRows to addpublic DimensionRow createEmptyDimensionRow(String keyFieldValue)
Dimension
createEmptyDimensionRow
in interface Dimension
keyFieldValue
- String value of the key fieldpublic DimensionRow findDimensionRowByKeyValue(String value)
Dimension
findDimensionRowByKeyValue
in interface Dimension
value
- key valuepublic void deleteAllDimensionRows()
public DimensionField getKey()
Dimension
public DimensionRow parseDimensionRow(Map<String,String> fieldNameValueMap)
Dimension
parseDimensionRow
in interface Dimension
fieldNameValueMap
- Map of field names to valuespublic boolean isAggregatable()
Dimension
isAggregatable
in interface Dimension
public KeyValueStoreDimension withStorageStrategy(StorageStrategy storageStrategy)
StorageStrategy
.storageStrategy
- The specified StorageStrategyCopyright © 2016–2018 Yahoo! Inc.. All rights reserved.