You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by de...@apache.org on 2016/11/14 23:28:37 UTC
[4/5] incubator-systemml git commit: [SYSTEMML-842] Javadoc cleanup
in runtime compress and controlprogram packages
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlock.java
index d01b444..f01c049 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlock.java
@@ -85,8 +85,11 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
* functions. Remaining parameters will just be passed to constructor for
* function program block.
*
- * @param eFuncStat
- * @throws DMLRuntimeException
+ * @param prog runtime program
+ * @param inputParams list of input data identifiers
+ * @param outputParams list of output data indentifiers
+ * @param baseDir base directory
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
protected ExternalFunctionProgramBlock(Program prog,
ArrayList<DataIdentifier> inputParams,
@@ -136,18 +139,14 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
* by the external function program block.
*
*
- * @param id
+ * @param id this field does nothing
*/
private void changeTmpOutput( long id )
{
ArrayList<DataIdentifier> outputParams = getOutputParams();
cell2BlockInst = getCell2BlockInstructions(outputParams, _blockedFileNames);
}
-
- /**
- *
- * @return
- */
+
public String getBaseDir()
{
return _baseDir;
@@ -156,7 +155,6 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
/**
* Method to be invoked to execute instructions for the external function
* invocation
- * @throws DMLRuntimeException
*/
@Override
public void execute(ExecutionContext ec)
@@ -234,8 +232,8 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
* Given a list of parameters as data identifiers, returns a string
* representation.
*
- * @param params
- * @return
+ * @param params list of data identifiers
+ * @return parameter string
*/
protected String getParameterString(ArrayList<DataIdentifier> params) {
String parameterString = "";
@@ -274,7 +272,7 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
}
/**
- * method to get instructions
+ * method to create instructions
*/
protected void createInstructions() {
@@ -317,9 +315,10 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
/**
* Method to generate a reblock job to convert the cell representation into block representation
- * @param outputParams
- * @param blockedFileNames
- * @return
+ *
+ * @param outputParams list out output data identifiers
+ * @param blockedFileNames map of blocked file names
+ * @return list of instructions
*/
private ArrayList<Instruction> getCell2BlockInstructions(
ArrayList<DataIdentifier> outputParams,
@@ -438,8 +437,9 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
* Method to generate instructions to convert input matrices from block to
* cell. We generate a GMR job here.
*
- * @param inputParams
- * @return
+ * @param inputParams list of data identifiers
+ * @param unBlockedFileNames map of unblocked file names
+ * @return list of instructions
*/
private ArrayList<Instruction> getBlock2CellInstructions(
ArrayList<DataIdentifier> inputParams,
@@ -564,9 +564,9 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
/**
* Method to execute an external function invocation instruction.
*
- * @param ec
- * @param inst
- * @throws DMLRuntimeException
+ * @param ec execution context
+ * @param inst external function invocation instructions
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
@SuppressWarnings("unchecked")
public void executeInstruction(ExecutionContext ec, ExternalFunctionInvocationInstruction inst)
@@ -612,9 +612,10 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
/**
* Method to verify that function outputs match with declared outputs
*
- * @param returnFunc
- * @param outputParams
- * @throws DMLRuntimeException
+ * @param ec execution context
+ * @param returnFunc package function
+ * @param outputParams output parameters
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
protected void verifyAndAttachOutputs(ExecutionContext ec, PackageFunction returnFunc,
String outputParams) throws DMLRuntimeException {
@@ -724,8 +725,8 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
/**
* Method to get string representation of scalar value type
*
- * @param scalarType
- * @return
+ * @param scalarType scalar value type
+ * @return scalar value type string
*/
protected String getScalarValueTypeString(ScalarValueType scalarType) {
if (scalarType.equals(ScalarValueType.Text))
@@ -737,10 +738,9 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
/**
* Method to parse inputs, update labels, and add to package function.
*
- * @param func
- * @param inputParams
- * @param metaData
- * @param variableMapping
+ * @param func package function
+ * @param inputParams input parameters
+ * @param variableMapping local variable map
*/
protected void setupInputs (PackageFunction func, String inputParams, LocalVariableMap variableMapping) {
ArrayList<String> inputs = getParameters(inputParams);
@@ -754,12 +754,10 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
* Method to convert string representation of input into function input
* object.
*
- * @param inputs
- * @param variableMapping
- * @param metaData
- * @return
+ * @param inputs list of inputs
+ * @param variableMapping local variable map
+ * @return list of function parameters
*/
-
protected ArrayList<FunctionParameter> getInputObjects(ArrayList<String> inputs,
LocalVariableMap variableMapping) {
ArrayList<FunctionParameter> inputObjects = new ArrayList<FunctionParameter>();
@@ -812,8 +810,8 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
/**
* Converts string representation of scalar value type to enum type
*
- * @param string
- * @return
+ * @param string scalar value string
+ * @return scalar value type
*/
protected ScalarValueType getScalarValueType(String string) {
if (string.equals("String"))
@@ -825,8 +823,8 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
/**
* Get string representation of matrix value type
*
- * @param t
- * @return
+ * @param t matrix value type
+ * @return matrix value type as string
*/
protected String getMatrixValueTypeString(Matrix.ValueType t) {
return t.toString();
@@ -835,8 +833,8 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
/**
* Converts string representation of matrix value type into enum type
*
- * @param string
- * @return
+ * @param string matrix value type as string
+ * @return matrix value type
*/
protected Matrix.ValueType getMatrixValueType(String string) {
return Matrix.ValueType.valueOf(string);
@@ -846,8 +844,8 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
* Method to break the comma separated input parameters into an arraylist of
* parameters
*
- * @param inputParams
- * @return
+ * @param inputParams input parameters
+ * @return list of string inputs
*/
protected ArrayList<String> getParameters(String inputParams) {
ArrayList<String> inputs = new ArrayList<String>();
@@ -863,8 +861,8 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
/**
* Get string representation for data type
*
- * @param d
- * @return
+ * @param d data type
+ * @return string representation of data type
*/
protected String getDataTypeString(DataType d) {
if (d.equals(DataType.MATRIX))
@@ -880,10 +878,10 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
}
/**
- * Method to get string representation of data type.
+ * Method to get string representation of function parameter type.
*
- * @param t
- * @return
+ * @param t function parameter type
+ * @return function parameter type as string
*/
protected String getFunctionParameterDataTypeString(FunctionParameterType t) {
return t.toString();
@@ -892,8 +890,8 @@ public class ExternalFunctionProgramBlock extends FunctionProgramBlock
/**
* Get string representation of value type
*
- * @param v
- * @return
+ * @param v value type
+ * @return value type string
*/
protected String getValueTypeString(ValueType v) {
if (v.equals(ValueType.DOUBLE))
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlockCP.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlockCP.java b/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlockCP.java
index dac0389..1d7e5dd 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlockCP.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/ExternalFunctionProgramBlockCP.java
@@ -46,7 +46,7 @@ import org.apache.sysml.udf.Matrix;
*
* Furthermore, it extends ExternalFunctionProgramBlock with a base directory in order
* to make it parallelizable, even in case of different JVMs. For this purpose every
- * external function must implement a <SET_BASE_DIR> method.
+ * external function must implement a <SET_BASE_DIR> method.
*
*
*/
@@ -61,8 +61,12 @@ public class ExternalFunctionProgramBlockCP extends ExternalFunctionProgramBlock
* functions. Remaining parameters will just be passed to constructor for
* function program block.
*
- * @param eFuncStat
- * @throws DMLRuntimeException
+ * @param prog runtime program
+ * @param inputParams list of input data identifiers
+ * @param outputParams list of output data identifiers
+ * @param otherParams map of other parameters
+ * @param baseDir base directory
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public ExternalFunctionProgramBlockCP(Program prog,
ArrayList<DataIdentifier> inputParams,
@@ -83,7 +87,6 @@ public class ExternalFunctionProgramBlockCP extends ExternalFunctionProgramBlock
/**
* Method to be invoked to execute instructions for the external function
* invocation
- * @throws DMLRuntimeException
*/
@Override
public void execute(ExecutionContext ec) throws DMLRuntimeException
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/ForProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/ForProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/ForProgramBlock.java
index b45ce37..be7bada 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/ForProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/ForProgramBlock.java
@@ -171,14 +171,6 @@ public class ForProgramBlock extends ProgramBlock
}
}
- /**
- *
- * @param pos
- * @param instructions
- * @param ec
- * @return
- * @throws DMLRuntimeException
- */
protected IntObject executePredicateInstructions( int pos, ArrayList<Instruction> instructions, ExecutionContext ec )
throws DMLRuntimeException
{
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/FunctionProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/FunctionProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/FunctionProgramBlock.java
index 728aeff..cf8e73e 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/FunctionProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/FunctionProgramBlock.java
@@ -124,11 +124,7 @@ public class FunctionProgramBlock extends ProgramBlock
// check return values
checkOutputParameters(ec.getVariables());
}
-
- /**
- *
- * @param vars
- */
+
protected void checkOutputParameters( LocalVariableMap vars )
{
for( DataIdentifier diOut : _outputParams )
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/IfProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/IfProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/IfProgramBlock.java
index 0d77364..d065aa5 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/IfProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/IfProgramBlock.java
@@ -177,13 +177,7 @@ public class IfProgramBlock extends ProgramBlock
throw new DMLRuntimeException(this.printBlockErrorLocation() + "Error evaluating if exit instructions ", e);
}
}
-
- /**
- *
- * @param ec
- * @return
- * @throws DMLRuntimeException
- */
+
private BooleanObject executePredicate(ExecutionContext ec)
throws DMLRuntimeException
{
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/LocalVariableMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/LocalVariableMap.java b/src/main/java/org/apache/sysml/runtime/controlprogram/LocalVariableMap.java
index 51eb669..136850c 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/LocalVariableMap.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/LocalVariableMap.java
@@ -56,11 +56,7 @@ public class LocalVariableMap implements Cloneable
localMap = new HashMap <String, Data>(vars.localMap);
localID = _seq.getNextID();
}
-
- /**
- *
- * @return
- */
+
public Set<String> keySet()
{
return localMap.keySet();
@@ -69,7 +65,7 @@ public class LocalVariableMap implements Cloneable
/**
* Retrieves the data object given its name.
*
- * @param name : the variable name for the data object
+ * @param name the variable name for the data object
* @return the direct reference to the data object
*/
public Data get( String name )
@@ -81,57 +77,36 @@ public class LocalVariableMap implements Cloneable
* Adds a new (name, value) pair to the variable map, or replaces an old pair with
* the same name. Several different variable names may refer to the same value.
*
- * @param name : the variable name for the data value
- * @param val : the data value object (such as envelope)
+ * @param name the variable name for the data value
+ * @param val the data value object (such as envelope)
*/
public void put(String name, Data val)
{
localMap.put( name, val );
}
- /**
- *
- * @param vars
- */
public void putAll( LocalVariableMap vars )
{
if( vars == this || vars == null )
return;
localMap.putAll (vars.localMap);
}
-
- /**
- *
- * @param name
- */
+
public Data remove( String name )
{
return localMap.remove( name );
}
-
- /**
- *
- */
+
public void removeAll()
{
localMap.clear();
}
-
- /**
- *
- * @param d
- * @return
- */
+
public boolean hasReferences( Data d )
{
return localMap.containsValue(d);
}
- /**
- *
- * @param bo
- * @return
- */
public boolean hasReferences( LineageObject bo )
{
for( Data tmpdat : localMap.values() )
@@ -142,13 +117,7 @@ public class LocalVariableMap implements Cloneable
}
return false;
}
-
- /**
- *
- * @param d
- * @param earlyAbort
- * @return
- */
+
public int getNumReferences( Data d, boolean earlyAbort )
{
if ( d == null )
@@ -162,12 +131,7 @@ public class LocalVariableMap implements Cloneable
return refCount;
}
-
- /**
- *
- * @return
- * @throws DMLRuntimeException
- */
+
public String serialize()
throws DMLRuntimeException
{
@@ -184,13 +148,7 @@ public class LocalVariableMap implements Cloneable
return sb.toString();
}
-
- /**
- *
- * @param varStr
- * @return
- * @throws DMLRuntimeException
- */
+
public static LocalVariableMap deserialize(String varStr)
throws DMLRuntimeException
{
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/ParForProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/ParForProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/ParForProgramBlock.java
index 058e46e..91ee79e 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/ParForProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/ParForProgramBlock.java
@@ -113,7 +113,7 @@ import org.apache.sysml.yarn.ropt.YarnClusterAnalyzer;
*
* NEW FUNCTIONALITIES (not for BI 2.0 release)
* TODO: reduction variables (operations: +=, -=, /=, *=, min, max)
- * TODO: papply(A,1:2,FUN) language construct (compiled to ParFOR) via DML function repository => modules OK, but second-order functions required
+ * TODO: papply(A,1:2,FUN) language construct (compiled to ParFOR) via DML function repository => modules OK, but second-order functions required
*
*/
public class ParForProgramBlock extends ForProgramBlock
@@ -154,8 +154,8 @@ public class ParForProgramBlock extends ForProgramBlock
* Note: Robust version of valueOf in order to return NONE without exception
* if misspelled or non-existing and for case-insensitivity.
*
- * @param s
- * @return
+ * @param s data partition format as string
+ * @return data partition format
*/
public static PDataPartitionFormat parsePDataPartitionFormat(String s) {
if (s.equalsIgnoreCase("ROW_WISE"))
@@ -303,9 +303,11 @@ public class ParForProgramBlock extends ForProgramBlock
* ParForProgramBlock constructor. It reads the specified parameter settings, where defaults for non-specified parameters
* have been set in ParForStatementBlock.validate(). Furthermore, it generates the IDs for the ParWorkers.
*
- * @param prog
- * @param iterPred
- * @throws DMLRuntimeException
+ * @param ID parfor program block id
+ * @param prog runtime program
+ * @param iterPredVars ?
+ * @param params map of parameters
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public ParForProgramBlock(int ID, Program prog, String[] iterPredVars, HashMap<String,String> params)
throws DMLRuntimeException
@@ -678,13 +680,13 @@ public class ParForProgramBlock extends ForProgramBlock
* This execution mode allows for arbitrary nested local parallelism and nested invocations of MR jobs. See
* below for details of the realization.
*
- * @param ec
- * @param itervar
- * @param from
- * @param to
- * @param incr
- * @throws DMLRuntimeException
- * @throws InterruptedException
+ * @param ec execution context
+ * @param itervar ?
+ * @param from ?
+ * @param to ?
+ * @param incr ?
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
+ * @throws InterruptedException if InterruptedException occurs
*/
private void executeLocalParFor( ExecutionContext ec, IntObject itervar, IntObject from, IntObject to, IntObject incr )
throws DMLRuntimeException, InterruptedException
@@ -809,17 +811,7 @@ public class ParForProgramBlock extends ForProgramBlock
}
}
}
-
- /**
- *
- * @param ec
- * @param itervar
- * @param from
- * @param to
- * @param incr
- * @throws DMLRuntimeException
- * @throws IOException
- */
+
private void executeRemoteMRParFor( ExecutionContext ec, IntObject itervar, IntObject from, IntObject to, IntObject incr )
throws DMLRuntimeException, IOException
{
@@ -907,17 +899,7 @@ public class ParForProgramBlock extends ForProgramBlock
StatisticMonitor.putPFStat(_ID, Stat.PARFOR_NUMITERS, numExecutedIterations);
}
}
-
- /**
- *
- * @param ec
- * @param itervar
- * @param from
- * @param to
- * @param incr
- * @throws DMLRuntimeException
- * @throws IOException
- */
+
private void executeRemoteMRParForDP( ExecutionContext ec, IntObject itervar, IntObject from, IntObject to, IntObject incr )
throws DMLRuntimeException, IOException
{
@@ -990,16 +972,7 @@ public class ParForProgramBlock extends ForProgramBlock
StatisticMonitor.putPFStat(_ID, Stat.PARFOR_NUMITERS, numExecutedIterations);
}
}
-
- /**
- *
- * @param ec
- * @param itervar
- * @param from
- * @param to
- * @param incr
- * @throws DMLRuntimeException
- */
+
private void executeRemoteSparkParFor(ExecutionContext ec, IntObject itervar, IntObject from, IntObject to, IntObject incr)
throws DMLRuntimeException
{
@@ -1126,12 +1099,7 @@ public class ParForProgramBlock extends ForProgramBlock
StatisticMonitor.putPFStat(_ID, Stat.PARFOR_NUMITERS, numExecutedIterations);
}
}
-
- /**
- *
- * @param ec
- * @throws DMLRuntimeException
- */
+
private void handleDataPartitioning( ExecutionContext ec )
throws DMLRuntimeException
{
@@ -1196,12 +1164,7 @@ public class ParForProgramBlock extends ForProgramBlock
}
}
}
-
- /**
- *
- * @param ec
- * @throws DMLRuntimeException
- */
+
private void handleSparkRepartitioning( ExecutionContext ec )
throws DMLRuntimeException
{
@@ -1213,12 +1176,7 @@ public class ParForProgramBlock extends ForProgramBlock
sec.repartitionAndCacheMatrixObject(var);
}
}
-
- /**
- *
- * @param ec
- * @throws DMLRuntimeException
- */
+
private void handleSparkEagerCaching( ExecutionContext ec )
throws DMLRuntimeException
{
@@ -1233,9 +1191,11 @@ public class ParForProgramBlock extends ForProgramBlock
/**
* Cleanup result variables of parallel workers after result merge.
- * @param in
- * @param out
- * @throws DMLRuntimeException
+ *
+ * @param ec execution context
+ * @param out output matrix
+ * @param in array of input matrix objects
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private void cleanWorkerResultVariables(ExecutionContext ec, MatrixObject out, MatrixObject[] in)
throws DMLRuntimeException
@@ -1255,9 +1215,9 @@ public class ParForProgramBlock extends ForProgramBlock
* NOTE: parfor gives no guarantees on the values of those objects - hence
* we return -1 for sclars and empty matrix objects.
*
- * @param out
- * @param sb
- * @throws DMLRuntimeException
+ * @param out local variable map
+ * @param sb statement block
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private void createEmptyUnscopedVariables( LocalVariableMap out, StatementBlock sb )
throws DMLRuntimeException
@@ -1301,11 +1261,7 @@ public class ParForProgramBlock extends ForProgramBlock
out.put(var, dataObj);
}
}
-
- /**
- *
- * @throws CacheException
- */
+
private void exportMatricesToHDFS( ExecutionContext ec )
throws CacheException
{
@@ -1341,13 +1297,7 @@ public class ParForProgramBlock extends ForProgramBlock
}
}
}
-
- /**
- *
- * @param ec
- * @param varState
- * @throws DMLRuntimeException
- */
+
private void cleanupSharedVariables( ExecutionContext ec, HashMap<String,Boolean> varState )
throws DMLRuntimeException
{
@@ -1381,15 +1331,11 @@ public class ParForProgramBlock extends ForProgramBlock
* anyway on the next write. In case of recycling the deep copies of program blocks are recycled from previous
* executions of this parfor.
*
- *
- * @param pwID
- * @param queue
- * @param ec
- * @return
- * @throws InstantiationException
- * @throws IllegalAccessException
- * @throws DMLRuntimeException
- * @throws CloneNotSupportedException
+ * @param pwID parworker id
+ * @param queue task queue
+ * @param ec execution context
+ * @return local parworker
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private LocalParWorker createParallelWorker(long pwID, LocalTaskQueue<Task> queue, ExecutionContext ec)
throws DMLRuntimeException
@@ -1443,11 +1389,11 @@ public class ParForProgramBlock extends ForProgramBlock
/**
* Creates a new task partitioner according to the specified runtime parameter.
*
- * @param from
- * @param to
- * @param incr
- * @return
- * @throws DMLRuntimeException
+ * @param from ?
+ * @param to ?
+ * @param incr ?
+ * @return task partitioner
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private TaskPartitioner createTaskPartitioner( IntObject from, IntObject to, IntObject incr )
throws DMLRuntimeException
@@ -1493,11 +1439,11 @@ public class ParForProgramBlock extends ForProgramBlock
/**
* Creates a new data partitioner according to the specified runtime parameter.
*
- * @param dpf
- * @param dataPartitioner
- * @param ec
- * @return
- * @throws DMLRuntimeException
+ * @param dpf data partition format
+ * @param dataPartitioner data partitioner
+ * @param ec execution context
+ * @return data partitioner
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private DataPartitioner createDataPartitioner(PDataPartitionFormat dpf, PDataPartitioner dataPartitioner, ExecutionContext ec)
throws DMLRuntimeException
@@ -1533,16 +1479,7 @@ public class ParForProgramBlock extends ForProgramBlock
return dp;
}
-
- /**
- *
- * @param prm
- * @param out
- * @param in
- * @param fname
- * @return
- * @throws DMLRuntimeException
- */
+
private ResultMerge createResultMerge( PResultMerge prm, MatrixObject out, MatrixObject[] in, String fname, ExecutionContext ec )
throws DMLRuntimeException
{
@@ -1593,9 +1530,9 @@ public class ParForProgramBlock extends ForProgramBlock
* Recompile program block hierarchy to forced CP if MR instructions or functions.
* Returns true if recompile was necessary and possible
*
- * @param tid
- * @return
- * @throws DMLRuntimeException
+ * @param tid thread id
+ * @return true if recompile was necessary and possible
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
private boolean checkMRAndRecompileToCP(long tid)
throws DMLRuntimeException
@@ -1616,28 +1553,14 @@ public class ParForProgramBlock extends ForProgramBlock
Recompiler.recompileProgramBlockHierarchy2Forced(_childBlocks, tid, fnStack, ExecType.CP);
return true;
}
-
- /**
- *
- * @param tid
- * @throws DMLRuntimeException
- */
+
private void releaseForcedRecompile(long tid)
throws DMLRuntimeException
{
HashSet<String> fnStack = new HashSet<String>();
Recompiler.recompileProgramBlockHierarchy2Forced(_childBlocks, tid, fnStack, null);
}
-
-
- /**
- *
- * @param fname
- * @param tasks
- * @return
- * @throws DMLRuntimeException
- * @throws IOException
- */
+
private String writeTasksToFile(String fname, List<Task> tasks, int maxDigits)
throws DMLRuntimeException, IOException
{
@@ -1668,15 +1591,7 @@ public class ParForProgramBlock extends ForProgramBlock
return fname;
}
-
- /**
- *
- * @param fname
- * @param queue
- * @return
- * @throws DMLRuntimeException
- * @throws IOException
- */
+
private String writeTasksToFile(String fname, LocalTaskQueue<Task> queue, int maxDigits)
throws DMLRuntimeException, IOException
{
@@ -1715,16 +1630,7 @@ public class ParForProgramBlock extends ForProgramBlock
String ret = t.toCompactString(maxDigits) + (flagFirst?" ":"") + "\n";
return ret;
}
-
- /**
- *
- * @param expIters
- * @param expTasks
- * @param numIters
- * @param numTasks
- * @param results
- * @throws DMLRuntimeException
- */
+
private void consolidateAndCheckResults(ExecutionContext ec, long expIters, long expTasks, long numIters, long numTasks, LocalVariableMap [] results)
throws DMLRuntimeException
{
@@ -1821,7 +1727,7 @@ public class ParForProgramBlock extends ForProgramBlock
*
* TODO The optimizer should explicitly decide about parallel result merge and its degree of parallelism.
*
- * @return
+ * @return true if ?
*/
private boolean checkParallelRemoteResultMerge()
{
@@ -1830,11 +1736,7 @@ public class ParForProgramBlock extends ForProgramBlock
&& ( _resultMerge == PResultMerge.REMOTE_MR
||_resultMerge == PResultMerge.REMOTE_SPARK) );
}
-
- /**
- *
- * @param IDPrefix
- */
+
private void setParForProgramBlockIDs(int IDPrefix)
{
_IDPrefix = IDPrefix;
@@ -1869,24 +1771,11 @@ public class ParForProgramBlock extends ForProgramBlock
}
}
- /**
- *
- * @param from
- * @param to
- * @param incr
- */
private long computeNumIterations( IntObject from, IntObject to, IntObject incr )
{
return (long)Math.ceil(((double)(to.getLongValue() - from.getLongValue() + 1)) / incr.getLongValue());
}
-
- /**
- *
- * @param iterVarName
- * @param from
- * @param to
- * @param incr
- */
+
private void updateIterablePredicateVars(String iterVarName, IntObject from, IntObject to, IntObject incr)
{
_numIterations = computeNumIterations(from, to, incr);
@@ -1900,10 +1789,7 @@ public class ParForProgramBlock extends ForProgramBlock
_iterablePredicateVars[2] = to.getStringValue();
_iterablePredicateVars[3] = incr.getStringValue();
}
-
- /**
- *
- */
+
private void resetIterablePredicateVars()
{
//reset of modified for optimization (opt!=NONE)
@@ -1915,7 +1801,7 @@ public class ParForProgramBlock extends ForProgramBlock
* NOTE: Only required for remote parfor. Hence, there is no need to transfer DMLConfig to
* the remote workers (MR job) since nested remote parfor is not supported.
*
- * @return
+ * @return task file name
*/
private String constructTaskFileName()
{
@@ -1935,7 +1821,7 @@ public class ParForProgramBlock extends ForProgramBlock
* NOTE: Only required for remote parfor. Hence, there is no need to transfer DMLConfig to
* the remote workers (MR job) since nested remote parfor is not supported.
*
- * @return
+ * @return result file name
*/
private String constructResultFileName()
{
@@ -1951,10 +1837,6 @@ public class ParForProgramBlock extends ForProgramBlock
return sb.toString();
}
- /**
- *
- * @return
- */
private String constructResultMergeFileName()
{
String scratchSpaceLoc = ConfigurationManager.getScratchSpace();
@@ -1972,11 +1854,7 @@ public class ParForProgramBlock extends ForProgramBlock
return sb.toString();
}
-
- /**
- *
- * @return
- */
+
private String constructDataPartitionsFileName()
{
String scratchSpaceLoc = ConfigurationManager.getScratchSpace();
@@ -1995,10 +1873,6 @@ public class ParForProgramBlock extends ForProgramBlock
return sb.toString();
}
- /**
- *
- * @return
- */
private long getMinMemory(ExecutionContext ec)
{
long ret = -1;
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/Program.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/Program.java b/src/main/java/org/apache/sysml/runtime/controlprogram/Program.java
index 7a35ec7..95b2e01 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/Program.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/Program.java
@@ -43,12 +43,6 @@ public class Program
_programBlocks = new ArrayList<ProgramBlock>();
}
- /**
- *
- * @param namespace
- * @param fname
- * @param fpb
- */
public synchronized void addFunctionProgramBlock(String namespace, String fname, FunctionProgramBlock fpb)
{
if (namespace == null)
@@ -63,12 +57,7 @@ public class Program
namespaceBlocks.put(fname,fpb);
}
-
- /**
- *
- * @param namespace
- * @param fname
- */
+
public synchronized void removeFunctionProgramBlock(String namespace, String fname)
{
if (namespace == null)
@@ -81,11 +70,7 @@ public class Program
namespaceBlocks.remove(fname);
}
}
-
- /**
- *
- * @return
- */
+
public synchronized HashMap<String,FunctionProgramBlock> getFunctionProgramBlocks(){
HashMap<String,FunctionProgramBlock> retVal = new HashMap<String,FunctionProgramBlock>();
@@ -103,14 +88,7 @@ public class Program
return retVal;
}
-
- /**
- *
- * @param namespace
- * @param fname
- * @return
- * @throws DMLRuntimeException
- */
+
public synchronized FunctionProgramBlock getFunctionProgramBlock(String namespace, String fname) throws DMLRuntimeException{
if (namespace == null) namespace = DMLProgram.DEFAULT_NAMESPACE;
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java
index 0137071..e1986c8 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/ProgramBlock.java
@@ -128,8 +128,8 @@ public class ProgramBlock
/**
* Executes this program block (incl recompilation if required).
*
- * @param ec
- * @throws DMLRuntimeException
+ * @param ec execution context
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public void execute(ExecutionContext ec)
throws DMLRuntimeException
@@ -171,10 +171,13 @@ public class ProgramBlock
/**
* Executes given predicate instructions (incl recompilation if required)
*
- * @param inst
- * @param hops
- * @param ec
- * @throws DMLRuntimeException
+ * @param inst list of instructions
+ * @param hops high-level operator
+ * @param requiresRecompile true if requires recompile
+ * @param retType value type of the return type
+ * @param ec execution context
+ * @return scalar object
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public ScalarObject executePredicate(ArrayList<Instruction> inst, Hop hops, boolean requiresRecompile, ValueType retType, ExecutionContext ec)
throws DMLRuntimeException
@@ -205,12 +208,6 @@ public class ProgramBlock
return executePredicateInstructions(tmp, retType, ec);
}
- /**
- *
- * @param inst
- * @param ec
- * @throws DMLRuntimeException
- */
protected void executeInstructions(ArrayList<Instruction> inst, ExecutionContext ec)
throws DMLRuntimeException
{
@@ -224,13 +221,7 @@ public class ProgramBlock
executeSingleInstruction(currInst, ec);
}
}
-
- /**
- *
- * @param inst
- * @param ec
- * @throws DMLRuntimeException
- */
+
protected ScalarObject executePredicateInstructions(ArrayList<Instruction> inst, ValueType retType, ExecutionContext ec)
throws DMLRuntimeException
{
@@ -282,13 +273,7 @@ public class ProgramBlock
return ret;
}
-
- /**
- *
- *
- * @param currInst
- * @throws DMLRuntimeException
- */
+
private void executeSingleInstruction( Instruction currInst, ExecutionContext ec )
throws DMLRuntimeException
{
@@ -339,14 +324,7 @@ public class ProgramBlock
}
}
}
-
- /**
- *
- * @param ec
- * @return
- * @throws DMLRuntimeException
- */
protected UpdateType[] prepareUpdateInPlaceVariables(ExecutionContext ec, long tid)
throws DMLRuntimeException
{
@@ -377,13 +355,7 @@ public class ProgramBlock
return flags;
}
-
- /**
- *
- * @param ec
- * @param flags
- * @throws DMLRuntimeException
- */
+
protected void resetUpdateInPlaceVariableFlags(ExecutionContext ec, UpdateType[] flags)
throws DMLRuntimeException
{
@@ -398,23 +370,12 @@ public class ProgramBlock
mo.setUpdateType(flags[i]);
}
}
-
- /**
- *
- * @param inst
- * @return
- */
+
private boolean isRemoveVariableInstruction(Instruction inst)
{
return ( inst instanceof VariableCPInstruction && ((VariableCPInstruction)inst).isRemoveVariable() );
}
-
- /**
- *
- * @param lastInst
- * @param vars
- * @throws DMLRuntimeException
- */
+
private void checkSparsity( Instruction lastInst, LocalVariableMap vars )
throws DMLRuntimeException
{
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/ByteBuffer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/ByteBuffer.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/ByteBuffer.java
index 166832a..a24dff3 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/ByteBuffer.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/ByteBuffer.java
@@ -48,12 +48,7 @@ public class ByteBuffer
_size = size;
_serialized = false;
}
-
- /**
- *
- * @param mb
- * @throws IOException
- */
+
public void serializeBlock( CacheBlock cb )
throws IOException
{
@@ -84,12 +79,7 @@ public class ByteBuffer
_serialized = true;
}
-
- /**
- *
- * @return
- * @throws IOException
- */
+
public CacheBlock deserializeBlock()
throws IOException
{
@@ -107,12 +97,7 @@ public class ByteBuffer
return ret;
}
-
- /**
- *
- * @param fname
- * @throws IOException
- */
+
public void evictBuffer( String fname )
throws IOException
{
@@ -129,16 +114,12 @@ public class ByteBuffer
/**
* Returns the buffer size in bytes.
*
- * @return
+ * @return buffer size in bytes
*/
public long getSize() {
return _size;
}
-
- /**
- *
- * @return
- */
+
public boolean isShallow() {
return _shallow;
}
@@ -155,10 +136,7 @@ public class ByteBuffer
_cdata = null;
}
}
-
- /**
- *
- */
+
public void checkSerialized()
{
//check if already serialized
@@ -176,9 +154,9 @@ public class ByteBuffer
* This call is consistent with 'serializeBlock' and allows for internal optimization
* according to dense/sparse representation.
*
- * @param size
- * @param mb
- * @return
+ * @param size the size
+ * @param cb cache block
+ * @return true if valid capacity
*/
public static boolean isValidCapacity( long size, CacheBlock cb )
{
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlock.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlock.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlock.java
index b73584c..eb34b09 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlock.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlock.java
@@ -30,27 +30,22 @@ import org.apache.sysml.runtime.DMLRuntimeException;
*/
public interface CacheBlock extends Writable
{
- /**
- *
- * @return
- */
+
public int getNumRows();
-
- /**
- *
- * @return
- */
+
public int getNumColumns();
/**
* Get the in-memory size in bytes of the cache block.
- * @return
+ *
+ * @return in-memory size in bytes of cache block
*/
public long getInMemorySize();
/**
* Get the exact serialized size in bytes of the cache block.
- * @return
+ *
+ * @return exact serialized size in bytes of cache block
*/
public long getExactSerializedSize();
@@ -59,7 +54,7 @@ public interface CacheBlock extends Writable
* which is generally true if in-memory size and serialized size
* are almost identical allowing to avoid unnecessary deep serialize.
*
- * @return
+ * @return true if shallow serialized
*/
public boolean isShallowSerialize();
@@ -72,13 +67,13 @@ public interface CacheBlock extends Writable
* Slice a sub block out of the current block and write into the given output block.
* This method returns the passed instance if not null.
*
- * @param rl
- * @param ru
- * @param cl
- * @param cu
- * @param block
- * @return
- * @throws DMLRuntimeException
+ * @param rl row lower
+ * @param ru row upper
+ * @param cl column lower
+ * @param cu column upper
+ * @param block cache block
+ * @return sub-block of cache block
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public CacheBlock sliceOperations(int rl, int ru, int cl, int cu, CacheBlock block)
throws DMLRuntimeException;
@@ -87,9 +82,9 @@ public interface CacheBlock extends Writable
* Merge the given block into the current block. Both blocks needs to be of equal
* dimensions and contain disjoint non-zero cells.
*
- * @param that
- * @param appendOnly
- * @throws DMLRuntimeException
+ * @param that cache block
+ * @param appendOnly ?
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public void merge(CacheBlock that, boolean appendOnly)
throws DMLRuntimeException;
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlockFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlockFactory.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlockFactory.java
index 9595441..5d52e4a 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlockFactory.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheBlockFactory.java
@@ -33,11 +33,6 @@ import org.apache.sysml.runtime.matrix.data.Pair;
*/
public class CacheBlockFactory
{
- /**
- *
- * @param code
- * @return
- */
public static CacheBlock newInstance(int code) {
switch( code ) {
case 0: return new MatrixBlock();
@@ -45,12 +40,7 @@ public class CacheBlockFactory
}
throw new RuntimeException("Unsupported cache block type: "+code);
}
-
- /**
- *
- * @param block
- * @return
- */
+
public static int getCode(CacheBlock block) {
if( block instanceof MatrixBlock )
return 0;
@@ -58,12 +48,7 @@ public class CacheBlockFactory
return 1;
throw new RuntimeException("Unsupported cache block type: "+block.getClass().getName());
}
-
- /**
- *
- * @param block
- * @return
- */
+
public static ArrayList<?> getPairList(CacheBlock block) {
int code = getCode(block);
switch( code ) {
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheDataInput.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheDataInput.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheDataInput.java
index bc81361..24df6d4 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheDataInput.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheDataInput.java
@@ -195,13 +195,7 @@ public class CacheDataInput implements DataInput, MatrixBlockDataInput
return nnz;
}
-
- /**
- *
- * @param a
- * @param off
- * @return
- */
+
private static int baToInt( byte[] ba, final int off )
{
//shift and add 4 bytes into single int
@@ -210,13 +204,7 @@ public class CacheDataInput implements DataInput, MatrixBlockDataInput
((ba[off+2] & 0xFF) << 8) +
((ba[off+3] & 0xFF) << 0);
}
-
- /**
- *
- * @param a
- * @param off
- * @return
- */
+
private static long baToLong( byte[] ba, final int off )
{
//shift and add 8 bytes into single long
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheDataOutput.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheDataOutput.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheDataOutput.java
index c74516c..b9ed0a8 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheDataOutput.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheDataOutput.java
@@ -199,26 +199,14 @@ public class CacheDataOutput implements DataOutput, MatrixBlockDataOutput
for( int i=lrlen; i<rlen; i++ )
writeInt( 0 );
}
-
- /**
- *
- * @param val
- * @param ba
- * @param off
- */
+
private static void shortToBa( final int val, byte[] ba, final int off )
{
//shift and mask out 2 bytes
ba[ off+0 ] = (byte)((val >>> 8) & 0xFF);
ba[ off+1 ] = (byte)((val >>> 0) & 0xFF);
}
-
- /**
- *
- * @param val
- * @param ba
- * @param off
- */
+
private static void intToBa( final int val, byte[] ba, final int off )
{
//shift and mask out 4 bytes
@@ -227,13 +215,7 @@ public class CacheDataOutput implements DataOutput, MatrixBlockDataOutput
ba[ off+2 ] = (byte)((val >>> 8) & 0xFF);
ba[ off+3 ] = (byte)((val >>> 0) & 0xFF);
}
-
- /**
- *
- * @param val
- * @param ba
- * @param off
- */
+
private static void longToBa( final long val, byte[] ba, final int off )
{
//shift and mask out 8 bytes
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
index d3addd6..c36b8ca 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/CacheableData.java
@@ -185,8 +185,8 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
/**
* Basic constructor for any cacheable data.
*
- * @param dt
- * @param vt
+ * @param dt data type
+ * @param vt value type
*/
protected CacheableData(DataType dt, ValueType vt) {
super (dt, vt);
@@ -198,7 +198,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
/**
* Copy constructor for cacheable data (of same type).
*
- * @param that
+ * @param that cacheable data object
*/
protected CacheableData(CacheableData<T> that) {
this( that.getDataType(), that.getValueType() );
@@ -214,7 +214,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* Enables or disables the cleanup of the associated
* data object on clearData().
*
- * @param flag
+ * @param flag true if cleanup
*/
public void enableCleanup(boolean flag) {
_cleanupFlag = flag;
@@ -224,56 +224,32 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* Indicates if cleanup of the associated data object
* is enabled on clearData().
*
- * @return
+ * @return true if cleanup enabled
*/
public boolean isCleanupEnabled() {
return _cleanupFlag;
}
-
- /**
- *
- * @param s
- */
+
public void setVarName(String s) {
_varName = s;
}
-
- /**
- *
- * @return
- */
+
public String getVarName() {
return _varName;
}
-
- /**
- *
- * @return
- */
+
public boolean isHDFSFileExists() {
return _hdfsFileExists;
}
-
- /**
- *
- * @param flag
- */
+
public void setHDFSFileExists( boolean flag ) {
_hdfsFileExists = flag;
}
-
- /**
- *
- * @return
- */
+
public String getFileName() {
return _hdfsFileName;
}
- /**
- *
- * @param file
- */
public synchronized void setFileName( String file ) {
if( _hdfsFileName!=null && !_hdfsFileName.equals(file) )
if( !isEmpty(true) )
@@ -285,31 +261,21 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* <code>true</code> if the in-memory or evicted matrix may be different from
* the matrix located at {@link #_hdfsFileName}; <code>false</code> if the two
* matrices are supposed to be the same.
+ *
+ * @return true if dirty
*/
public boolean isDirty() {
return _dirtyFlag;
}
-
- /**
- *
- * @param flag
- */
+
public void setDirty(boolean flag) {
_dirtyFlag = flag;
}
-
- /**
- *
- * @return
- */
+
public FileFormatProperties getFileFormatProperties() {
return _formatProps;
}
-
- /**
- *
- * @param props
- */
+
public void setFileFormatProperties(FileFormatProperties props) {
_formatProps = props;
}
@@ -333,25 +299,14 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
MatrixDimensionsMetaData meta = (MatrixDimensionsMetaData) _metaData;
return meta.getMatrixCharacteristics();
}
-
- /**
- *
- */
+
public abstract void refreshMetaData()
throws CacheException;
-
- /**
- *
- * @return
- */
+
public RDDObject getRDDHandle() {
return _rddHandle;
}
-
- /**
- *
- * @param rdd
- */
+
public void setRDDHandle( RDDObject rdd ) {
//cleanup potential old back reference
if( _rddHandle != null )
@@ -366,11 +321,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
public BroadcastObject<T> getBroadcastHandle() {
return _bcHandle;
}
-
- /**
- *
- * @param bc
- */
+
@SuppressWarnings({ "rawtypes", "unchecked" })
public void setBroadcastHandle( BroadcastObject bc ) {
//cleanup potential old back reference
@@ -382,11 +333,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
if( _bcHandle != null )
bc.setBackReference(this);
}
-
- /**
- *
- * @return
- */
+
public GPUObject getGPUObject() {
return _gpuHandle;
}
@@ -413,8 +360,8 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* In-Status: EMPTY, EVICTABLE, EVICTED, READ;
* Out-Status: READ(+1).
*
- * @return
- * @throws CacheException
+ * @return cacheable data
+ * @throws CacheException if CacheException occurs
*/
public synchronized T acquireRead()
throws CacheException
@@ -504,8 +451,8 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* In-Status: EMPTY, EVICTABLE, EVICTED;
* Out-Status: MODIFY.
*
- * @return
- * @throws CacheException
+ * @return cacheable data
+ * @throws CacheException if CacheException occurs
*/
public synchronized T acquireModify()
throws CacheException
@@ -561,9 +508,9 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* In-Status: EMPTY, EVICTABLE, EVICTED;
* Out-Status: MODIFY.
*
- * @param newData
- * @return
- * @throws CacheException
+ * @param newData new data
+ * @return cacheable data
+ * @throws CacheException if CacheException occurs
*/
public synchronized T acquireModify(T newData)
throws CacheException
@@ -608,7 +555,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* In-Status: READ, MODIFY;
* Out-Status: READ(-1), EVICTABLE, EMPTY.
*
- * @throws CacheException
+ * @throws CacheException if CacheException occurs
*/
public synchronized void release()
throws CacheException
@@ -676,7 +623,8 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
*
* In-Status: EMPTY, EVICTABLE, EVICTED;
* Out-Status: EMPTY.
- * @throws CacheException
+ *
+ * @throws CacheException if CacheException occurs
*/
public synchronized void clearData()
throws CacheException
@@ -713,11 +661,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
setDirty(false);
setEmpty();
}
-
- /**
- *
- * @throws CacheException
- */
+
public synchronized void exportData() throws CacheException {
exportData( -1 );
}
@@ -728,7 +672,8 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* In-Status: EMPTY, EVICTABLE, EVICTED, READ;
* Out-Status: EMPTY, EVICTABLE, EVICTED, READ.
*
- * @throws CacheException
+ * @param replication ?
+ * @throws CacheException if CacheException occurs
*/
public synchronized void exportData( int replication )
throws CacheException
@@ -737,25 +682,12 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
_hdfsFileExists = true;
}
- /**
- *
- * @param fName
- * @param outputFormat
- * @throws CacheException
- */
public synchronized void exportData(String fName, String outputFormat)
throws CacheException
{
exportData(fName, outputFormat, -1, null);
}
-
- /**
- *
- * @param fName
- * @param outputFormat
- * @param formatProperties
- * @throws CacheException
- */
+
public synchronized void exportData(String fName, String outputFormat, FileFormatProperties formatProperties)
throws CacheException
{
@@ -773,9 +705,11 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* the output format and most importantly would bypass reblocking during write (which effects the
* potential degree of parallelism). However, we copy files on HDFS if certain criteria are given.
*
- * @param fName
- * @param outputFormat
- * @throws CacheException
+ * @param fName file name
+ * @param outputFormat format
+ * @param replication ?
+ * @param formatProperties file format properties
+ * @throws CacheException if CacheException occurs
*/
public synchronized void exportData (String fName, String outputFormat, int replication, FileFormatProperties formatProperties)
throws CacheException
@@ -910,7 +844,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* Low-level cache I/O method that physically restores the data blob to
* main memory. Must be defined by a subclass, never called by users.
*
- * @throws CacheException
+ * @throws CacheException if CacheException occurs
*/
protected void restoreBlobIntoMemory()
throws CacheException
@@ -939,11 +873,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
if( LOG.isTraceEnabled() )
LOG.trace("Restoring matrix - COMPLETED ... " + (System.currentTimeMillis()-begin) + " msec.");
}
- /**
- *
- * @param fname
- * @return
- */
+
protected abstract T readBlobFromCache(String fname)
throws IOException;
@@ -964,10 +894,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
if( LOG.isTraceEnabled() )
LOG.trace("Freeing evicted matrix - COMPLETED ... " + (System.currentTimeMillis()-begin) + " msec.");
}
-
- /**
- *
- */
+
protected boolean isBelowCachingThreshold() {
return (_data.getInMemorySize() <= CACHING_THRESHOLD);
}
@@ -975,10 +902,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
protected ValueType[] getSchema() {
return null;
}
-
- /**
- *
- */
+
@Override //Data
public synchronized String getDebugName() {
int maxLength = 23;
@@ -988,12 +912,6 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
return getVarName() + " " + debugNameEnding;
}
- /**
- *
- * @param fname
- * @return
- * @throws IOException
- */
protected T readBlobFromHDFS(String fname)
throws IOException
{
@@ -1001,60 +919,19 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
MatrixCharacteristics mc = iimd.getMatrixCharacteristics();
return readBlobFromHDFS(fname, mc.getRows(), mc.getCols());
}
-
- /**
- *
- * @param fname
- * @param rlen
- * @param clen
- * @return
- * @throws IOException
- */
+
protected abstract T readBlobFromHDFS(String fname, long rlen, long clen)
throws IOException;
-
- /**
- *
- * @param rdd
- * @param status
- * @return
- * @throws IOException
- */
+
protected abstract T readBlobFromRDD(RDDObject rdd, MutableBoolean status)
throws IOException;
-
- /**
- *
- * @param fname
- * @param ofmt
- * @param rep
- * @param fprop
- * @throws IOException
- * @throws DMLRuntimeException
- */
+
protected abstract void writeBlobToHDFS(String fname, String ofmt, int rep, FileFormatProperties fprop)
throws IOException, DMLRuntimeException;
-
- /**
- *
- * @param rdd
- * @param fname
- * @param ofmt
- * @throws IOException
- * @throws DMLRuntimeException
- */
+
protected abstract void writeBlobFromRDDtoHDFS(RDDObject rdd, String fname, String ofmt)
throws IOException, DMLRuntimeException;
-
-
- /**
- *
- * @param filePathAndName
- * @param outputFormat
- * @param formatProperties
- * @throws DMLRuntimeException
- * @throws IOException
- */
+
protected void writeMetaData (String filePathAndName, String outputFormat, FileFormatProperties formatProperties)
throws DMLRuntimeException, IOException
{
@@ -1084,12 +961,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
getSchema(), dataType, mc, oinfo, formatProperties);
}
}
-
- /**
- *
- * @param outputFormat
- * @return
- */
+
protected boolean isEqualOutputFormat( String outputFormat )
{
boolean ret = true;
@@ -1115,10 +987,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
protected int getUniqueCacheID() {
return _uniqueID;
}
-
- /**
- *
- */
+
protected String getCacheFilePathAndName () {
if( _cacheFileName==null ) {
StringBuilder sb = new StringBuilder();
@@ -1151,7 +1020,8 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
*
* @param isModify : <code>true</code> for the exclusive "modify" lock,
* <code>false</code> for a shared "read" lock.
- * @throws CacheException
+ * @param restore true if restore
+ * @throws CacheException if CacheException occurs
*/
protected void acquire (boolean isModify, boolean restore)
throws CacheException
@@ -1189,11 +1059,12 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
* It is expected that you eliminate all external references to the blob
* prior to calling this method, because otherwise eviction will
* duplicate the blob, but not release memory. This method has to be
- * called only once per process and coupled with {@link #acquire(boolean)},
+ * called only once per process and coupled with {@link #acquire(boolean, boolean)},
* because it decrements the lock count and the other method increments
* the lock count.
*
- * @throws CacheException
+ * @param cacheNoWrite ?
+ * @throws CacheException if CacheException occurs
*/
protected void release(boolean cacheNoWrite)
throws CacheException
@@ -1329,11 +1200,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
_cache = null;
}
}
-
- /**
- *
- * @param add
- */
+
protected void updateStatusPinned(boolean add) {
if( _data != null ) { //data should never be null
long size = sizePinned.get();
@@ -1341,20 +1208,13 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
sizePinned.set( Math.max(size,0) );
}
}
-
- /**
- *
- * @return
- */
+
protected long getPinnedSize() {
return sizePinned.get();
}
// --------- STATIC CACHE INIT/CLEANUP OPERATIONS ----------
-
- /**
- *
- */
+
public synchronized static void cleanupCacheDir() {
//cleanup remaining cached writes
LazyWriteBuffer.cleanup();
@@ -1366,7 +1226,7 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
/**
* Deletes the DML-script-specific caching working dir.
*
- * @param withDir
+ * @param withDir if true, delete directory
*/
public synchronized static void cleanupCacheDir(boolean withDir)
{
@@ -1392,7 +1252,8 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
/**
* Inits caching with the default uuid of DMLScript
- * @throws IOException
+ *
+ * @throws IOException if IOException occurs
*/
public synchronized static void initCaching()
throws IOException
@@ -1405,7 +1266,8 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
*
* Takes the UUID in order to allow for custom uuid, e.g., for remote parfor caching
*
- * @throws IOException
+ * @param uuid ID
+ * @throws IOException if IOException occurs
*/
public synchronized static void initCaching( String uuid )
throws IOException
@@ -1439,13 +1301,6 @@ public abstract class CacheableData<T extends CacheBlock> extends Data
_activeFlag = true;
}
- /**
- *
- * @param fName
- * @param outputFormat
- * @return
- * @throws CacheException
- */
public synchronized boolean moveData(String fName, String outputFormat)
throws CacheException
{
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
index d3fb74c..4cf3d7f 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/FrameObject.java
@@ -50,41 +50,22 @@ public class FrameObject extends CacheableData<FrameBlock>
private static final long serialVersionUID = 1755082174281927785L;
private ValueType[] _schema = null;
-
- /**
- *
- */
+
protected FrameObject() {
super(DataType.FRAME, ValueType.STRING);
}
-
- /**
- *
- * @param fname
- */
+
public FrameObject(String fname) {
this();
setFileName(fname);
}
-
- /**
- *
- * @param fname
- * @param meta
- */
+
public FrameObject(String fname, MetaData meta) {
this();
setFileName(fname);
setMetaData(meta);
}
-
- /**
- *
- * @param fname
- * @param meta
- * @param schema
- *
- */
+
public FrameObject(String fname, MetaData meta, ValueType[] schema) {
this();
setFileName(fname);
@@ -95,7 +76,7 @@ public class FrameObject extends CacheableData<FrameBlock>
/**
* Copy constructor that copies meta data but NO data.
*
- * @param fo
+ * @param fo frame object
*/
public FrameObject(FrameObject fo) {
super(fo);
@@ -107,10 +88,11 @@ public class FrameObject extends CacheableData<FrameBlock>
}
/**
+ * Obtain schema of value types
*
* @param cl column lower bound, inclusive
* @param cu column upper bound, inclusive
- * @return
+ * @return schema of value types
*/
public ValueType[] getSchema(int cl, int cu) {
return (_schema!=null && _schema.length>cu) ? Arrays.copyOfRange(_schema, cl, cu+1) :
@@ -121,8 +103,8 @@ public class FrameObject extends CacheableData<FrameBlock>
* Creates a new collection which contains the schema of the current
* frame object concatenated with the schema of the passed frame object.
*
- * @param fo
- * @return
+ * @param fo frame object
+ * @return schema of value types
*/
public ValueType[] mergeSchemas(FrameObject fo) {
return (ValueType[]) ArrayUtils.addAll(
@@ -165,20 +147,12 @@ public class FrameObject extends CacheableData<FrameBlock>
//update schema information
_schema = _data.getSchema();
}
-
- /**
- *
- * @return
- */
+
public long getNumRows() {
MatrixCharacteristics mc = getMatrixCharacteristics();
return mc.getRows();
}
- /**
- *
- * @return
- */
public long getNumColumns() {
MatrixCharacteristics mc = getMatrixCharacteristics();
return mc.getCols();
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/LazyWriteBuffer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/LazyWriteBuffer.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/LazyWriteBuffer.java
index 0aad717..3447727 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/LazyWriteBuffer.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/LazyWriteBuffer.java
@@ -30,10 +30,6 @@ import org.apache.sysml.api.DMLScript;
import org.apache.sysml.runtime.controlprogram.parfor.stat.InfrastructureAnalyzer;
import org.apache.sysml.runtime.util.LocalFileUtils;
-/**
- *
- *
- */
public class LazyWriteBuffer
{
public enum RPolicy {
@@ -59,13 +55,7 @@ public class LazyWriteBuffer
long maxMem = InfrastructureAnalyzer.getLocalMaxMemory();
_limit = (long)(CacheableData.CACHING_BUFFER_SIZE * maxMem);
}
-
- /**
- *
- * @param fname
- * @param mb
- * @throws IOException
- */
+
public static void writeBlock( String fname, CacheBlock cb )
throws IOException
{
@@ -125,11 +115,7 @@ public class LazyWriteBuffer
CacheStatistics.incrementFSWrites();
}
}
-
- /**
- *
- * @param fname
- */
+
public static void deleteBlock( String fname )
{
boolean requiresDelete = true;
@@ -149,13 +135,7 @@ public class LazyWriteBuffer
if( requiresDelete )
_fClean.deleteFile(fname);
}
-
- /**
- *
- * @param fname
- * @return
- * @throws IOException
- */
+
public static CacheBlock readBlock( String fname, boolean matrix )
throws IOException
{
@@ -193,10 +173,7 @@ public class LazyWriteBuffer
return cb;
}
-
- /**
- *
- */
+
public static void init() {
_mQueue = new EvictionQueue();
_fClean = new FileCleaner();
@@ -204,10 +181,7 @@ public class LazyWriteBuffer
if( CacheableData.CACHING_BUFFER_PAGECACHE )
PageCache.init();
}
-
- /**
- *
- */
+
public static void cleanup() {
if( _mQueue != null )
_mQueue.clear();
@@ -216,11 +190,7 @@ public class LazyWriteBuffer
if( CacheableData.CACHING_BUFFER_PAGECACHE )
PageCache.clear();
}
-
- /**
- *
- * @return
- */
+
public static long getWriteBufferSize() {
long maxMem = InfrastructureAnalyzer.getLocalMaxMemory();
return (long)(CacheableData.CACHING_BUFFER_SIZE * maxMem);
@@ -230,6 +200,7 @@ public class LazyWriteBuffer
* Print current status of buffer pool, including all entries.
* NOTE: use only for debugging or testing.
*
+ * @param position the position
*/
public static void printStatus( String position )
{
@@ -255,9 +226,9 @@ public class LazyWriteBuffer
/**
* Evicts all buffer pool entries.
- * NOTE: use only for debugging or testing.
- * @throws IOException
+ * NOTE: use only for debugging or testing.
*
+ * @throws IOException if IOException occurs
*/
public static void forceEviction()
throws IOException
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/MatrixObject.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/MatrixObject.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/MatrixObject.java
index aad660e..40cae0c 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/MatrixObject.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/MatrixObject.java
@@ -82,14 +82,21 @@ public class MatrixObject extends CacheableData<MatrixBlock>
private MatrixBlock _partitionInMemory = null;
/**
- * Constructor that takes only the HDFS filename.
+ * Constructor that takes the value type and the HDFS filename.
+ *
+ * @param vt value type
+ * @param file file name
*/
public MatrixObject (ValueType vt, String file) {
this (vt, file, null); //HDFS file path
}
/**
- * Constructor that takes both HDFS filename and associated metadata.
+ * Constructor that takes the value type, HDFS filename and associated metadata.
+ *
+ * @param vt value type
+ * @param file file name
+ * @param mtd metadata
*/
public MatrixObject( ValueType vt, String file, MetaData mtd ) {
super (DataType.MATRIX, vt);
@@ -102,7 +109,7 @@ public class MatrixObject extends CacheableData<MatrixBlock>
/**
* Copy constructor that copies meta data but NO data.
*
- * @param mo
+ * @param mo matrix object
*/
public MatrixObject( MatrixObject mo )
{
@@ -119,20 +126,11 @@ public class MatrixObject extends CacheableData<MatrixBlock>
_partitionSize = mo._partitionSize;
_partitionCacheName = mo._partitionCacheName;
}
-
- /**
- *
- * @param flag
- */
public void setUpdateType(UpdateType flag) {
_updateType = flag;
}
-
- /**
- *
- * @return
- */
+
public UpdateType getUpdateType() {
return _updateType;
}
@@ -144,7 +142,8 @@ public class MatrixObject extends CacheableData<MatrixBlock>
/**
* Make the matrix metadata consistent with the in-memory matrix data
- * @throws CacheException
+ *
+ * @throws CacheException if CacheException occurs
*/
@Override
public void refreshMetaData()
@@ -159,56 +158,32 @@ public class MatrixObject extends CacheableData<MatrixBlock>
_data.getNumColumns() );
mc.setNonZeros( _data.getNonZeros() );
}
-
- /**
- *
- * @return
- */
+
public long getNumRows() {
MatrixCharacteristics mc = getMatrixCharacteristics();
return mc.getRows ();
}
- /**
- *
- * @return
- */
public long getNumColumns() {
MatrixCharacteristics mc = getMatrixCharacteristics();
return mc.getCols ();
}
- /**
- *
- * @return
- */
public long getNumRowsPerBlock() {
MatrixCharacteristics mc = getMatrixCharacteristics();
return mc.getRowsPerBlock();
}
-
- /**
- *
- * @return
- */
+
public long getNumColumnsPerBlock() {
MatrixCharacteristics mc = getMatrixCharacteristics();
return mc.getColsPerBlock();
}
-
- /**
- *
- * @return
- */
+
public long getNnz() {
MatrixCharacteristics mc = getMatrixCharacteristics();
return mc.getNonZeros();
}
-
- /**
- *
- * @return
- */
+
public double getSparsity() {
MatrixCharacteristics mc = getMatrixCharacteristics();
return ((double)mc.getNonZeros())/mc.getRows()/mc.getCols();
@@ -231,11 +206,7 @@ public class MatrixObject extends CacheableData<MatrixBlock>
// *** (all other methods still usable) ***
// *** ***
// *********************************************
-
- /**
- * @param n
- *
- */
+
public void setPartitioned( PDataPartitionFormat format, int n )
{
_partitioned = true;
@@ -250,11 +221,7 @@ public class MatrixObject extends CacheableData<MatrixBlock>
_partitionFormat = null;
_partitionSize = -1;
}
-
- /**
- *
- * @return
- */
+
public boolean isPartitioned()
{
return _partitioned;
@@ -283,9 +250,9 @@ public class MatrixObject extends CacheableData<MatrixBlock>
* as we reject to partition vectors and support only full row or column indexing, no metadata (apart from
* the partition flag) is required.
*
- * @param pred
- * @return
- * @throws CacheException
+ * @param pred index range
+ * @return matrix block
+ * @throws CacheException if CacheException occurs
*/
public synchronized MatrixBlock readMatrixPartition( IndexRange pred )
throws CacheException
@@ -394,14 +361,7 @@ public class MatrixObject extends CacheableData<MatrixBlock>
return mb;
}
-
-
- /**
- *
- * @param pred
- * @return
- * @throws CacheException
- */
+
public String getPartitionFileName( IndexRange pred, int brlen, int bclen )
throws CacheException
{
@@ -485,13 +445,7 @@ public class MatrixObject extends CacheableData<MatrixBlock>
return newData;
}
-
- /**
- *
- * @param rdd
- * @return
- * @throws IOException
- */
+
@Override
protected MatrixBlock readBlobFromRDD(RDDObject rdd, MutableBoolean writeStatus)
throws IOException
@@ -557,9 +511,6 @@ public class MatrixObject extends CacheableData<MatrixBlock>
/**
* Writes in-memory matrix to HDFS in a specified format.
- *
- * @throws DMLRuntimeException
- * @throws IOException
*/
@Override
protected void writeBlobToHDFS(String fname, String ofmt, int rep, FileFormatProperties fprop)
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/PageCache.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/PageCache.java b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/PageCache.java
index f1462d4..7e96ec1 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/caching/PageCache.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/caching/PageCache.java
@@ -23,36 +23,22 @@ import java.lang.ref.SoftReference;
import java.util.HashMap;
import java.util.LinkedList;
-/**
- *
- *
- */
public class PageCache
{
private static final int CLEANUP_THRESHOLD = 128;
private static HashMap<Integer, LinkedList<SoftReference<byte[]>>> _pool;
-
- /**
- *
- */
+
public static void init()
{
_pool = new HashMap<Integer, LinkedList<SoftReference<byte[]>>>();
}
-
- /**
- *
- */
+
public static void clear()
{
_pool = null;
}
-
- /**
- *
- * @param data
- */
+
public static void putPage( byte[] data )
{
//cleanup if too many different size lists
@@ -66,12 +52,7 @@ public class PageCache
}
list.addLast(new SoftReference<byte[]>(data));
}
-
- /**
- *
- * @param size
- * @return
- */
+
public static byte[] getPage( int size )
{
LinkedList<SoftReference<byte[]>> list = _pool.get( size );
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java b/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java
index b6011ae..96147b9 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContext.java
@@ -19,7 +19,6 @@
package org.apache.sysml.runtime.controlprogram.context;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -32,7 +31,6 @@ import org.apache.sysml.parser.Expression.ValueType;
import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.LocalVariableMap;
import org.apache.sysml.runtime.controlprogram.Program;
-import org.apache.sysml.runtime.controlprogram.caching.CacheException;
import org.apache.sysml.runtime.controlprogram.caching.CacheableData;
import org.apache.sysml.runtime.controlprogram.caching.FrameObject;
import org.apache.sysml.runtime.controlprogram.caching.MatrixObject;
@@ -187,13 +185,7 @@ public class ExecutionContext
return (FrameObject) dat;
}
-
- /**
- *
- * @param varname
- * @return
- * @throws DMLRuntimeException
- */
+
public CacheableData<?> getCacheableData(String varname)
throws DMLRuntimeException
{
@@ -207,12 +199,7 @@ public class ExecutionContext
return (CacheableData<?>) dat;
}
-
- /**
- *
- * @param varname
- * @throws DMLRuntimeException
- */
+
public void releaseCacheableData(String varname)
throws DMLRuntimeException
{
@@ -230,9 +217,9 @@ public class ExecutionContext
/**
* Pins a matrix variable into memory and returns the internal matrix block.
*
- * @param varName
- * @return
- * @throws DMLRuntimeException
+ * @param varName variable name
+ * @return matrix block
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public MatrixBlock getMatrixInput(String varName)
throws DMLRuntimeException
@@ -271,10 +258,11 @@ public class ExecutionContext
/**
* Allocates a sparse matrix in CSR format on the GPU.
* Assumes that mat.getNumRows() returns a valid number
- * @param varName
- * @param nnz number of non zeroes
- * @return
- * @throws DMLRuntimeException
+ *
+ * @param varName variable name
+ * @param nnz number of non zeroes
+ * @return matrix object
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public MatrixObject getSparseMatrixOutputForGPUInstruction(String varName, long nnz)
throws DMLRuntimeException
@@ -287,9 +275,9 @@ public class ExecutionContext
/**
* Allocates the {@link GPUObject} for a given LOPS Variable (eg. _mVar3)
- * @param varName
- * @return
- * @throws DMLRuntimeException
+ * @param varName variable name
+ * @return matrix object
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public MatrixObject allocateGPUMatrixObject(String varName) throws DMLRuntimeException {
MatrixObject mo = getMatrixObject(varName);
@@ -321,8 +309,8 @@ public class ExecutionContext
/**
* Unpins a currently pinned matrix variable.
*
- * @param varName
- * @throws DMLRuntimeException
+ * @param varName variable name
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public void releaseMatrixInput(String varName)
throws DMLRuntimeException
@@ -341,9 +329,9 @@ public class ExecutionContext
/**
* Pins a frame variable into memory and returns the internal frame block.
*
- * @param varName
- * @return
- * @throws DMLRuntimeException
+ * @param varName variable name
+ * @return frame block
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public FrameBlock getFrameInput(String varName)
throws DMLRuntimeException
@@ -355,8 +343,8 @@ public class ExecutionContext
/**
* Unpins a currently pinned frame variable.
*
- * @param varName
- * @throws DMLRuntimeException
+ * @param varName variable name
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
public void releaseFrameInput(String varName)
throws DMLRuntimeException
@@ -411,13 +399,7 @@ public class ExecutionContext
}
mo.getGPUObject().releaseOutput();
}
-
- /**
- *
- * @param varName
- * @param outputData
- * @throws DMLRuntimeException
- */
+
public void setMatrixOutput(String varName, MatrixBlock outputData)
throws DMLRuntimeException
{
@@ -426,14 +408,7 @@ public class ExecutionContext
mo.release();
setVariable(varName, mo);
}
-
- /**
- *
- * @param varName
- * @param outputData
- * @param inplace
- * @throws DMLRuntimeException
- */
+
public void setMatrixOutput(String varName, MatrixBlock outputData, UpdateType flag)
throws DMLRuntimeException
{
@@ -446,13 +421,7 @@ public class ExecutionContext
//default case
setMatrixOutput(varName, outputData);
}
-
- /**
- *
- * @param varName
- * @param outputData
- * @throws DMLRuntimeException
- */
+
public void setFrameOutput(String varName, FrameBlock outputData)
throws DMLRuntimeException
{
@@ -475,6 +444,9 @@ public class ExecutionContext
* parfor shared inputs that are passed to functions.
*
* The function returns the OLD "clean up" state of matrix objects.
+ *
+ * @param varList variable list
+ * @return map of old cleanup state of matrix objects
*/
public HashMap<String,Boolean> pinVariables(ArrayList<String> varList)
{
@@ -519,7 +491,10 @@ public class ExecutionContext
* unpinVariables(varList, oldStatus);
* </code>
*
- * i.e., a call to unpinVariables() is preceded by pinVariables().
+ * i.e., a call to unpinVariables() is preceded by pinVariables().
+ *
+ * @param varList variable list
+ * @param varsState variable state
*/
public void unpinVariables(ArrayList<String> varList, HashMap<String,Boolean> varsState)
{
@@ -535,7 +510,7 @@ public class ExecutionContext
/**
* NOTE: No order guaranteed, so keep same list for pin and unpin.
*
- * @return
+ * @return variable list as strings
*/
public ArrayList<String> getVarList()
{
@@ -544,13 +519,6 @@ public class ExecutionContext
return varlist;
}
-
- /**
- *
- * @param mo
- * @throws CacheException
- * @throws IOException
- */
public void cleanupMatrixObject(MatrixObject mo)
throws DMLRuntimeException
{
@@ -592,24 +560,14 @@ public class ExecutionContext
_dbState.prevPC = new DMLProgramCounter(DMLProgram.DEFAULT_NAMESPACE, "main", 0, 0); //initialize previous pc
}
}
-
- /**
- *
- * @param index
- * @throws DMLRuntimeException
- */
+
public void updateDebugState( int index ) throws DMLRuntimeException
{
if(DMLScript.ENABLE_DEBUG_MODE) {
_dbState.getPC().setProgramBlockNumber(index);
}
}
-
- /**
- *
- * @param currInst
- * @throws DMLRuntimeException
- */
+
public void updateDebugState( Instruction currInst ) throws DMLRuntimeException
{
if (DMLScript.ENABLE_DEBUG_MODE) {
@@ -624,10 +582,7 @@ public class ExecutionContext
suspendIfAskedInDebugMode(currInst);
}
}
-
- /**
- *
- */
+
public void clearDebugProgramCounters()
{
if(DMLScript.ENABLE_DEBUG_MODE) {
@@ -666,9 +621,9 @@ public class ExecutionContext
* In this function, if the user has issued one of the step instructions or
* has enabled suspend flag in previous instruction (through breakpoint),
* then it will wait until user issues a new debugger command.
- * @param currInst
- * @param ec
- * @throws DMLRuntimeException
+ *
+ * @param currInst current instruction
+ * @throws DMLRuntimeException if DMLRuntimeException occurs
*/
@SuppressWarnings("deprecation")
private void suspendIfAskedInDebugMode(Instruction currInst ) throws DMLRuntimeException {
http://git-wip-us.apache.org/repos/asf/incubator-systemml/blob/56e45f1a/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContextFactory.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContextFactory.java b/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContextFactory.java
index f4cf424..4b2d9d0 100644
--- a/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContextFactory.java
+++ b/src/main/java/org/apache/sysml/runtime/controlprogram/context/ExecutionContextFactory.java
@@ -24,11 +24,6 @@ import org.apache.sysml.runtime.controlprogram.Program;
public class ExecutionContextFactory
{
-
- /**
- *
- * @return
- */
public static ExecutionContext createContext()
{
return createContext( null );
@@ -38,12 +33,7 @@ public class ExecutionContextFactory
{
return createContext(true, prog);
}
-
- /**
- *
- * @param platform
- * @return
- */
+
public static ExecutionContext createContext( boolean allocateVars, Program prog )
{
ExecutionContext ec = null;