public final class DatasetSpecification extends Object
DatasetSpecification is a hierarchical meta data object that contains all meta data
needed to instantiate a dataset at runtime. It is hierarchical because it also contains the
specification for any underlying datasets that are used in the implementation of the dataset.
DatasetSpecification consists of:
DatasetSpecification for each underlying dataset. For instance,
if a dataset implements an indexed table using two base Tables, one for the data and one for the
index, then these two tables have their own spec, which must be carried along with the spec for
the indexed table.DatasetSpecification uses a builder pattern for construction.| Modifier and Type | Class and Description |
|---|---|
static class |
DatasetSpecification.Builder
A Builder to construct DatasetSpecification instances.
|
| Modifier and Type | Method and Description |
|---|---|
static DatasetSpecification.Builder |
builder(String name,
String typeName) |
boolean |
equals(Object o) |
String |
getDescription()
Returns the description of dataset.
|
int |
getIntProperty(String key,
int defaultValue)
Lookup a custom property of the dataset.
|
long |
getLongProperty(String key,
long defaultValue)
Lookup a custom property of the dataset.
|
String |
getName()
Returns the name of the dataset.
|
Map<String,String> |
getOriginalProperties()
Return the original properties with which the dataset was created/reconfigured.
|
Map<String,String> |
getProperties()
Return map of all properties set in this specification.
|
String |
getProperty(String key)
Lookup a custom property of the dataset.
|
String |
getProperty(String key,
String defaultValue)
Lookup a custom property of the dataset.
|
DatasetSpecification |
getSpecification(String dsName)
Get the specification for an embedded dataset.
|
SortedMap<String,DatasetSpecification> |
getSpecifications()
Get the map of embedded dataset name to
DatasetSpecification |
String |
getType()
Returns the type of the dataset.
|
int |
hashCode() |
boolean |
isParent(String datasetName)
Returns true if the datasetName is the name of a non-composite dataset represented by this
spec.
|
DatasetSpecification |
setDescription(String description) |
DatasetSpecification |
setOriginalProperties(DatasetProperties originalProps) |
DatasetSpecification |
setOriginalProperties(Map<String,String> originalProps) |
String |
toString() |
public static DatasetSpecification.Builder builder(String name, String typeName)
public String getName()
public String getType()
@Nullable public String getDescription()
@Nullable public String getProperty(String key)
key - the name of the propertynull if the property does not existpublic String getProperty(String key, String defaultValue)
key - the name of the propertydefaultValue - the value to return if property does not existpublic long getLongProperty(String key, long defaultValue)
key - the name of the propertydefaultValue - the value to return if property does not existpublic int getIntProperty(String key, int defaultValue)
key - the name of the propertydefaultValue - the value to return if property does not exist@Nullable public Map<String,String> getOriginalProperties()
public Map<String,String> getProperties()
public DatasetSpecification getSpecification(String dsName)
dsName - the name of the embedded datasetpublic SortedMap<String,DatasetSpecification> getSpecifications()
DatasetSpecificationDatasetSpecificationpublic DatasetSpecification setOriginalProperties(DatasetProperties originalProps)
public DatasetSpecification setOriginalProperties(Map<String,String> originalProps)
public DatasetSpecification setDescription(String description)
public boolean isParent(String datasetName)
datasetName - the name of a datasettrue if the datasetName is represented by the dataset spec;
false otherwiseCopyright © 2024 Cask Data, Inc. Licensed under the Apache License, Version 2.0.