public abstract class BatchContextImpl extends java.lang.Object implements BatchContext
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_SCHEMA_FIELD_NAME |
static java.lang.String |
DEFAULT_SCHEMA_RECORD_NAME |
protected InputFormatProvider |
inputFormatProvider
This should be set after
SubmitterLifecycle.prepareRun(Object) call with passing this
context object as a param. |
protected OutputFormatProvider |
outputFormatProvider
This should be set after
SubmitterLifecycle.prepareRun(Object) call with passing this
context object as a param. |
protected java.util.Map<java.lang.String,java.lang.String> |
settableArguments
This should be set after
SubmitterLifecycle.prepareRun(Object) call with passing this
context object as a param. |
Constructor and Description |
---|
BatchContextImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addProperties(MetadataEntity metadataEntity,
java.util.Map<java.lang.String,java.lang.String> properties) |
void |
addTags(MetadataEntity metadataEntity,
java.lang.Iterable<java.lang.String> tags) |
void |
addTags(MetadataEntity metadataEntity,
java.lang.String... tags) |
void |
createDataset(java.lang.String datasetName,
java.lang.String typeName,
DatasetProperties properties) |
boolean |
datasetExists(java.lang.String datasetName) |
void |
discardDataset(Dataset dataset) |
SettableArguments |
getArguments() |
<T extends Dataset> |
getDataset(java.lang.String name) |
<T extends Dataset> |
getDataset(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> arguments) |
<T extends Dataset> |
getDataset(java.lang.String namespace,
java.lang.String name) |
<T extends Dataset> |
getDataset(java.lang.String namespace,
java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> arguments) |
FailureCollector |
getFailureCollector() |
InputFormatProvider |
getInputFormatProvider() |
io.cdap.cdap.api.data.schema.Schema |
getInputSchema() |
java.util.Map<java.lang.String,io.cdap.cdap.api.data.schema.Schema> |
getInputSchemas() |
long |
getLogicalStartTime() |
java.util.Map<MetadataScope,Metadata> |
getMetadata(MetadataEntity metadataEntity) |
Metadata |
getMetadata(MetadataScope scope,
MetadataEntity metadataEntity) |
StageMetrics |
getMetrics() |
java.lang.String |
getNamespace() |
OutputFormatProvider |
getOutputFormatProvider() |
java.util.Map<java.lang.String,io.cdap.cdap.api.data.schema.Schema> |
getOutputPortSchemas() |
io.cdap.cdap.api.data.schema.Schema |
getOutputSchema() |
java.lang.String |
getPipelineName() |
PluginProperties |
getPluginProperties() |
PluginProperties |
getPluginProperties(java.lang.String pluginId) |
java.net.URL |
getServiceURL(java.lang.String serviceId) |
java.net.URL |
getServiceURL(java.lang.String applicationId,
java.lang.String serviceId) |
java.lang.String |
getStageName() |
<T> java.lang.Class<T> |
loadPluginClass(java.lang.String pluginId) |
<T> T |
newPluginInstance(java.lang.String pluginId) |
<T> Lookup<T> |
provide(java.lang.String table,
java.util.Map<java.lang.String,java.lang.String> arguments) |
void |
record(java.util.List<FieldOperation> fieldOperations) |
void |
releaseDataset(Dataset dataset) |
void |
removeMetadata(MetadataEntity metadataEntity) |
void |
removeProperties(MetadataEntity metadataEntity) |
void |
removeProperties(MetadataEntity metadataEntity,
java.lang.String... keys) |
void |
removeTags(MetadataEntity metadataEntity) |
void |
removeTags(MetadataEntity metadataEntity,
java.lang.String... tags) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getInputStages
getServiceURL, openConnection
public static final java.lang.String DEFAULT_SCHEMA_FIELD_NAME
public static final java.lang.String DEFAULT_SCHEMA_RECORD_NAME
protected InputFormatProvider inputFormatProvider
SubmitterLifecycle.prepareRun(Object)
call with passing this
context object as a param.protected OutputFormatProvider outputFormatProvider
SubmitterLifecycle.prepareRun(Object)
call with passing this
context object as a param.protected java.util.Map<java.lang.String,java.lang.String> settableArguments
SubmitterLifecycle.prepareRun(Object)
call with passing this
context object as a param.public InputFormatProvider getInputFormatProvider()
public OutputFormatProvider getOutputFormatProvider()
public java.lang.String getStageName()
getStageName
in interface StageContext
public java.lang.String getNamespace()
getNamespace
in interface StageContext
public java.lang.String getPipelineName()
getPipelineName
in interface StageContext
public long getLogicalStartTime()
getLogicalStartTime
in interface StageContext
public StageMetrics getMetrics()
getMetrics
in interface StageContext
public PluginProperties getPluginProperties()
getPluginProperties
in interface StageContext
public PluginProperties getPluginProperties(java.lang.String pluginId)
getPluginProperties
in interface StageContext
public <T> java.lang.Class<T> loadPluginClass(java.lang.String pluginId)
loadPluginClass
in interface StageContext
public <T> T newPluginInstance(java.lang.String pluginId) throws java.lang.InstantiationException
newPluginInstance
in interface StageContext
java.lang.InstantiationException
public io.cdap.cdap.api.data.schema.Schema getInputSchema()
getInputSchema
in interface StageContext
@Nullable public java.util.Map<java.lang.String,io.cdap.cdap.api.data.schema.Schema> getInputSchemas()
getInputSchemas
in interface StageContext
public io.cdap.cdap.api.data.schema.Schema getOutputSchema()
getOutputSchema
in interface StageContext
public java.util.Map<java.lang.String,io.cdap.cdap.api.data.schema.Schema> getOutputPortSchemas()
getOutputPortSchemas
in interface StageContext
public void createDataset(java.lang.String datasetName, java.lang.String typeName, DatasetProperties properties) throws DatasetManagementException
createDataset
in interface BatchContext
DatasetManagementException
public boolean datasetExists(java.lang.String datasetName) throws DatasetManagementException
datasetExists
in interface BatchContext
DatasetManagementException
public SettableArguments getArguments()
getArguments
in interface BatchContext
getArguments
in interface StageContext
public FailureCollector getFailureCollector()
getFailureCollector
in interface StageContext
@Nullable public java.net.URL getServiceURL(java.lang.String applicationId, java.lang.String serviceId)
getServiceURL
in interface ServiceDiscoverer
@Nullable public java.net.URL getServiceURL(java.lang.String serviceId)
getServiceURL
in interface ServiceDiscoverer
public java.util.Map<MetadataScope,Metadata> getMetadata(MetadataEntity metadataEntity) throws MetadataException
getMetadata
in interface MetadataReader
MetadataException
public Metadata getMetadata(MetadataScope scope, MetadataEntity metadataEntity) throws MetadataException
getMetadata
in interface MetadataReader
MetadataException
public void addProperties(MetadataEntity metadataEntity, java.util.Map<java.lang.String,java.lang.String> properties)
addProperties
in interface MetadataWriter
public void addTags(MetadataEntity metadataEntity, java.lang.String... tags)
addTags
in interface MetadataWriter
public void addTags(MetadataEntity metadataEntity, java.lang.Iterable<java.lang.String> tags)
addTags
in interface MetadataWriter
public void removeMetadata(MetadataEntity metadataEntity)
removeMetadata
in interface MetadataWriter
public void removeProperties(MetadataEntity metadataEntity)
removeProperties
in interface MetadataWriter
public void removeProperties(MetadataEntity metadataEntity, java.lang.String... keys)
removeProperties
in interface MetadataWriter
public void removeTags(MetadataEntity metadataEntity)
removeTags
in interface MetadataWriter
public void removeTags(MetadataEntity metadataEntity, java.lang.String... tags)
removeTags
in interface MetadataWriter
public void record(java.util.List<FieldOperation> fieldOperations)
record
in interface LineageRecorder
public <T extends Dataset> T getDataset(java.lang.String name) throws DatasetInstantiationException
getDataset
in interface DatasetContext
DatasetInstantiationException
public <T extends Dataset> T getDataset(java.lang.String namespace, java.lang.String name) throws DatasetInstantiationException
getDataset
in interface DatasetContext
DatasetInstantiationException
public <T extends Dataset> T getDataset(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> arguments) throws DatasetInstantiationException
getDataset
in interface DatasetContext
DatasetInstantiationException
public <T extends Dataset> T getDataset(java.lang.String namespace, java.lang.String name, java.util.Map<java.lang.String,java.lang.String> arguments) throws DatasetInstantiationException
getDataset
in interface DatasetContext
DatasetInstantiationException
public void releaseDataset(Dataset dataset)
releaseDataset
in interface DatasetContext
public void discardDataset(Dataset dataset)
discardDataset
in interface DatasetContext
public <T> Lookup<T> provide(java.lang.String table, java.util.Map<java.lang.String,java.lang.String> arguments)
provide
in interface LookupProvider