Class VariableCPInstruction
- java.lang.Object
- 
- org.apache.sysds.runtime.instructions.Instruction
- 
- org.apache.sysds.runtime.instructions.cp.CPInstruction
- 
- org.apache.sysds.runtime.instructions.cp.VariableCPInstruction
 
 
 
- 
- All Implemented Interfaces:
- LineageTraceable
 
 public class VariableCPInstruction extends CPInstruction implements LineageTraceable 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classVariableCPInstruction.VariableOperationCode- 
Nested classes/interfaces inherited from class org.apache.sysds.runtime.instructions.cp.CPInstructionCPInstruction.CPType
 - 
Nested classes/interfaces inherited from class org.apache.sysds.runtime.instructions.InstructionInstruction.IType
 
- 
 - 
Field Summary- 
Fields inherited from class org.apache.sysds.runtime.instructions.InstructionDATATYPE_PREFIX, FEDERATED_INST_PREFIX, GPU_INST_PREFIX, INSTRUCTION_DELIM, LITERAL_PREFIX, OPERAND_DELIM, SP_INST_PREFIX, VALUETYPE_PREFIX
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInput(CPOperand input)FileFormatPropertiesgetFormatProperties()CPOperandgetInput(int index)CPOperandgetInput1()CPOperandgetInput2()CPOperandgetInput3()CPOperandgetInput4()List<CPOperand>getInputs()org.apache.commons.lang3.tuple.Pair<String,LineageItem>getLineageItem(ExecutionContext ec)Obtain lineage trace of an instruction with a single output.CPOperandgetOutput()StringgetOutputVariableName()static StringgetUniqueFileName(String fname)VariableCPInstruction.VariableOperationCodegetVariableOpcode()booleanisAssignOrCopyVariable()booleanisAssignVariable()booleanisCreateVariable()booleanisRemoveVariable()booleanisRemoveVariable(String varName)Checks if this instruction is a remove instruction for varNamebooleanisRemoveVariableNoFile()booleanisVariableCastInstruction()static VariableCPInstructionparseInstruction(String str)static InstructionprepareCopyInstruction(String srcVar, String destVar)static InstructionprepareRemoveInstruction(long... varName)static InstructionprepareRemoveInstruction(String... varNames)static InstructionprepCreatevarInstruction(String varName, String fileName, boolean fNameOverride, String format)static InstructionprepCreatevarInstruction(String varName, String fileName, boolean fNameOverride, Types.DataType dt, String format, DataCharacteristics mc, MatrixObject.UpdateType update)static InstructionprepCreatevarInstruction(String varName, String fileName, boolean fNameOverride, Types.DataType dt, String format, DataCharacteristics mc, MatrixObject.UpdateType update, boolean hasHeader, String delim, boolean sparse)static InstructionprepMoveInstruction(String srcVar, String destVar)static InstructionprepMoveInstruction(String srcVar, String destFileName, String format)voidprocessInstruction(ExecutionContext ec)This method should be used to execute the instruction.static voidprocessRmvarInstruction(ExecutionContext ec, String varname)Remove variable instruction externalized as a static function in order to allow various cleanup procedures to use the same codepath as the actual rmVar instructionvoidupdateInstructionThreadID(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- 
Methods inherited from class org.apache.sysds.runtime.instructions.cp.CPInstructiongetCPInstructionType, getGraphString, getType, postprocessInstruction, preprocessInstruction, requiresLabelUpdate, updateLabels
 - 
Methods inherited from class org.apache.sysds.runtime.instructions.InstructiongetBeginColumn, getBeginLine, getEndColumn, getEndLine, getExtendedOpcode, getFilename, getInstID, getInstructionString, getLineNum, getOpcode, getOperator, getPrivacyConstraint, printMe, setInstID, setLocation, setLocation, setLocation, setLocation, setPrivacyConstraint, setPrivacyConstraint, toString
 - 
Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.apache.sysds.runtime.lineage.LineageTraceablegetLineageItems, hasSingleLineage
 
- 
 
- 
- 
- 
Method Detail- 
isRemoveVariablepublic boolean isRemoveVariable(String varName) Checks if this instruction is a remove instruction for varName- Parameters:
- varName- variable name
- Returns:
- true if rmvar instruction including varName
 
 - 
isRemoveVariableNoFilepublic boolean isRemoveVariableNoFile() 
 - 
isRemoveVariablepublic boolean isRemoveVariable() 
 - 
isAssignVariablepublic boolean isAssignVariable() 
 - 
isAssignOrCopyVariablepublic boolean isAssignOrCopyVariable() 
 - 
isCreateVariablepublic boolean isCreateVariable() 
 - 
getVariableOpcodepublic VariableCPInstruction.VariableOperationCode getVariableOpcode() 
 - 
getFormatPropertiespublic FileFormatProperties getFormatProperties() 
 - 
getInput1public CPOperand getInput1() 
 - 
getInput2public CPOperand getInput2() 
 - 
getInput3public CPOperand getInput3() 
 - 
getInput4public CPOperand getInput4() 
 - 
getInputpublic CPOperand getInput(int index) 
 - 
addInputpublic void addInput(CPOperand input) 
 - 
getOutputVariableNamepublic String getOutputVariableName() 
 - 
getOutputpublic CPOperand getOutput() 
 - 
parseInstructionpublic static VariableCPInstruction parseInstruction(String str) 
 - 
processInstructionpublic void processInstruction(ExecutionContext ec) Description copied from class:InstructionThis method should be used to execute the instruction.- Specified by:
- processInstructionin class- CPInstruction
- Parameters:
- ec- execution context
 
 - 
processRmvarInstructionpublic static void processRmvarInstruction(ExecutionContext ec, String varname) Remove variable instruction externalized as a static function in order to allow various cleanup procedures to use the same codepath as the actual rmVar instruction- Parameters:
- ec- execution context
- varname- variable name
 
 - 
prepareRemoveInstructionpublic static Instruction prepareRemoveInstruction(long... varName) 
 - 
prepareRemoveInstructionpublic static Instruction prepareRemoveInstruction(String... varNames) 
 - 
prepareCopyInstructionpublic static Instruction prepareCopyInstruction(String srcVar, String destVar) 
 - 
prepMoveInstructionpublic static Instruction prepMoveInstruction(String srcVar, String destFileName, String format) 
 - 
prepMoveInstructionpublic static Instruction prepMoveInstruction(String srcVar, String destVar) 
 - 
prepCreatevarInstructionpublic static Instruction prepCreatevarInstruction(String varName, String fileName, boolean fNameOverride, String format) 
 - 
prepCreatevarInstructionpublic static Instruction prepCreatevarInstruction(String varName, String fileName, boolean fNameOverride, Types.DataType dt, String format, DataCharacteristics mc, MatrixObject.UpdateType update) 
 - 
prepCreatevarInstructionpublic static Instruction prepCreatevarInstruction(String varName, String fileName, boolean fNameOverride, Types.DataType dt, String format, DataCharacteristics mc, MatrixObject.UpdateType update, boolean hasHeader, String delim, boolean sparse) 
 - 
updateInstructionThreadIDpublic void updateInstructionThreadID(String pattern, String replace) Description copied from class:InstructionAll 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- Overrides:
- updateInstructionThreadIDin class- Instruction
- Parameters:
- pattern- ?
- replace- ?
 
 - 
getLineageItempublic org.apache.commons.lang3.tuple.Pair<String,LineageItem> getLineageItem(ExecutionContext ec) Description copied from interface:LineageTraceableObtain lineage trace of an instruction with a single output.- Specified by:
- getLineageItemin interface- LineageTraceable
- Parameters:
- ec- execution context w/ live variables
- Returns:
- pair of (output variable name, output lineage item)
 
 - 
isVariableCastInstructionpublic boolean isVariableCastInstruction() 
 
- 
 
-