public class MRJobInstruction extends Instruction
Instruction.IType
beginCol, beginLine, DATATYPE_PREFIX, endCol, endLine, filename, GPU_INST_PREFIX, instOpcode, INSTRUCTION_DELIM, instString, LITERAL_PREFIX, LOG, OPERAND_DELIM, SP_INST_PREFIX, VALUETYPE_PREFIX
Constructor and Description |
---|
MRJobInstruction(org.apache.sysml.lops.compile.JobType type) |
MRJobInstruction(MRJobInstruction that)
(deep) Copy constructor, primarily used in parfor.
|
Modifier and Type | Method and Description |
---|---|
org.apache.sysml.runtime.controlprogram.caching.MatrixObject[] |
extractInputMatrices(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec)
Extracts input variables with MATRIX data type, and stores references to
corresponding matrix objects in
inputMatrices . |
org.apache.sysml.runtime.controlprogram.caching.MatrixObject[] |
extractOutputMatrices(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec)
Extracts MatrixObject references to output variables, all of which will be
of MATRIX data type, and stores them in
outputMatrices . |
boolean |
findMRInstructions(int lineNum)
Search whether or not this MR job contains at least one
MR instruction with specified line number parameter
|
int[] |
getBclens() |
int[] |
getBrlens() |
long[] |
getClens() |
String |
getDimsUnknownFilePrefix() |
String |
getGraphString() |
InputInfo[] |
getInputInfos() |
org.apache.sysml.runtime.controlprogram.caching.MatrixObject[] |
getInputMatrices() |
String[] |
getInputs() |
String[] |
getInputVars() |
String |
getIv_aggInstructions() |
String |
getIv_instructionsInMapper() |
int |
getIv_numReducers() |
String |
getIv_otherInstructions() |
String |
getIv_randInstructions() |
String |
getIv_recordReaderInstructions() |
int |
getIv_replication() |
byte[] |
getIv_resultIndices() |
String |
getIv_shuffleInstructions() |
org.apache.sysml.lops.compile.JobType |
getJobType() |
double |
getMemoryRequirements() |
ArrayList<Integer> |
getMRJobInstructionsLineNumbers()
Getter for MRJobInstructionslineNumbers
|
String |
getMRString(boolean debug)
Method for displaying MR instructions interspersed with source code
ONLY USED IN DEBUG MODE
|
OutputInfo[] |
getOutputInfos() |
org.apache.sysml.runtime.controlprogram.caching.MatrixObject[] |
getOutputMatrices() |
String[] |
getOutputs() |
String[] |
getOutputVars() |
boolean[] |
getPartitioned() |
org.apache.sysml.runtime.controlprogram.ParForProgramBlock.PDataPartitionFormat[] |
getPformats() |
int[] |
getPsizes() |
long[] |
getRlens() |
String |
getString(byte[] arr) |
Instruction.IType |
getType() |
boolean |
isMapOnly() |
boolean |
isMergableMRJobInstruction(MRJobInstruction that) |
void |
mergeMRJobInstruction(MRJobInstruction that) |
void |
printCompleteMRJobInstruction(MatrixCharacteristics[] resultStats) |
void |
printMe() |
void |
processInstruction(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec)
This method should be used to execute the instruction.
|
void |
setAggregateInstructionsInReducer(String aggInstructions) |
void |
setDimsUnknownFilePrefix(String prefix) |
void |
setGMRInstructions(String[] inLabels,
String recordReaderInstructions,
String mapperInstructions,
String aggInstructions,
String otherInstructions,
String[] outLabels,
byte[] resultIndex,
int numReducers,
int replication) |
void |
setInputOutputLabels(String[] inputLabels,
String[] outputLabels)
Method to set input and output labels for a MapReduce instruction.
|
void |
setIv_aggInstructions(String inst) |
void |
setIv_instructionsInMapper(String inst) |
void |
setIv_otherInstructions(String inst) |
void |
setIv_randInstructions(String inst) |
void |
setIv_recordReaderInstructions(String inst) |
void |
setIv_shuffleInstructions(String inst) |
void |
setMapperInstructions(String mapperInstructions) |
void |
setMemoryRequirements(double mem) |
void |
setMRJobInstructionsLineNumbers(ArrayList<Integer> MRJobLineNumbers)
Setter for MRJobInstructionslineNumbers field
|
void |
setNumberOfReducers(int numReducers)
Method to set the number of reducers for a MapReducer instruction.
|
void |
setOtherInstructionsInReducer(String otherInstructions) |
void |
setOutputs(byte[] outputIndices)
Method to set outputs (output indices) for a MapReduce instruction.
|
void |
setPartitioned(boolean[] partitioned) |
void |
setPformats(org.apache.sysml.runtime.controlprogram.ParForProgramBlock.PDataPartitionFormat[] pformats) |
void |
setPsizes(int[] psizes) |
void |
setRandInstructions(String randInstructions) |
void |
setReBlockInstructions(String[] inLabels,
String mapperInstructions,
String reblockInstructions,
String otherInstructions,
String[] outLabels,
byte[] resultIndex,
int numReducers,
int replication) |
void |
setRecordReaderInstructions(String rrInstructions) |
void |
setReplication(int replication)
Method to set the replication factor for outputs produced from a MapReduce instruction.
|
void |
setShuffleInstructions(String shuffleInstructions) |
String |
toString() |
void |
updateInstructionThreadID(String pattern,
String replace)
All instructions that have thread-specific filenames or names encoded in it
should overwrite this method in order to update (1) the in-memory instruction
and (2) the instruction string
|
getBeginColumn, getBeginLine, getEndColumn, getEndLine, getExtendedOpcode, getFilename, getInstID, getLineNum, getOpcode, postprocessInstruction, preprocessInstruction, requiresLabelUpdate, setInstID, setLocation, setLocation, setLocation, setLocation
public MRJobInstruction(org.apache.sysml.lops.compile.JobType type)
public MRJobInstruction(MRJobInstruction that) throws IllegalArgumentException, IllegalAccessException
srcPattern
with targetPattern
that
- MR job instructionIllegalArgumentException
- if IllegalArgumentException occursIllegalAccessException
- if IllegalAccessException occurspublic Instruction.IType getType()
getType
in class Instruction
public org.apache.sysml.lops.compile.JobType getJobType()
public String getIv_instructionsInMapper()
public void setIv_instructionsInMapper(String inst)
public String getIv_recordReaderInstructions()
public void setIv_recordReaderInstructions(String inst)
public String getIv_randInstructions()
public void setIv_randInstructions(String inst)
public String getIv_shuffleInstructions()
public void setIv_shuffleInstructions(String inst)
public String getIv_aggInstructions()
public void setIv_aggInstructions(String inst)
public String getIv_otherInstructions()
public void setIv_otherInstructions(String inst)
public byte[] getIv_resultIndices()
public int getIv_numReducers()
public int getIv_replication()
public double getMemoryRequirements()
public void setMemoryRequirements(double mem)
public String getDimsUnknownFilePrefix()
public void setDimsUnknownFilePrefix(String prefix)
public String[] getInputVars()
public String[] getOutputVars()
public ArrayList<Integer> getMRJobInstructionsLineNumbers()
public void setOutputs(byte[] outputIndices)
outputIndices
- output indicespublic void setNumberOfReducers(int numReducers)
numReducers
- number of reducerspublic void setReplication(int replication)
replication
- replication factorpublic void setInputOutputLabels(String[] inputLabels, String[] outputLabels)
inputLabels
- input labelsoutputLabels
- output labelspublic void setRecordReaderInstructions(String rrInstructions)
public void setMapperInstructions(String mapperInstructions)
public void setShuffleInstructions(String shuffleInstructions)
public void setAggregateInstructionsInReducer(String aggInstructions)
public void setOtherInstructionsInReducer(String otherInstructions)
public void setRandInstructions(String randInstructions)
public void setMRJobInstructionsLineNumbers(ArrayList<Integer> MRJobLineNumbers)
MRJobLineNumbers
- Line numbers for each instruction in this MRJobpublic void setGMRInstructions(String[] inLabels, String recordReaderInstructions, String mapperInstructions, String aggInstructions, String otherInstructions, String[] outLabels, byte[] resultIndex, int numReducers, int replication)
public void setReBlockInstructions(String[] inLabels, String mapperInstructions, String reblockInstructions, String otherInstructions, String[] outLabels, byte[] resultIndex, int numReducers, int replication)
public boolean findMRInstructions(int lineNum)
lineNum
- Line number in DML scriptpublic String getString(byte[] arr)
public String toString()
toString
in class Instruction
public String getMRString(boolean debug)
debug
- Flag for displaying instructions in debugger test integrationpublic void printMe()
printMe
in class Instruction
public String getGraphString()
getGraphString
in class Instruction
public boolean isMapOnly()
public String[] getInputs()
public InputInfo[] getInputInfos()
public long[] getRlens()
public long[] getClens()
public int[] getBrlens()
public int[] getBclens()
public String[] getOutputs()
public OutputInfo[] getOutputInfos()
public org.apache.sysml.runtime.controlprogram.caching.MatrixObject[] getInputMatrices()
public boolean[] getPartitioned()
public void setPartitioned(boolean[] partitioned)
public org.apache.sysml.runtime.controlprogram.ParForProgramBlock.PDataPartitionFormat[] getPformats()
public void setPformats(org.apache.sysml.runtime.controlprogram.ParForProgramBlock.PDataPartitionFormat[] pformats)
public int[] getPsizes()
public void setPsizes(int[] psizes)
public org.apache.sysml.runtime.controlprogram.caching.MatrixObject[] extractInputMatrices(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec)
inputMatrices
. Also, stores
the data types in inputDataTypes
.ec
- execution contextpublic org.apache.sysml.runtime.controlprogram.caching.MatrixObject[] getOutputMatrices()
public org.apache.sysml.runtime.controlprogram.caching.MatrixObject[] extractOutputMatrices(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec)
outputMatrices
. Also,
populates auxiliary data structures.ec
- execution contextpublic void printCompleteMRJobInstruction(MatrixCharacteristics[] resultStats)
public void updateInstructionThreadID(String pattern, String replace)
Instruction
updateInstructionThreadID
in class Instruction
pattern
- ?replace
- ?public boolean isMergableMRJobInstruction(MRJobInstruction that)
public void mergeMRJobInstruction(MRJobInstruction that)
public void processInstruction(org.apache.sysml.runtime.controlprogram.context.ExecutionContext ec)
Instruction
processInstruction
in class Instruction
ec
- execution contextCopyright © 2018 The Apache Software Foundation. All rights reserved.