D
- defines data operations that can be performed on this dataset instance@Beta public abstract class CompositeDatasetDefinition<D extends Dataset> extends AbstractDatasetDefinition<D,DatasetAdmin> implements Reconfigurable
DatasetDefinition
that implements basic methods by delegating logic execution to
underlying dataset definitions.NO_ARGUMENTS
Modifier | Constructor and Description |
---|---|
protected |
CompositeDatasetDefinition(String name,
Map<String,? extends DatasetDefinition> delegates)
Constructor that takes an info about underlying datasets
|
protected |
CompositeDatasetDefinition(String name,
String delegateName,
DatasetDefinition delegate)
Constructor that takes one underlying dataset.
|
protected |
CompositeDatasetDefinition(String name,
String delegateNameA,
DatasetDefinition delegateA,
String delegateNameB,
DatasetDefinition delegateB)
Constructor that takes two underlying datasets.
|
Modifier and Type | Method and Description |
---|---|
DatasetSpecification |
configure(String instanceName,
DatasetProperties properties)
Configures new instance of the dataset.
|
DatasetAdmin |
getAdmin(DatasetContext datasetContext,
DatasetSpecification spec,
ClassLoader classLoader)
Provides dataset admin to be used to perform administrative operations on the dataset instance defined by passed
DatasetSpecification . |
protected <T extends Dataset> |
getDataset(DatasetContext datasetContext,
String name,
DatasetSpecification spec,
Map<String,String> arguments,
ClassLoader classLoader)
Gets a
Dataset instance from the delegates with the given instance name. |
protected <DS extends Dataset,DA extends DatasetAdmin> |
getDelegate(String name) |
DatasetSpecification |
reconfigure(String instanceName,
DatasetProperties newProperties,
DatasetSpecification currentSpec)
Validates the new properties, including a compatibility check with the existing spec, and returns a
new dataset specification for the dataset instance.
|
getName, reconfigure
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDataset
protected CompositeDatasetDefinition(String name, Map<String,? extends DatasetDefinition> delegates)
name
- this dataset type namedelegates
- map of [dataset instance name] -> [dataset definition] to use for this instance nameprotected CompositeDatasetDefinition(String name, String delegateName, DatasetDefinition delegate)
name
- this dataset type namedelegateName
- name of the first delegatedelegate
- dataset definition for the second delegateprotected CompositeDatasetDefinition(String name, String delegateNameA, DatasetDefinition delegateA, String delegateNameB, DatasetDefinition delegateB)
name
- this dataset type namedelegateNameA
- name of the first delegatedelegateA
- dataset definition for the first delegatedelegateNameB
- name of the second delegatedelegateB
- dataset definition for the second delegateprotected final <T extends Dataset> T getDataset(DatasetContext datasetContext, String name, DatasetSpecification spec, Map<String,String> arguments, ClassLoader classLoader) throws IOException
Dataset
instance from the delegates with the given instance name.T
- type of the datasetdatasetContext
- the context which the get call is happeningname
- name of the datasetspec
- the DatasetSpecification
for the outer datasetarguments
- dataset argumentsclassLoader
- classloader for loading the datasetIOException
- if failed to get a dataset instancepublic DatasetSpecification configure(String instanceName, DatasetProperties properties)
DatasetDefinition
configure
in interface DatasetDefinition<D extends Dataset,DatasetAdmin>
instanceName
- name of the instanceproperties
- instance configuration propertiesDatasetSpecification
that fully describes dataset instance.
The DatasetSpecification
can be used to create DatasetAdmin
and Dataset
to perform
administrative and data operations respectively, see DatasetDefinition.getAdmin(DatasetContext,
DatasetSpecification, ClassLoader)
and DatasetDefinition.getDataset(DatasetContext, DatasetSpecification, Map, ClassLoader)
.public DatasetSpecification reconfigure(String instanceName, DatasetProperties newProperties, DatasetSpecification currentSpec) throws IncompatibleUpdateException
Reconfigurable
reconfigure
in interface Reconfigurable
newProperties
- the updated dataset properties, to be validated by this methodcurrentSpec
- the current specification of the datasetIncompatibleUpdateException
- if the new properties are not compatible with the existing datasetpublic final DatasetAdmin getAdmin(DatasetContext datasetContext, DatasetSpecification spec, ClassLoader classLoader) throws IOException
DatasetDefinition
DatasetSpecification
.getAdmin
in interface DatasetDefinition<D extends Dataset,DatasetAdmin>
datasetContext
- context for the datasetspec
- specification of the dataset instance.classLoader
- classloader to use when executing admin operationsIOException
protected <DS extends Dataset,DA extends DatasetAdmin> DatasetDefinition<DS,DA> getDelegate(String name)
Copyright © 2022 Cask Data, Inc. Licensed under the Apache License, Version 2.0.