Class BatchContextImpl
java.lang.Object
org.apache.beam.sdk.io.cdap.context.BatchContextImpl
- All Implemented Interfaces:
DatasetContext
,MetadataReader
,MetadataWriter
,ServiceDiscoverer
,BatchContext
,LineageRecorder
,LookupProvider
,StageContext
,TransformContext
- Direct Known Subclasses:
BatchSinkContextImpl
,BatchSourceContextImpl
,StreamingSourceContextImpl
Class for Batch, Sink and Stream CDAP wrapper classes that use it to provide common details.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
protected InputFormatProvider
This should be set afterSubmitterLifecycle.prepareRun(Object)
call with passing this context object as a param.protected OutputFormatProvider
This should be set afterSubmitterLifecycle.prepareRun(Object)
call with passing this context object as a param.This should be set afterSubmitterLifecycle.prepareRun(Object)
call with passing this context object as a param. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProperties
(MetadataEntity metadataEntity, Map<String, String> properties) void
addTags
(MetadataEntity metadataEntity, Iterable<String> tags) void
addTags
(MetadataEntity metadataEntity, String... tags) void
createDataset
(String datasetName, String typeName, DatasetProperties properties) boolean
datasetExists
(String datasetName) void
discardDataset
(Dataset dataset) <T extends Dataset>
TgetDataset
(String name) <T extends Dataset>
TgetDataset
(String namespace, String name) <T extends Dataset>
T<T extends Dataset>
TgetDataset
(String name, Map<String, String> arguments) long
getMetadata
(MetadataEntity metadataEntity) getMetadata
(MetadataScope scope, MetadataEntity metadataEntity) getPluginProperties
(String pluginId) getServiceURL
(String serviceId) getServiceURL
(String applicationId, String serviceId) <T> Class
<T> loadPluginClass
(String pluginId) <T> T
newPluginInstance
(String pluginId) <T> Lookup
<T> void
record
(List<FieldOperation> fieldOperations) void
releaseDataset
(Dataset dataset) void
removeMetadata
(MetadataEntity metadataEntity) void
removeProperties
(MetadataEntity metadataEntity) void
removeProperties
(MetadataEntity metadataEntity, String... keys) void
removeTags
(MetadataEntity metadataEntity) void
removeTags
(MetadataEntity metadataEntity, String... tags) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.cdap.cdap.api.ServiceDiscoverer
getServiceURL, openConnection
Methods inherited from interface io.cdap.cdap.etl.api.StageContext
getInputStages
-
Field Details
-
DEFAULT_SCHEMA_FIELD_NAME
- See Also:
-
DEFAULT_SCHEMA_RECORD_NAME
- See Also:
-
inputFormatProvider
This should be set afterSubmitterLifecycle.prepareRun(Object)
call with passing this context object as a param. -
outputFormatProvider
This should be set afterSubmitterLifecycle.prepareRun(Object)
call with passing this context object as a param. -
settableArguments
This should be set afterSubmitterLifecycle.prepareRun(Object)
call with passing this context object as a param.
-
-
Constructor Details
-
BatchContextImpl
public BatchContextImpl()
-
-
Method Details
-
getInputFormatProvider
-
getOutputFormatProvider
-
getStageName
- Specified by:
getStageName
in interfaceStageContext
-
getNamespace
- Specified by:
getNamespace
in interfaceStageContext
-
getPipelineName
- Specified by:
getPipelineName
in interfaceStageContext
-
getLogicalStartTime
public long getLogicalStartTime()- Specified by:
getLogicalStartTime
in interfaceStageContext
-
getMetrics
- Specified by:
getMetrics
in interfaceStageContext
-
getPluginProperties
- Specified by:
getPluginProperties
in interfaceStageContext
-
getPluginProperties
- Specified by:
getPluginProperties
in interfaceStageContext
-
loadPluginClass
- Specified by:
loadPluginClass
in interfaceStageContext
-
newPluginInstance
- Specified by:
newPluginInstance
in interfaceStageContext
- Throws:
InstantiationException
-
getInputSchema
- Specified by:
getInputSchema
in interfaceStageContext
-
getInputSchemas
- Specified by:
getInputSchemas
in interfaceStageContext
-
getOutputSchema
- Specified by:
getOutputSchema
in interfaceStageContext
-
getOutputPortSchemas
- Specified by:
getOutputPortSchemas
in interfaceStageContext
-
createDataset
public void createDataset(String datasetName, String typeName, DatasetProperties properties) throws DatasetManagementException - Specified by:
createDataset
in interfaceBatchContext
- Throws:
DatasetManagementException
-
datasetExists
- Specified by:
datasetExists
in interfaceBatchContext
- Throws:
DatasetManagementException
-
getArguments
- Specified by:
getArguments
in interfaceBatchContext
- Specified by:
getArguments
in interfaceStageContext
-
getFailureCollector
- Specified by:
getFailureCollector
in interfaceStageContext
-
getServiceURL
- Specified by:
getServiceURL
in interfaceServiceDiscoverer
-
getServiceURL
- Specified by:
getServiceURL
in interfaceServiceDiscoverer
-
getMetadata
public Map<MetadataScope,Metadata> getMetadata(MetadataEntity metadataEntity) throws MetadataException - Specified by:
getMetadata
in interfaceMetadataReader
- Throws:
MetadataException
-
getMetadata
public Metadata getMetadata(MetadataScope scope, MetadataEntity metadataEntity) throws MetadataException - Specified by:
getMetadata
in interfaceMetadataReader
- Throws:
MetadataException
-
addProperties
- Specified by:
addProperties
in interfaceMetadataWriter
-
addTags
- Specified by:
addTags
in interfaceMetadataWriter
-
addTags
- Specified by:
addTags
in interfaceMetadataWriter
-
removeMetadata
- Specified by:
removeMetadata
in interfaceMetadataWriter
-
removeProperties
- Specified by:
removeProperties
in interfaceMetadataWriter
-
removeProperties
- Specified by:
removeProperties
in interfaceMetadataWriter
-
removeTags
- Specified by:
removeTags
in interfaceMetadataWriter
-
removeTags
- Specified by:
removeTags
in interfaceMetadataWriter
-
record
- Specified by:
record
in interfaceLineageRecorder
-
getDataset
- Specified by:
getDataset
in interfaceDatasetContext
- Throws:
DatasetInstantiationException
-
getDataset
public <T extends Dataset> T getDataset(String namespace, String name) throws DatasetInstantiationException - Specified by:
getDataset
in interfaceDatasetContext
- Throws:
DatasetInstantiationException
-
getDataset
public <T extends Dataset> T getDataset(String name, Map<String, String> arguments) throws DatasetInstantiationException- Specified by:
getDataset
in interfaceDatasetContext
- Throws:
DatasetInstantiationException
-
getDataset
public <T extends Dataset> T getDataset(String namespace, String name, Map<String, String> arguments) throws DatasetInstantiationException- Specified by:
getDataset
in interfaceDatasetContext
- Throws:
DatasetInstantiationException
-
releaseDataset
- Specified by:
releaseDataset
in interfaceDatasetContext
-
discardDataset
- Specified by:
discardDataset
in interfaceDatasetContext
-
provide
- Specified by:
provide
in interfaceLookupProvider
-