public class TSetContext
extends java.lang.Object
implements java.io.Serializable
TSet
. This
holds the information related to indices, inputs etc. This will be passed on to
TFunction
in the runtime, so that corresponding TSet
information is available for the functions.
This is made Serializable
because, it will be created with instances of
BaseOp
and it would need to be serialized and deserialized to
create TaskInstances.
Constructor and Description |
---|
TSetContext()
Creates and empty TSet Context
|
TSetContext(Config cfg,
int tSetIndex,
java.lang.String tSetId,
java.lang.String tSetName,
int parallelism,
int wId,
java.util.Map<java.lang.String,java.lang.Object> configs)
TSet context
|
Modifier and Type | Method and Description |
---|---|
void |
addInput(java.lang.String key,
DataPartition<?> data)
Adds a input object into the map
|
void |
addInputMap(java.util.Map<java.lang.String,DataPartition<?>> map)
Adds the given map into
inputMap |
Config |
getConfig()
Configuration
|
java.lang.Object |
getConfig(java.lang.String name)
Get a configuration with a name
|
java.util.Map<java.lang.String,java.lang.Object> |
getConfigurations()
Get the tSet specific configurations
|
java.lang.String |
getId()
tSet id
|
int |
getIndex()
The tSet index
|
DataPartition<?> |
getInput(java.lang.String key)
Retrives the input object that corresponds to the given key
|
java.util.Map<java.lang.String,DataPartition<?>> |
getInputMap()
get the complete input map
|
Schema |
getInputSchema()
Returns the input schema of the
TSet |
java.lang.String |
getName()
Name of the tSet
|
Schema |
getOutputSchema()
Returns the output schema of the
TSet |
int |
getParallelism()
Get the parallelism of the tSet
|
int |
getWorkerId()
Get the worker id this tSet is running
|
void |
setId(java.lang.String id)
Sets the ID of the corresponding TSet
|
void |
setInputMap(java.util.Map<java.lang.String,DataPartition<?>> inputMap)
Set a new input map
|
void |
setName(java.lang.String name)
Sets the tset name
|
void |
setParallelism(int parallelism)
Sets the TSet parallelism
|
void |
updateRuntimeInfo(Config conf,
TaskContext taskCtx)
Updates the runtime information for the TSet instances
|
public TSetContext()
public TSetContext(Config cfg, int tSetIndex, java.lang.String tSetId, java.lang.String tSetName, int parallelism, int wId, java.util.Map<java.lang.String,java.lang.Object> configs)
cfg
- configurationtSetIndex
- indextSetId
- idtSetName
- nameparallelism
- parallelismwId
- worker idconfigs
- configurationpublic int getIndex()
public java.lang.String getId()
public java.lang.String getName()
public int getParallelism()
public int getWorkerId()
public java.util.Map<java.lang.String,java.lang.Object> getConfigurations()
public java.lang.Object getConfig(java.lang.String name)
name
- name of the configpublic Config getConfig()
public java.util.Map<java.lang.String,DataPartition<?>> getInputMap()
public DataPartition<?> getInput(java.lang.String key)
key
- key of the input objectpublic Schema getInputSchema()
TSet
public Schema getOutputSchema()
TSet
public void addInput(java.lang.String key, DataPartition<?> data)
key
- the key to be associated with the input objectdata
- the input objectpublic void setInputMap(java.util.Map<java.lang.String,DataPartition<?>> inputMap)
inputMap
- the map to be set for this contextpublic void addInputMap(java.util.Map<java.lang.String,DataPartition<?>> map)
inputMap
map
- the map to be addedpublic void setId(java.lang.String id)
id
- tset IDpublic void setName(java.lang.String name)
name
- tset namepublic void setParallelism(int parallelism)
parallelism
- parallelismpublic void updateRuntimeInfo(Config conf, TaskContext taskCtx)
conf
- configurationtaskCtx
- task context