You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemml.apache.org by mb...@apache.org on 2017/10/11 05:53:13 UTC
[3/7] systemml git commit: [MINOR] Cleanup various issues raised by
static code analysis, part 1
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/cp/ConvolutionCPInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/ConvolutionCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/ConvolutionCPInstruction.java
index df72f24..5545ea2 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/cp/ConvolutionCPInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/ConvolutionCPInstruction.java
@@ -43,8 +43,8 @@ public class ConvolutionCPInstruction extends UnaryCPInstruction {
private CPOperand _in3;
private ArrayList<CPOperand> _input_shape;
private ArrayList<CPOperand> _filter_shape;
- private ArrayList<CPOperand> _stride = new ArrayList<CPOperand>();
- private ArrayList<CPOperand> _padding = new ArrayList<CPOperand>();
+ private ArrayList<CPOperand> _stride = new ArrayList<>();
+ private ArrayList<CPOperand> _padding = new ArrayList<>();
private int _numThreads = -1; private double _intermediateMemoryBudget = 0;
private static final Log LOG = LogFactory.getLog(ConvolutionCPInstruction.class.getName());
private static boolean warnedUnderUtilitization = false;
@@ -120,10 +120,10 @@ public class ConvolutionCPInstruction extends UnaryCPInstruction {
CPOperand in = new CPOperand(parts[1]);
CPOperand out = new CPOperand(parts[14]);
- ArrayList<CPOperand> stride = new ArrayList<CPOperand>();
- ArrayList<CPOperand> padding = new ArrayList<CPOperand>();
- ArrayList<CPOperand> input_shape = new ArrayList<CPOperand>();
- ArrayList<CPOperand> filter_shape = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> stride = new ArrayList<>();
+ ArrayList<CPOperand> padding = new ArrayList<>();
+ ArrayList<CPOperand> input_shape = new ArrayList<>();
+ ArrayList<CPOperand> filter_shape = new ArrayList<>();
stride.add(new CPOperand(parts[2]));
stride.add(new CPOperand(parts[3]));
padding.add(new CPOperand(parts[4]));
@@ -153,10 +153,10 @@ public class ConvolutionCPInstruction extends UnaryCPInstruction {
CPOperand in2 = new CPOperand(parts[2]);
CPOperand out = new CPOperand(parts[15]);
- ArrayList<CPOperand> stride = new ArrayList<CPOperand>();
- ArrayList<CPOperand> padding = new ArrayList<CPOperand>();
- ArrayList<CPOperand> input_shape = new ArrayList<CPOperand>();
- ArrayList<CPOperand> filter_shape = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> stride = new ArrayList<>();
+ ArrayList<CPOperand> padding = new ArrayList<>();
+ ArrayList<CPOperand> input_shape = new ArrayList<>();
+ ArrayList<CPOperand> filter_shape = new ArrayList<>();
stride.add(new CPOperand(parts[3]));
stride.add(new CPOperand(parts[4]));
padding.add(new CPOperand(parts[5]));
@@ -184,10 +184,10 @@ public class ConvolutionCPInstruction extends UnaryCPInstruction {
CPOperand in3 = new CPOperand(parts[3]);
CPOperand out = new CPOperand(parts[16]);
- ArrayList<CPOperand> stride = new ArrayList<CPOperand>();
- ArrayList<CPOperand> padding = new ArrayList<CPOperand>();
- ArrayList<CPOperand> input_shape = new ArrayList<CPOperand>();
- ArrayList<CPOperand> filter_shape = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> stride = new ArrayList<>();
+ ArrayList<CPOperand> padding = new ArrayList<>();
+ ArrayList<CPOperand> input_shape = new ArrayList<>();
+ ArrayList<CPOperand> filter_shape = new ArrayList<>();
stride.add(new CPOperand(parts[4]));
stride.add(new CPOperand(parts[5]));
padding.add(new CPOperand(parts[6]));
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/cp/FunctionCallCPInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/FunctionCallCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/FunctionCallCPInstruction.java
index d774c8d..3e0ecf9 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/cp/FunctionCallCPInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/FunctionCallCPInstruction.java
@@ -79,9 +79,9 @@ public class FunctionCallCPInstruction extends CPInstruction {
String functionName = parts[2];
int numInputs = Integer.valueOf(parts[3]);
int numOutputs = Integer.valueOf(parts[4]);
- ArrayList<CPOperand> boundInParamOperands = new ArrayList<CPOperand>();
- ArrayList<String> boundInParamNames = new ArrayList<String>();
- ArrayList<String> boundOutParamNames = new ArrayList<String>();
+ ArrayList<CPOperand> boundInParamOperands = new ArrayList<>();
+ ArrayList<String> boundInParamNames = new ArrayList<>();
+ ArrayList<String> boundOutParamNames = new ArrayList<>();
for (int i = 0; i < numInputs; i++) {
CPOperand operand = new CPOperand(parts[5 + i]);
boundInParamOperands.add(operand);
@@ -188,8 +188,8 @@ public class FunctionCallCPInstruction extends CPInstruction {
LocalVariableMap retVars = fn_ec.getVariables();
// cleanup all returned variables w/o binding
- Collection<String> retVarnames = new LinkedList<String>(retVars.keySet());
- HashSet<String> probeVars = new HashSet<String>();
+ Collection<String> retVarnames = new LinkedList<>(retVars.keySet());
+ HashSet<String> probeVars = new HashSet<>();
for(DataIdentifier di : fpb.getOutputParams())
probeVars.add(di.getName());
for( String var : retVarnames ) {
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnBuiltinCPInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnBuiltinCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnBuiltinCPInstruction.java
index c60b088..d69f08c 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnBuiltinCPInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnBuiltinCPInstruction.java
@@ -56,7 +56,7 @@ public class MultiReturnBuiltinCPInstruction extends ComputationCPInstruction {
throws DMLRuntimeException
{
String[] parts = InstructionUtils.getInstructionPartsWithValueType(str);
- ArrayList<CPOperand> outputs = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> outputs = new ArrayList<>();
// first part is always the opcode
String opcode = parts[0];
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java
index e59bb3a..27013a7 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/MultiReturnParameterizedBuiltinCPInstruction.java
@@ -50,7 +50,7 @@ public class MultiReturnParameterizedBuiltinCPInstruction extends ComputationCPI
throws DMLRuntimeException
{
String[] parts = InstructionUtils.getInstructionPartsWithValueType(str);
- ArrayList<CPOperand> outputs = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> outputs = new ArrayList<>();
String opcode = parts[0];
if ( opcode.equalsIgnoreCase("transformencode") ) {
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/cp/SpoofCPInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/SpoofCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/SpoofCPInstruction.java
index 9252915..021ab34 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/cp/SpoofCPInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/SpoofCPInstruction.java
@@ -53,7 +53,7 @@ public class SpoofCPInstruction extends ComputationCPInstruction {
{
String[] parts = InstructionUtils.getInstructionPartsWithValueType(str);
- ArrayList<CPOperand> inlist = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> inlist = new ArrayList<>();
Class<?> cla = CodegenUtils.getClass(parts[1]);
SpoofOperator op = CodegenUtils.createInstance(cla);
String opcode = parts[0] + op.getSpoofType();
@@ -71,8 +71,8 @@ public class SpoofCPInstruction extends ComputationCPInstruction {
throws DMLRuntimeException
{
//get input matrices and scalars, incl pinning of matrices
- ArrayList<MatrixBlock> inputs = new ArrayList<MatrixBlock>();
- ArrayList<ScalarObject> scalars = new ArrayList<ScalarObject>();
+ ArrayList<MatrixBlock> inputs = new ArrayList<>();
+ ArrayList<ScalarObject> scalars = new ArrayList<>();
for (CPOperand input : _in) {
if(input.getDataType()==DataType.MATRIX)
inputs.add(ec.getMatrixInput(input.getName(), getExtendedOpcode()));
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/cp/VariableCPInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cp/VariableCPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cp/VariableCPInstruction.java
index 1ac046a..9525d2a 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/cp/VariableCPInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/cp/VariableCPInstruction.java
@@ -122,7 +122,7 @@ public class VariableCPInstruction extends CPInstruction {
super(sopcode, istr);
_cptype = CPINSTRUCTION_TYPE.Variable;
opcode = op;
- inputs = new ArrayList<CPOperand>();
+ inputs = new ArrayList<>();
addInput(in1);
addInput(in2);
addInput(in3);
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/cpfile/ParameterizedBuiltinCPFileInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/cpfile/ParameterizedBuiltinCPFileInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/cpfile/ParameterizedBuiltinCPFileInstruction.java
index 6383906..64a2b5f 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/cpfile/ParameterizedBuiltinCPFileInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/cpfile/ParameterizedBuiltinCPFileInstruction.java
@@ -273,7 +273,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
informat.configure(job);
InputSplit[] splits = informat.getSplits(job, 1);
- LinkedList<Cell> buffer = new LinkedList<Cell>();
+ LinkedList<Cell> buffer = new LinkedList<>();
LongWritable key = new LongWritable();
Text value = new Text();
@@ -323,7 +323,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
if( !fs.exists(path) )
throw new IOException("File "+fnameOld+" does not exist on HDFS.");
- LinkedList<Cell> buffer = new LinkedList<Cell>();
+ LinkedList<Cell> buffer = new LinkedList<>();
MatrixIndexes key = new MatrixIndexes();
MatrixCell value = new MatrixCell();
@@ -396,7 +396,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
if( !value.isEmptyBlock() ) //skip empty blocks (important for diag)
{
String fname = stagingDir +"/"+key.getRowIndex()+"_"+key.getColumnIndex();
- LocalFileUtils.writeMatrixBlockToLocal(fname, value);
+ LocalFileUtils.writeMatrixBlockToLocal(fname, value);
diagBlocks &= (key.getRowIndex()==key.getColumnIndex());
}
}
@@ -412,7 +412,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
private void appendCellBufferToStagingArea( String dir, LinkedList<Cell> buffer, int brlen, int bclen )
throws DMLRuntimeException, IOException
{
- HashMap<String,LinkedList<Cell>> sortedBuffer = new HashMap<String,LinkedList<Cell>>();
+ HashMap<String,LinkedList<Cell>> sortedBuffer = new HashMap<>();
//sort cells in buffer wrt key
String key = null;
@@ -474,7 +474,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
}
//create and append key mapping
- LinkedList<long[]> keyMapping = new LinkedList<long[]>();
+ LinkedList<long[]> keyMapping = new LinkedList<>();
for( int i = 0; i<flags.length; i++ )
if( !flags[i] )
keyMapping.add(new long[]{blockRow*brlen+i, lastKey++});
@@ -514,7 +514,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
}
//create and append key mapping
- LinkedList<long[]> keyMapping = new LinkedList<long[]>();
+ LinkedList<long[]> keyMapping = new LinkedList<>();
for( int i = 0; i<flags.length; i++ )
if( !flags[i] )
keyMapping.add(new long[]{blockCol*bclen+i, lastKey++});
@@ -568,7 +568,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
//create and append key mapping
- LinkedList<long[]> keyMapping = new LinkedList<long[]>();
+ LinkedList<long[]> keyMapping = new LinkedList<>();
for( int i = 0; i<flags.length; i++ )
if( !flags[i] )
keyMapping.add(new long[]{blockRow*brlen+i, lastKey++});
@@ -606,7 +606,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
//create and append key mapping
- LinkedList<long[]> keyMapping = new LinkedList<long[]>();
+ LinkedList<long[]> keyMapping = new LinkedList<>();
for( int i = 0; i<flags.length; i++ )
if( !flags[i] )
keyMapping.add(new long[]{blockCol*bclen+i, lastKey++});
@@ -646,7 +646,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
MatrixIndexes key = new MatrixIndexes();
MatrixCell value = new MatrixCell();
- HashMap<Integer,HashMap<Long,Long>> keyMap = new HashMap<Integer, HashMap<Long,Long>>();
+ HashMap<Integer,HashMap<Long,Long>> keyMap = new HashMap<>();
BufferedReader fkeyMap = StagingFileUtils.openKeyMap(metaOut);
try
{
@@ -748,7 +748,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
for(int blockCol = 0; blockCol < (int)Math.ceil(clen/(double)bclen); blockCol++)
{
- HashMap<Integer,HashMap<Long,Long>> keyMap = new HashMap<Integer, HashMap<Long,Long>>();
+ HashMap<Integer,HashMap<Long,Long>> keyMap = new HashMap<>();
BufferedReader fkeyMap = StagingFileUtils.openKeyMap(metaOut);
int maxCol = (int)(((long)blockCol*bclen + bclen < clen) ? bclen : clen - (long)blockCol*bclen);
@@ -812,7 +812,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
for(int blockRow = 0; blockRow < (int)Math.ceil(rlen/(double)brlen); blockRow++)
{
- HashMap<Integer,HashMap<Long,Long>> keyMap = new HashMap<Integer, HashMap<Long,Long>>();
+ HashMap<Integer,HashMap<Long,Long>> keyMap = new HashMap<>();
BufferedReader fkeyMap = StagingFileUtils.openKeyMap(metaOut);
int maxRow = (int)(((long)blockRow*brlen + brlen < rlen) ? brlen : rlen - (long)blockRow*brlen);
@@ -888,7 +888,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
//prepare output
SequenceFile.Writer writer = new SequenceFile.Writer(fs, job, path, MatrixIndexes.class, MatrixBlock.class);
MatrixIndexes key = new MatrixIndexes();
- HashSet<Long> writtenBlocks = new HashSet<Long>();
+ HashSet<Long> writtenBlocks = new HashSet<>();
try
{
@@ -896,7 +896,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
{
MatrixBlock[] blocks = MatrixWriter.createMatrixBlocksForReuse(newlen, clen, brlen, bclen,
MatrixBlock.evalSparseFormatInMemory(rlen, clen, nnz), nnz);
- HashMap<Integer,HashMap<Long,Long>> keyMap = new HashMap<Integer, HashMap<Long,Long>>();
+ HashMap<Integer,HashMap<Long,Long>> keyMap = new HashMap<>();
BufferedReader fkeyMap = StagingFileUtils.openKeyMap(metaOut);
int currentSize = -1;
int blockRowOut = 0;
@@ -954,7 +954,7 @@ public class ParameterizedBuiltinCPFileInstruction extends ParameterizedBuiltinC
{
MatrixBlock[] blocks = MatrixWriter.createMatrixBlocksForReuse(rlen, newlen, brlen, bclen,
MatrixBlock.evalSparseFormatInMemory(rlen, clen, nnz), nnz);
- HashMap<Integer,HashMap<Long,Long>> keyMap = new HashMap<Integer, HashMap<Long,Long>>();
+ HashMap<Integer,HashMap<Long,Long>> keyMap = new HashMap<>();
BufferedReader fkeyMap = StagingFileUtils.openKeyMap(metaOut);
int currentSize = -1;
int blockColOut = 0;
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/gpu/ConvolutionGPUInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/gpu/ConvolutionGPUInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/gpu/ConvolutionGPUInstruction.java
index b25f787..d841e69 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/gpu/ConvolutionGPUInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/gpu/ConvolutionGPUInstruction.java
@@ -39,8 +39,8 @@ public class ConvolutionGPUInstruction extends GPUInstruction {
private CPOperand _output;
private ArrayList<CPOperand> _input_shape;
private ArrayList<CPOperand> _filter_shape;
- private ArrayList<CPOperand> _stride = new ArrayList<CPOperand>();
- private ArrayList<CPOperand> _padding = new ArrayList<CPOperand>();
+ private ArrayList<CPOperand> _stride = new ArrayList<>();
+ private ArrayList<CPOperand> _padding = new ArrayList<>();
private double _intermediateMemoryBudget = 0;
public ConvolutionGPUInstruction(CPOperand in1, CPOperand in2, CPOperand out, String opcode, String istr, double intermediateMemoryBudget) throws DMLRuntimeException {
@@ -99,10 +99,10 @@ public class ConvolutionGPUInstruction extends GPUInstruction {
CPOperand in2 = new CPOperand(parts[2]);
CPOperand out = new CPOperand(parts[15]);
- ArrayList<CPOperand> stride = new ArrayList<CPOperand>();
- ArrayList<CPOperand> padding = new ArrayList<CPOperand>();
- ArrayList<CPOperand> input_shape = new ArrayList<CPOperand>();
- ArrayList<CPOperand> filter_shape = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> stride = new ArrayList<>();
+ ArrayList<CPOperand> padding = new ArrayList<>();
+ ArrayList<CPOperand> input_shape = new ArrayList<>();
+ ArrayList<CPOperand> filter_shape = new ArrayList<>();
stride.add(new CPOperand(parts[3]));
stride.add(new CPOperand(parts[4]));
padding.add(new CPOperand(parts[5]));
@@ -126,10 +126,10 @@ public class ConvolutionGPUInstruction extends GPUInstruction {
CPOperand in3 = new CPOperand(parts[3]);
CPOperand out = new CPOperand(parts[16]);
- ArrayList<CPOperand> stride = new ArrayList<CPOperand>();
- ArrayList<CPOperand> padding = new ArrayList<CPOperand>();
- ArrayList<CPOperand> input_shape = new ArrayList<CPOperand>();
- ArrayList<CPOperand> filter_shape = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> stride = new ArrayList<>();
+ ArrayList<CPOperand> padding = new ArrayList<>();
+ ArrayList<CPOperand> input_shape = new ArrayList<>();
+ ArrayList<CPOperand> filter_shape = new ArrayList<>();
stride.add(new CPOperand(parts[4]));
stride.add(new CPOperand(parts[5]));
padding.add(new CPOperand(parts[6]));
@@ -151,10 +151,10 @@ public class ConvolutionGPUInstruction extends GPUInstruction {
CPOperand in1 = new CPOperand(parts[1]);
CPOperand out = new CPOperand(parts[14]);
- ArrayList<CPOperand> stride = new ArrayList<CPOperand>();
- ArrayList<CPOperand> padding = new ArrayList<CPOperand>();
- ArrayList<CPOperand> input_shape = new ArrayList<CPOperand>();
- ArrayList<CPOperand> filter_shape = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> stride = new ArrayList<>();
+ ArrayList<CPOperand> padding = new ArrayList<>();
+ ArrayList<CPOperand> input_shape = new ArrayList<>();
+ ArrayList<CPOperand> filter_shape = new ArrayList<>();
stride.add(new CPOperand(parts[2]));
stride.add(new CPOperand(parts[3]));
padding.add(new CPOperand(parts[4]));
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/gpu/GPUInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/gpu/GPUInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/gpu/GPUInstruction.java
index 108a622..ed2a4a2 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/gpu/GPUInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/gpu/GPUInstruction.java
@@ -48,7 +48,7 @@ public abstract class GPUInstruction extends Instruction {
BuiltinBinary,
Builtin,
MatrixIndexing
- };
+ }
private static final Log LOG = LogFactory.getLog(GPUInstruction.class.getName());
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/mr/MRInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/mr/MRInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/mr/MRInstruction.java
index 0fd160a..e0a97bf 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/mr/MRInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/mr/MRInstruction.java
@@ -35,7 +35,7 @@ public abstract class MRInstruction extends Instruction {
PickByCount, Partition, Ternary, Quaternary, CM_N_COV, MapGroupedAggregate, GroupedAggregate, RightIndex,
ZeroOut, MMTSJ, PMMJ, MatrixReshape, ParameterizedBuiltin, Sort, MapMultChain, CumsumAggregate, CumsumSplit,
CumsumOffset, BinUaggChain, UaggOuterChain, RemoveEmpty
- };
+ }
protected MRINSTRUCTION_TYPE mrtype;
protected Operator optr;
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/spark/ConvolutionSPInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/spark/ConvolutionSPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/spark/ConvolutionSPInstruction.java
index 5206f9f..7bb15cb 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/spark/ConvolutionSPInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/spark/ConvolutionSPInstruction.java
@@ -56,8 +56,8 @@ public class ConvolutionSPInstruction extends UnarySPInstruction {
private CPOperand _in3;
private ArrayList<CPOperand> _input_shape;
private ArrayList<CPOperand> _filter_shape;
- private ArrayList<CPOperand> _stride = new ArrayList<CPOperand>();
- private ArrayList<CPOperand> _padding = new ArrayList<CPOperand>();
+ private ArrayList<CPOperand> _stride = new ArrayList<>();
+ private ArrayList<CPOperand> _padding = new ArrayList<>();
private ConvolutionSPInstruction(CPOperand in, CPOperand out, String opcode, String istr,
ArrayList<CPOperand> stride, ArrayList<CPOperand> padding, ArrayList<CPOperand> input_shape,
@@ -115,10 +115,10 @@ public class ConvolutionSPInstruction extends UnarySPInstruction {
in.split(parts[1]);
out.split(parts[14]);
- ArrayList<CPOperand> stride = new ArrayList<CPOperand>();
- ArrayList<CPOperand> padding = new ArrayList<CPOperand>();
- ArrayList<CPOperand> input_shape = new ArrayList<CPOperand>();
- ArrayList<CPOperand> filter_shape = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> stride = new ArrayList<>();
+ ArrayList<CPOperand> padding = new ArrayList<>();
+ ArrayList<CPOperand> input_shape = new ArrayList<>();
+ ArrayList<CPOperand> filter_shape = new ArrayList<>();
stride.add(new CPOperand(parts[2]));
stride.add(new CPOperand(parts[3]));
padding.add(new CPOperand(parts[4]));
@@ -148,10 +148,10 @@ public class ConvolutionSPInstruction extends UnarySPInstruction {
in2.split(parts[2]);
out.split(parts[15]);
- ArrayList<CPOperand> stride = new ArrayList<CPOperand>();
- ArrayList<CPOperand> padding = new ArrayList<CPOperand>();
- ArrayList<CPOperand> input_shape = new ArrayList<CPOperand>();
- ArrayList<CPOperand> filter_shape = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> stride = new ArrayList<>();
+ ArrayList<CPOperand> padding = new ArrayList<>();
+ ArrayList<CPOperand> input_shape = new ArrayList<>();
+ ArrayList<CPOperand> filter_shape = new ArrayList<>();
stride.add(new CPOperand(parts[3]));
stride.add(new CPOperand(parts[4]));
padding.add(new CPOperand(parts[5]));
@@ -180,10 +180,10 @@ public class ConvolutionSPInstruction extends UnarySPInstruction {
in3.split(parts[3]);
out.split(parts[16]);
- ArrayList<CPOperand> stride = new ArrayList<CPOperand>();
- ArrayList<CPOperand> padding = new ArrayList<CPOperand>();
- ArrayList<CPOperand> input_shape = new ArrayList<CPOperand>();
- ArrayList<CPOperand> filter_shape = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> stride = new ArrayList<>();
+ ArrayList<CPOperand> padding = new ArrayList<>();
+ ArrayList<CPOperand> input_shape = new ArrayList<>();
+ ArrayList<CPOperand> filter_shape = new ArrayList<>();
stride.add(new CPOperand(parts[4]));
stride.add(new CPOperand(parts[5]));
padding.add(new CPOperand(parts[6]));
@@ -396,10 +396,9 @@ public class ConvolutionSPInstruction extends UnarySPInstruction {
throw new RuntimeException("Expected the inputs to be reblocked as rectangular RDD");
}
MatrixBlock out = processRectangularBlock(arg._2);
- if(out.getNumRows() != 1) {
+ if(out.getNumRows() != 1)
throw new RuntimeException("Expected the output to have 1 row");
- }
- return new Tuple2<MatrixIndexes, MatrixBlock>(arg._1, out);
+ return new Tuple2<>(arg._1, out);
}
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/spark/MultiReturnParameterizedBuiltinSPInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/spark/MultiReturnParameterizedBuiltinSPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/spark/MultiReturnParameterizedBuiltinSPInstruction.java
index 6436389..19b0732 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/spark/MultiReturnParameterizedBuiltinSPInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/spark/MultiReturnParameterizedBuiltinSPInstruction.java
@@ -81,7 +81,7 @@ public class MultiReturnParameterizedBuiltinSPInstruction extends ComputationSPI
throws DMLRuntimeException
{
String[] parts = InstructionUtils.getInstructionPartsWithValueType(str);
- ArrayList<CPOperand> outputs = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> outputs = new ArrayList<>();
String opcode = parts[0];
if ( opcode.equalsIgnoreCase("transformencode") ) {
@@ -265,11 +265,11 @@ public class MultiReturnParameterizedBuiltinSPInstruction extends ComputationSPI
}
//output recode maps as columnID - token pairs
- ArrayList<Tuple2<Integer,Object>> ret = new ArrayList<Tuple2<Integer,Object>>();
+ ArrayList<Tuple2<Integer,Object>> ret = new ArrayList<>();
HashMap<Integer,HashSet<Object>> tmp = _raEncoder.getCPRecodeMapsPartial();
for( Entry<Integer,HashSet<Object>> e1 : tmp.entrySet() )
for( Object token : e1.getValue() )
- ret.add(new Tuple2<Integer,Object>(e1.getKey(), token));
+ ret.add(new Tuple2<>(e1.getKey(), token));
_raEncoder.getCPRecodeMapsPartial().clear();
return ret.iterator();
@@ -301,7 +301,7 @@ public class MultiReturnParameterizedBuiltinSPInstruction extends ComputationSPI
String colID = String.valueOf(arg0._1());
Iterator<Object> iter = arg0._2().iterator();
- ArrayList<String> ret = new ArrayList<String>();
+ ArrayList<String> ret = new ArrayList<>();
StringBuilder sb = new StringBuilder();
long rowID = 1;
while( iter.hasNext() ) {
@@ -342,21 +342,21 @@ public class MultiReturnParameterizedBuiltinSPInstruction extends ComputationSPI
}
//extract meta data
- ArrayList<Tuple2<Integer,ColumnMetadata>> ret = new ArrayList<Tuple2<Integer,ColumnMetadata>>();
+ ArrayList<Tuple2<Integer,ColumnMetadata>> ret = new ArrayList<>();
int[] collist = _encoder.getColList();
for( int j=0; j<collist.length; j++ ) {
if( _encoder.getMethod(collist[j]) == MVMethod.GLOBAL_MODE ) {
HashMap<String,Long> hist = _encoder.getHistogram(collist[j]);
for( Entry<String,Long> e : hist.entrySet() )
- ret.add(new Tuple2<Integer,ColumnMetadata>(collist[j],
+ ret.add(new Tuple2<>(collist[j],
new ColumnMetadata(e.getValue(), e.getKey())));
}
else if( _encoder.getMethod(collist[j]) == MVMethod.GLOBAL_MEAN ) {
- ret.add(new Tuple2<Integer,ColumnMetadata>(collist[j],
+ ret.add(new Tuple2<>(collist[j],
new ColumnMetadata(_encoder.getNonMVCount(collist[j]), String.valueOf(_encoder.getMeans()[j]._sum))));
}
else if( _encoder.getMethod(collist[j]) == MVMethod.CONSTANT ) {
- ret.add(new Tuple2<Integer,ColumnMetadata>(collist[j],
+ ret.add(new Tuple2<>(collist[j],
new ColumnMetadata(0, _encoder.getReplacement(collist[j]))));
}
}
@@ -381,11 +381,11 @@ public class MultiReturnParameterizedBuiltinSPInstruction extends ComputationSPI
{
int colix = arg0._1();
Iterator<ColumnMetadata> iter = arg0._2().iterator();
- ArrayList<String> ret = new ArrayList<String>();
+ ArrayList<String> ret = new ArrayList<>();
//compute global mode of categorical feature, i.e., value with highest frequency
if( _encoder.getMethod(colix) == MVMethod.GLOBAL_MODE ) {
- HashMap<String, Long> hist = new HashMap<String,Long>();
+ HashMap<String, Long> hist = new HashMap<>();
while( iter.hasNext() ) {
ColumnMetadata cmeta = iter.next();
Long tmp = hist.get(cmeta.getMvValue());
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/spark/SPInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/spark/SPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/spark/SPInstruction.java
index 0261357..f0ee6e3 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/spark/SPInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/spark/SPInstruction.java
@@ -38,7 +38,7 @@ public abstract class SPInstruction extends Instruction {
MatrixReshape, Ternary, Quaternary, CumsumAggregate, CumsumOffset, BinUaggChain, UaggOuterChain,
Write, SpoofFused, INVALID,
Convolution
- };
+ }
protected SPINSTRUCTION_TYPE _sptype;
protected Operator _optr;
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/spark/SpoofSPInstruction.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/spark/SpoofSPInstruction.java b/src/main/java/org/apache/sysml/runtime/instructions/spark/SpoofSPInstruction.java
index a628dc0..416e4a6 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/spark/SpoofSPInstruction.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/spark/SpoofSPInstruction.java
@@ -88,7 +88,7 @@ public class SpoofSPInstruction extends SPInstruction {
String[] parts = InstructionUtils.getInstructionPartsWithValueType(str);
//String opcode = parts[0];
- ArrayList<CPOperand> inlist = new ArrayList<CPOperand>();
+ ArrayList<CPOperand> inlist = new ArrayList<>();
Class<?> cls = CodegenUtils.getClass(parts[1]);
byte[] classBytes = CodegenUtils.getClassData(parts[1]);
String opcode = parts[0] + CodegenUtils.createInstance(cls).getSpoofType();
@@ -410,7 +410,7 @@ public class SpoofSPInstruction extends SPInstruction {
protected ArrayList<MatrixBlock> getAllMatrixInputs(MatrixIndexes ixIn, MatrixBlock[] blkIn, boolean outer)
throws DMLRuntimeException
{
- ArrayList<MatrixBlock> ret = new ArrayList<MatrixBlock>();
+ ArrayList<MatrixBlock> ret = new ArrayList<>();
//add all rdd/broadcast inputs (main and side inputs)
for( int i=0, posRdd=0, posBc=0; i<_bcInd.length; i++ ) {
if( _bcInd[i] ) {
@@ -458,7 +458,7 @@ public class SpoofSPInstruction extends SPInstruction {
_op.getRowType().isRowTypeB1() ? _inputs.get(0).getNumCols() : -1);
LibSpoofPrimitives.setupThreadLocalMemory(_op.getNumIntermediates(), _clen, clen2);
- ArrayList<Tuple2<MatrixIndexes,MatrixBlock>> ret = new ArrayList<Tuple2<MatrixIndexes,MatrixBlock>>();
+ ArrayList<Tuple2<MatrixIndexes,MatrixBlock>> ret = new ArrayList<>();
boolean aggIncr = (_op.getRowType().isColumnAgg() //aggregate entire partition
|| _op.getRowType() == RowType.FULL_AGG);
MatrixBlock blkOut = aggIncr ? new MatrixBlock() : null;
@@ -476,14 +476,14 @@ public class SpoofSPInstruction extends SPInstruction {
if( !aggIncr ) {
MatrixIndexes ixOut = new MatrixIndexes(ixIn.getRowIndex(),
_op.getRowType()!=RowType.NO_AGG ? 1 : ixIn.getColumnIndex());
- ret.add(new Tuple2<MatrixIndexes, MatrixBlock>(ixOut, blkOut));
+ ret.add(new Tuple2<>(ixOut, blkOut));
}
}
//cleanup and final result preparations
LibSpoofPrimitives.cleanupThreadLocalMemory();
if( aggIncr )
- ret.add(new Tuple2<MatrixIndexes, MatrixBlock>(new MatrixIndexes(1,1), blkOut));
+ ret.add(new Tuple2<>(new MatrixIndexes(1,1), blkOut));
return ret.iterator();
}
@@ -512,7 +512,7 @@ public class SpoofSPInstruction extends SPInstruction {
_op = (SpoofOperator) CodegenUtils.createInstance(loadedClass);
}
- List<Tuple2<MatrixIndexes, MatrixBlock>> ret = new ArrayList<Tuple2<MatrixIndexes,MatrixBlock>>();
+ List<Tuple2<MatrixIndexes, MatrixBlock>> ret = new ArrayList<>();
while(arg.hasNext())
{
Tuple2<MatrixIndexes,MatrixBlock[]> tmp = arg.next();
@@ -535,7 +535,7 @@ public class SpoofSPInstruction extends SPInstruction {
ixOut = new MatrixIndexes(1, ixOut.getColumnIndex());
blkOut = _op.execute(inputs, _scalars, blkOut);
}
- ret.add(new Tuple2<MatrixIndexes,MatrixBlock>(ixOut, blkOut));
+ ret.add(new Tuple2<>(ixOut, blkOut));
}
return ret.iterator();
}
@@ -569,7 +569,7 @@ public class SpoofSPInstruction extends SPInstruction {
MatrixBlock blkOut = new MatrixBlock();
blkOut = _op.execute(inputs, _scalars, blkOut);
- return new Tuple2<MatrixIndexes,MatrixBlock>(arg._1(), blkOut);
+ return new Tuple2<>(arg._1(), blkOut);
}
}
@@ -626,7 +626,7 @@ public class SpoofSPInstruction extends SPInstruction {
_op = (SpoofOperator) CodegenUtils.createInstance(loadedClass);
}
- List<Tuple2<MatrixIndexes, MatrixBlock>> ret = new ArrayList<Tuple2<MatrixIndexes,MatrixBlock>>();
+ List<Tuple2<MatrixIndexes, MatrixBlock>> ret = new ArrayList<>();
while(arg.hasNext())
{
Tuple2<MatrixIndexes,MatrixBlock[]> tmp = arg.next();
@@ -645,7 +645,7 @@ public class SpoofSPInstruction extends SPInstruction {
blkOut = _op.execute(inputs, _scalars, blkOut);
}
- ret.add(new Tuple2<MatrixIndexes,MatrixBlock>(createOutputIndexes(ixIn,_op), blkOut));
+ ret.add(new Tuple2<>(createOutputIndexes(ixIn,_op), blkOut));
}
return ret.iterator();
@@ -677,7 +677,7 @@ public class SpoofSPInstruction extends SPInstruction {
public Iterator<Tuple2<MatrixIndexes, MatrixBlock>> call( Tuple2<MatrixIndexes, MatrixBlock> arg0 )
throws Exception
{
- LinkedList<Tuple2<MatrixIndexes, MatrixBlock>> ret = new LinkedList<Tuple2<MatrixIndexes, MatrixBlock>>();
+ LinkedList<Tuple2<MatrixIndexes, MatrixBlock>> ret = new LinkedList<>();
MatrixIndexes ixIn = arg0._1();
MatrixBlock blkIn = arg0._2();
@@ -688,7 +688,7 @@ public class SpoofSPInstruction extends SPInstruction {
for( long i=1; i<=numBlocks; i++ ) {
MatrixIndexes tmpix = new MatrixIndexes(i, j);
MatrixBlock tmpblk = blkIn;
- ret.add( new Tuple2<MatrixIndexes, MatrixBlock>(tmpix, tmpblk) );
+ ret.add( new Tuple2<>(tmpix, tmpblk) );
}
//output list of new tuples
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/instructions/spark/data/BlockPartitioner.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/instructions/spark/data/BlockPartitioner.java b/src/main/java/org/apache/sysml/runtime/instructions/spark/data/BlockPartitioner.java
index 48b30b0..677fbbf 100644
--- a/src/main/java/org/apache/sysml/runtime/instructions/spark/data/BlockPartitioner.java
+++ b/src/main/java/org/apache/sysml/runtime/instructions/spark/data/BlockPartitioner.java
@@ -19,6 +19,8 @@
package org.apache.sysml.runtime.instructions.spark.data;
+import java.util.Arrays;
+
import org.apache.spark.Partitioner;
import org.apache.sysml.runtime.matrix.MatrixCharacteristics;
@@ -100,6 +102,12 @@ public class BlockPartitioner extends Partitioner
public int numPartitions() {
return _numParts;
}
+
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(new long[]{
+ _numParts, _ncparts, _rbPerPart, _cbPerPart});
+ }
@Override
public boolean equals(Object obj)
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/io/IOUtilFunctions.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/io/IOUtilFunctions.java b/src/main/java/org/apache/sysml/runtime/io/IOUtilFunctions.java
index ecbf7e4..3ac4dc4 100644
--- a/src/main/java/org/apache/sysml/runtime/io/IOUtilFunctions.java
+++ b/src/main/java/org/apache/sysml/runtime/io/IOUtilFunctions.java
@@ -420,7 +420,7 @@ public class IOUtilFunctions
* @return the number of columns in the collection of csv file splits
* @throws IOException if IOException occurs
*/
- @SuppressWarnings({ "rawtypes", "unchecked" })
+ @SuppressWarnings({ "rawtypes" })
public static int countNumColumnsCSV(InputSplit[] splits, InputFormat informat, JobConf job, String delim )
throws IOException
{
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/CombineMR.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/CombineMR.java b/src/main/java/org/apache/sysml/runtime/matrix/CombineMR.java
index d40857f..f18a811 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/CombineMR.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/CombineMR.java
@@ -73,8 +73,8 @@ public class CombineMR
protected MRInstruction[] comb_instructions=null;
private MatrixIndexes keyBuff=new MatrixIndexes();
private WeightedPair valueBuff=new WeightedPair();
- private HashMap<Byte, Pair<Integer, Integer>> outputBlockSizes=new HashMap<Byte, Pair<Integer, Integer>>();
- private HashMap<Byte, ArrayList<Integer>> outputIndexesMapping=new HashMap<Byte, ArrayList<Integer>>();
+ private HashMap<Byte, Pair<Integer, Integer>> outputBlockSizes=new HashMap<>();
+ private HashMap<Byte, ArrayList<Integer>> outputIndexesMapping=new HashMap<>();
@Override
public void reduce(MatrixIndexes indexes,
Iterator<TaggedMatrixValue> values,
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/GMR.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/GMR.java b/src/main/java/org/apache/sysml/runtime/matrix/GMR.java
index 1024070..f0c214e 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/GMR.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/GMR.java
@@ -330,12 +330,12 @@ public class GMR
&& InstructionUtils.isDistributedCacheUsed(allInsts) )
{
//get all indexes of distributed cache inputs
- ArrayList<Byte> indexList = new ArrayList<Byte>();
+ ArrayList<Byte> indexList = new ArrayList<>();
String[] inst = allInsts.split(Instruction.INSTRUCTION_DELIM);
for( String tmp : inst ) {
if( InstructionUtils.isDistributedCacheUsed(tmp) )
{
- ArrayList<Byte> tmpindexList = new ArrayList<Byte>();
+ ArrayList<Byte> tmpindexList = new ArrayList<>();
MRInstruction mrinst = MRInstructionParser.parseSingleInstruction(tmp);
if( mrinst instanceof IDistributedCacheConsumer )
@@ -349,7 +349,7 @@ public class GMR
}
//construct index and path strings
- ArrayList<String> pathList = new ArrayList<String>(); // list of paths to be placed in Distributed cache
+ ArrayList<String> pathList = new ArrayList<>(); // list of paths to be placed in Distributed cache
StringBuilder indexString = new StringBuilder(); // input indices to be placed in Distributed Cache (concatenated)
StringBuilder pathString = new StringBuilder(); // input paths to be placed in Distributed Cache (concatenated)
for( byte index : indexList )
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/WriteCSVMR.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/WriteCSVMR.java b/src/main/java/org/apache/sysml/runtime/matrix/WriteCSVMR.java
index 2eaddb7..c4f9a56 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/WriteCSVMR.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/WriteCSVMR.java
@@ -99,7 +99,7 @@ public class WriteCSVMR
byte[] resultDimsUnknown = new byte[resultIndexes.length];
MatrixCharacteristics[] stats=new MatrixCharacteristics[resultIndexes.length];
OutputInfo[] outputInfos=new OutputInfo[outputs.length];
- HashMap<Byte, Integer> indexmap=new HashMap<Byte, Integer>();
+ HashMap<Byte, Integer> indexmap=new HashMap<>();
for(int i=0; i<stats.length; i++)
{
indexmap.put(resultIndexes[i], i);
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/data/AddDummyWeightConverter.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/AddDummyWeightConverter.java b/src/main/java/org/apache/sysml/runtime/matrix/data/AddDummyWeightConverter.java
index cadc0e9..2dd29af 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/AddDummyWeightConverter.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/AddDummyWeightConverter.java
@@ -61,7 +61,6 @@ public class AddDummyWeightConverter implements Converter<Writable, Writable, Ma
}
@Override
- @SuppressWarnings("unchecked")
public Pair<MatrixIndexes, WeightedPair> next() {
Pair<MatrixIndexes, MatrixCell> temp=toCellConverter.next();
pair.setKey(temp.getKey());
@@ -71,12 +70,11 @@ public class AddDummyWeightConverter implements Converter<Writable, Writable, Ma
@Override
public void setBlockSize(int rl, int cl) {
-
- if(toCellConverter==null)
- {
+ if(toCellConverter==null) {
rlen=rl;
clen=cl;
- }else
+ }
+ else
toCellConverter.setBlockSize(rl, cl);
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/data/FileFormatProperties.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/FileFormatProperties.java b/src/main/java/org/apache/sysml/runtime/matrix/data/FileFormatProperties.java
index 2f405da..c03aa99 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/FileFormatProperties.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/FileFormatProperties.java
@@ -21,10 +21,9 @@ package org.apache.sysml.runtime.matrix.data;
public class FileFormatProperties
{
-
private String description;
- public enum FileFormat { CSV, NATIVE };
+ public enum FileFormat { CSV, NATIVE }
FileFormat fmt;
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixDNNHelper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixDNNHelper.java b/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixDNNHelper.java
index 0550a98..ff932fa 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixDNNHelper.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixDNNHelper.java
@@ -44,7 +44,7 @@ public class LibMatrixDNNHelper {
* @throws DMLRuntimeException if error occurs
*/
public static ArrayList<Callable<Long>> getMaxPoolingWorkers(ConvolutionParameters params) throws DMLRuntimeException {
- ArrayList<Callable<Long>> ret = new ArrayList<Callable<Long>>();
+ ArrayList<Callable<Long>> ret = new ArrayList<>();
int k = OptimizerUtils.getConstrainedNumThreads(params.numThreads);
int taskSize = (int)(Math.ceil((double)params.N / k));
for(int i = 0; i*taskSize < params.N; i++) {
@@ -65,7 +65,7 @@ public class LibMatrixDNNHelper {
* @throws DMLRuntimeException if error occurs
*/
public static ArrayList<Callable<Long>> getMaxPoolingBackwardWorkers(ConvolutionParameters params, boolean performReluBackward) throws DMLRuntimeException {
- ArrayList<Callable<Long>> ret = new ArrayList<Callable<Long>>();
+ ArrayList<Callable<Long>> ret = new ArrayList<>();
int k = OptimizerUtils.getConstrainedNumThreads(params.numThreads);
int taskSize = (int)(Math.ceil((double)params.N / k));
for(int i = 0; i*taskSize < params.N; i++) {
@@ -93,7 +93,7 @@ public class LibMatrixDNNHelper {
* @throws DMLRuntimeException if error occurs
*/
public static ArrayList<Callable<Long>> getReluBackwardWorkers(ConvolutionParameters params) throws DMLRuntimeException {
- ArrayList<Callable<Long>> ret = new ArrayList<Callable<Long>>();
+ ArrayList<Callable<Long>> ret = new ArrayList<>();
int k = OptimizerUtils.getConstrainedNumThreads(params.numThreads);
int taskSize = (int)(Math.ceil((double)params.N / k));
for(int i = 0; i*taskSize < params.N; i++) {
@@ -110,7 +110,7 @@ public class LibMatrixDNNHelper {
* @throws DMLRuntimeException if error occurs
*/
public static ArrayList<Callable<Long>> getConv2dWorkers(ConvolutionParameters params) throws DMLRuntimeException {
- ArrayList<Callable<Long>> ret = new ArrayList<Callable<Long>>();
+ ArrayList<Callable<Long>> ret = new ArrayList<>();
// Try to create as many tasks as threads.
// Creating more tasks will help in tail, but would have additional overhead of maintaining the intermediate
@@ -148,7 +148,7 @@ public class LibMatrixDNNHelper {
* @throws DMLRuntimeException if error occurs
*/
public static ArrayList<Callable<Long>> getConv2dBackwardFilterWorkers(ConvolutionParameters params) throws DMLRuntimeException {
- ArrayList<Callable<Long>> ret = new ArrayList<Callable<Long>>();
+ ArrayList<Callable<Long>> ret = new ArrayList<>();
// Try to create as many tasks as threads.
// Creating more tasks will help in tail, but would have additional overhead of maintaining the intermediate
// data structures such as im2col blocks.
@@ -177,7 +177,7 @@ public class LibMatrixDNNHelper {
* @throws DMLRuntimeException if error occurs
*/
public static ArrayList<Callable<Long>> getConv2dBackwardDataWorkers(ConvolutionParameters params) throws DMLRuntimeException {
- ArrayList<Callable<Long>> ret = new ArrayList<Callable<Long>>();
+ ArrayList<Callable<Long>> ret = new ArrayList<>();
// Try to create as many tasks as threads.
// Creating more tasks will help in tail, but would have additional overhead of maintaining the intermediate
@@ -256,7 +256,7 @@ public class LibMatrixDNNHelper {
//Split a filter of size [K, CRS] into c filters of [K, RS]
private static ArrayList<MatrixBlock> splitFilter(ConvolutionParameters _params) {
- ArrayList<MatrixBlock> ret = new ArrayList<MatrixBlock>();
+ ArrayList<MatrixBlock> ret = new ArrayList<>();
int RS = _params.R*_params.S; int CRS = _params.C*_params.R*_params.S;
double [] filter = _params.input2.getDenseBlock(); int S = _params.S;
for(int c = 0; c < _params.C; c++) {
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixOuterAgg.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixOuterAgg.java b/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixOuterAgg.java
index 3c3b1ab..37a55ba 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixOuterAgg.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/LibMatrixOuterAgg.java
@@ -1059,7 +1059,7 @@ public class LibMatrixOuterAgg
int cnt = 0;
if( ix >= 0 ){ //match, scan to next val
- while( value==bv[ix++] && ix<bv.length );
+ while( value==bv[ix++] && ix<bv.length ) {}
ix += (value==bv[bv.length-1])?1:0;
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/data/OutputInfo.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/OutputInfo.java b/src/main/java/org/apache/sysml/runtime/matrix/data/OutputInfo.java
index 675f0f5..1b0424a 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/OutputInfo.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/OutputInfo.java
@@ -21,6 +21,7 @@
package org.apache.sysml.runtime.matrix.data;
import java.io.Serializable;
+import java.util.Arrays;
import org.apache.hadoop.io.DoubleWritable;
import org.apache.hadoop.io.IntWritable;
@@ -36,12 +37,9 @@ import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.matrix.mapred.CSVWriteReducer.RowBlockForTextOutput;
import org.apache.sysml.runtime.matrix.sort.CompactOutputFormat;
-
-
@SuppressWarnings("rawtypes")
public class OutputInfo implements Serializable
{
-
private static final long serialVersionUID = -3115943514779675817L;
public Class<? extends OutputFormat> outputFormatClass;
@@ -156,6 +154,15 @@ public class OutputInfo implements Serializable
return "specialized";
}
+ @Override
+ public int hashCode() {
+ return Arrays.hashCode(new int[] {
+ outputFormatClass.hashCode(),
+ outputKeyClass.hashCode(),
+ outputValueClass.hashCode()
+ });
+ }
+
@Override
public boolean equals( Object o )
{
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/data/TaggedFirstSecondIndexes.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/TaggedFirstSecondIndexes.java b/src/main/java/org/apache/sysml/runtime/matrix/data/TaggedFirstSecondIndexes.java
index 14d35b4..bea0c48 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/TaggedFirstSecondIndexes.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/TaggedFirstSecondIndexes.java
@@ -41,12 +41,11 @@ import org.apache.sysml.runtime.util.UtilFunctions;
//sorted by first index, tag, and second index
public class TaggedFirstSecondIndexes implements WritableComparable<TaggedFirstSecondIndexes>
{
-
protected long first=-1;
protected byte tag=-1;
protected long second=-1;
- public TaggedFirstSecondIndexes(){};
+ public TaggedFirstSecondIndexes(){}
public TaggedFirstSecondIndexes(long i1, byte t, long i2)
{
setIndexes(i1,i2);
@@ -182,7 +181,7 @@ public class TaggedFirstSecondIndexes implements WritableComparable<TaggedFirstS
for(int i=0; i<matrices.length; i++)
inRstep[i]=(long) Math.ceil((double)MRJobConfiguration.getNumRows(job, (byte)i)/(double)partitions);
byte maxIndex=0;
- HashMap<Byte, Long> outRsteps=new HashMap<Byte, Long>();
+ HashMap<Byte, Long> outRsteps=new HashMap<>();
try {
CSVWriteInstruction[] ins = MRJobConfiguration.getCSVWriteInstructions(job);
for(CSVWriteInstruction in: ins)
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/data/hadoopfix/DelegatingInputFormat.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/data/hadoopfix/DelegatingInputFormat.java b/src/main/java/org/apache/sysml/runtime/matrix/data/hadoopfix/DelegatingInputFormat.java
index 7c38651..d5149ec 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/data/hadoopfix/DelegatingInputFormat.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/data/hadoopfix/DelegatingInputFormat.java
@@ -51,12 +51,11 @@ public class DelegatingInputFormat<K, V> implements InputFormat<K, V> {
public InputSplit[] getSplits(JobConf conf, int numSplits) throws IOException {
JobConf confCopy = new JobConf(conf);
- List<InputSplit> splits = new ArrayList<InputSplit>();
+ List<InputSplit> splits = new ArrayList<>();
Map<Path, InputFormat> formatMap = MultipleInputs.getInputFormatMap(conf);
Map<Path, Class<? extends Mapper>> mapperMap = MultipleInputs
.getMapperTypeMap(conf);
- Map<Class<? extends InputFormat>, List<Path>> formatPaths
- = new HashMap<Class<? extends InputFormat>, List<Path>>();
+ Map<Class<? extends InputFormat>, List<Path>> formatPaths = new HashMap<>();
// First, build a map of InputFormats to Paths
for (Entry<Path, InputFormat> entry : formatMap.entrySet()) {
@@ -74,8 +73,7 @@ public class DelegatingInputFormat<K, V> implements InputFormat<K, V> {
formatClass, conf);
List<Path> paths = formatEntry.getValue();
- Map<Class<? extends Mapper>, List<Path>> mapperPaths
- = new HashMap<Class<? extends Mapper>, List<Path>>();
+ Map<Class<? extends Mapper>, List<Path>> mapperPaths = new HashMap<>();
// Now, for each set of paths that have a common InputFormat, build
// a map of Mappers to the paths they're used for
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/CMCOVMRMapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CMCOVMRMapper.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CMCOVMRMapper.java
index 8f29d58..5f36a40 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CMCOVMRMapper.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CMCOVMRMapper.java
@@ -45,12 +45,12 @@ implements Mapper<Writable, Writable, Writable, Writable>
{
private boolean firsttime=true;
- private HashMap<Byte, CM> cmFn = new HashMap<Byte, CM>();
+ private HashMap<Byte, CM> cmFn = new HashMap<>();
private COV covFn=COV.getCOMFnObject();
private OutputCollector<Writable, Writable> cachedCollector=null;
private CachedValueMap cmNcovCache=new CachedValueMap();
- protected HashSet<Byte> cmTags=new HashSet<Byte>();
- protected HashSet<Byte> covTags=new HashSet<Byte>();
+ protected HashSet<Byte> cmTags=new HashSet<>();
+ protected HashSet<Byte> covTags=new HashSet<>();
@Override
public void map(Writable index, Writable cell,
OutputCollector<Writable, Writable> out, Reporter report)
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/CMCOVMRReducer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CMCOVMRReducer.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CMCOVMRReducer.java
index 547a8b3..4194b08 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CMCOVMRReducer.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CMCOVMRReducer.java
@@ -53,11 +53,11 @@ implements Reducer<TaggedFirstSecondIndexes, MatrixValue, MatrixIndexes, MatrixV
private CM_N_COVInstruction[] cmNcovInstructions=null;
private CM_N_COVCell cmNcovCell=new CM_N_COVCell();
private COV covFn=COV.getCOMFnObject();
- private HashMap<Byte, CM> cmFn = new HashMap<Byte, CM>();
+ private HashMap<Byte, CM> cmFn = new HashMap<>();
private MatrixIndexes outIndex=new MatrixIndexes(1, 1);
private MatrixCell outCell=new MatrixCell();
- private HashMap<Byte, ArrayList<Integer>> outputIndexesMapping=new HashMap<Byte, ArrayList<Integer>>();
- protected HashSet<Byte> covTags=new HashSet<Byte>();
+ private HashMap<Byte, ArrayList<Integer>> outputIndexesMapping=new HashMap<>();
+ protected HashSet<Byte> covTags=new HashSet<>();
private CM_COV_Object zeroObj=null;
//the dimension for all the representative matrices
@@ -137,8 +137,8 @@ implements Reducer<TaggedFirstSecondIndexes, MatrixValue, MatrixIndexes, MatrixV
} catch (Exception e) {
throw new RuntimeException(e);
}
- rlens=new HashMap<Byte, Long>();
- clens=new HashMap<Byte, Long>();
+ rlens=new HashMap<>();
+ clens=new HashMap<>();
for(CM_N_COVInstruction ins: cmNcovInstructions)
{
if(ins.getOperator() instanceof COVOperator)
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVAssignRowIDReducer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVAssignRowIDReducer.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVAssignRowIDReducer.java
index c29e83c..0674b9a 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVAssignRowIDReducer.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVAssignRowIDReducer.java
@@ -37,7 +37,7 @@ public class CSVAssignRowIDReducer extends MapReduceBase implements Reducer<Byte
{
- private ArrayList<OffsetCount> list = new ArrayList<OffsetCount>();
+ private ArrayList<OffsetCount> list = new ArrayList<>();
@Override
@SuppressWarnings("unchecked")
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVWriteMapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVWriteMapper.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVWriteMapper.java
index c742531..0c1bf2c 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVWriteMapper.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVWriteMapper.java
@@ -37,13 +37,10 @@ import org.apache.sysml.runtime.matrix.data.TaggedFirstSecondIndexes;
public class CSVWriteMapper extends MapperBase implements Mapper<Writable, Writable, TaggedFirstSecondIndexes, MatrixBlock>
{
-
-
- HashMap<Byte, ArrayList<Byte>> inputOutputMap=new HashMap<Byte, ArrayList<Byte>>();
+ HashMap<Byte, ArrayList<Byte>> inputOutputMap=new HashMap<>();
TaggedFirstSecondIndexes outIndexes=new TaggedFirstSecondIndexes();
@Override
- @SuppressWarnings("unchecked")
public void map(Writable rawKey, Writable rawValue,
OutputCollector<TaggedFirstSecondIndexes, MatrixBlock> out,
Reporter reporter) throws IOException
@@ -88,9 +85,8 @@ public class CSVWriteMapper extends MapperBase implements Mapper<Writable, Writa
for(CSVWriteInstruction in: ins)
{
ArrayList<Byte> outputs=inputOutputMap.get(in.input);
- if(outputs==null)
- {
- outputs=new ArrayList<Byte>();
+ if(outputs==null) {
+ outputs=new ArrayList<>();
inputOutputMap.put(in.input, outputs);
}
outputs.add(in.output);
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVWriteReducer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVWriteReducer.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVWriteReducer.java
index 64c42df..c5f26d8 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVWriteReducer.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CSVWriteReducer.java
@@ -173,7 +173,7 @@ public class CSVWriteReducer extends ReduceBase implements Reducer<TaggedFirstSe
{
super.configure(job);
byte maxIndex=0;
- HashMap<Byte, CSVWriteInstruction> out2Ins=new HashMap<Byte, CSVWriteInstruction>();
+ HashMap<Byte, CSVWriteInstruction> out2Ins=new HashMap<>();
try {
CSVWriteInstruction[] ins = MRJobConfiguration.getCSVWriteInstructions(job);
for(CSVWriteInstruction in: ins)
@@ -252,7 +252,7 @@ public class CSVWriteReducer extends ReduceBase implements Reducer<TaggedFirstSe
START,
NEWLINE,
MIDDLE
- };
+ }
private MatrixBlock _data = null;
private int _numCols = 0;
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/CachedValueMap.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CachedValueMap.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CachedValueMap.java
index 54e62a8..b856774 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CachedValueMap.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CachedValueMap.java
@@ -30,12 +30,10 @@ import org.apache.sysml.runtime.matrix.data.MatrixValue;
public class CachedValueMap //extends CachedMap<IndexedMatrixValue>
{
-
private HashMap<Byte, ArrayList<IndexedMatrixValue>> map = null;
- public CachedValueMap()
- {
- map = new HashMap<Byte, ArrayList<IndexedMatrixValue>>();
+ public CachedValueMap() {
+ map = new HashMap<>();
}
public IndexedMatrixValue getFirst(byte tag)
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/CollectMultipleConvertedOutputs.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CollectMultipleConvertedOutputs.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CollectMultipleConvertedOutputs.java
index 6079677..e630029 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/CollectMultipleConvertedOutputs.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/CollectMultipleConvertedOutputs.java
@@ -53,26 +53,19 @@ public class CollectMultipleConvertedOutputs
Converter<Writable, Writable, Writable, Writable> conv=outputConverters[output];
conv.setBlockSize(matrixStats[output].getRowsPerBlock(), matrixStats[output].getColsPerBlock());
conv.convert(key, value);
- // System.out.println("output before convert: "+key+" "+value);
- while(conv.hasNext())
- {
+ while(conv.hasNext()) {
Pair<Writable, Writable> outpair=conv.next();
multipleOutputs.getCollector(Integer.toString(output), reporter).collect(outpair.getKey(), outpair.getValue());
- // System.out.println("output in collectOutput "+outpair.getKey().toString()+":"+outpair.getValue());
}
}
- @SuppressWarnings("unchecked")
public void directOutput(Writable key, Writable value, int output, Reporter reporter)
throws IOException
{
multipleOutputs.getCollector(Integer.toString(output), reporter).collect(key, value);
}
- public void close()
- throws IOException
- {
+ public void close() throws IOException {
multipleOutputs.close();
}
-
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/GMRCtableBuffer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/GMRCtableBuffer.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/GMRCtableBuffer.java
index d5c00de..3c682ce 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/GMRCtableBuffer.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/GMRCtableBuffer.java
@@ -57,9 +57,9 @@ public class GMRCtableBuffer
public GMRCtableBuffer( CollectMultipleConvertedOutputs collector, boolean outputDimsKnown )
{
if ( outputDimsKnown )
- _blockBuffer = new HashMap<Byte, MatrixBlock>();
+ _blockBuffer = new HashMap<>();
else
- _mapBuffer = new HashMap<Byte, CTableMap>();
+ _mapBuffer = new HashMap<>();
_collector = collector;
}
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/GMRMapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/GMRMapper.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/GMRMapper.java
index e843264..0c30023 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/GMRMapper.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/GMRMapper.java
@@ -192,7 +192,7 @@ implements Mapper<Writable, Writable, Writable, Writable>
resultsMaxRowDims=new long[resultIndexes.length];
resultsMaxColDims=new long[resultIndexes.length];
- tagMapping=new HashMap<Byte, ArrayList<Integer>>();
+ tagMapping=new HashMap<>();
for(int i=0; i<resultIndexes.length; i++)
{
byte output=resultIndexes[i];
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRCombiner.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRCombiner.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRCombiner.java
index 6cb0830..f16bab1 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRCombiner.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRCombiner.java
@@ -43,11 +43,11 @@ public class GroupedAggMRCombiner extends ReduceBase
implements Reducer<TaggedMatrixIndexes, WeightedCell, TaggedMatrixIndexes, WeightedCell>
{
//grouped aggregate instructions
- private HashMap<Byte, GroupedAggregateInstruction> grpaggInstructions = new HashMap<Byte, GroupedAggregateInstruction>();
+ private HashMap<Byte, GroupedAggregateInstruction> grpaggInstructions = new HashMap<>();
//reused intermediate objects
private CM_COV_Object cmObj = new CM_COV_Object();
- private HashMap<Byte, CM> cmFn = new HashMap<Byte, CM>();
+ private HashMap<Byte, CM> cmFn = new HashMap<>();
private WeightedCell outCell = new WeightedCell();
@Override
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRMapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRMapper.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRMapper.java
index 1a3b306..454093d 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRMapper.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRMapper.java
@@ -42,7 +42,7 @@ public class GroupedAggMRMapper extends MapperBase
{
//block instructions that need to be performed in part by mapper
- protected ArrayList<ArrayList<GroupedAggregateInstruction>> groupAgg_instructions=new ArrayList<ArrayList<GroupedAggregateInstruction>>();
+ protected ArrayList<ArrayList<GroupedAggregateInstruction>> groupAgg_instructions=new ArrayList<>();
private MatrixIndexes outKeyValue=new MatrixIndexes();
private TaggedMatrixIndexes outKey=new TaggedMatrixIndexes(outKeyValue, (byte)0);
private WeightedCell outValue=new WeightedCell();
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRReducer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRReducer.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRReducer.java
index bebace2..f0db5e3 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRReducer.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/GroupedAggMRReducer.java
@@ -48,10 +48,10 @@ public class GroupedAggMRReducer extends ReduceBase
private MatrixIndexes outIndex=new MatrixIndexes(1, 1);
private MatrixCell outCell=new MatrixCell();
- private HashMap<Byte, GroupedAggregateInstruction> grpaggInstructions=new HashMap<Byte, GroupedAggregateInstruction>();
+ private HashMap<Byte, GroupedAggregateInstruction> grpaggInstructions=new HashMap<>();
private CM_COV_Object cmObj=new CM_COV_Object();
- private HashMap<Byte, CM> cmFn = new HashMap<Byte, CM>();
- private HashMap<Byte, ArrayList<Integer>> outputIndexesMapping=new HashMap<Byte, ArrayList<Integer>>();
+ private HashMap<Byte, CM> cmFn = new HashMap<>();
+ private HashMap<Byte, ArrayList<Integer>> outputIndexesMapping=new HashMap<>();
@Override
public void reduce(TaggedMatrixIndexes key,Iterator<WeightedCell> values,
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRMapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRMapper.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRMapper.java
index e83713c..af46b7d 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRMapper.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MMRJMRMapper.java
@@ -45,9 +45,9 @@ implements Mapper<Writable, Writable, Writable, Writable>
//the aggregate binary instruction for this mmcj job
private TripleIndexes triplebuffer=new TripleIndexes();
private TaggedMatrixValue taggedValue=null;
- private HashMap<Byte, Long> numRepeats=new HashMap<Byte, Long>();
- private HashSet<Byte> aggBinInput1s=new HashSet<Byte>();
- private HashSet<Byte> aggBinInput2s=new HashSet<Byte>();
+ private HashMap<Byte, Long> numRepeats=new HashMap<>();
+ private HashSet<Byte> aggBinInput1s=new HashSet<>();
+ private HashSet<Byte> aggBinInput2s=new HashSet<>();
@Override
protected void specialOperationsForActualMap(int index,
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRBaseForCommonInstructions.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRBaseForCommonInstructions.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRBaseForCommonInstructions.java
index 58f8624..ef90349 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRBaseForCommonInstructions.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRBaseForCommonInstructions.java
@@ -67,9 +67,9 @@ public class MRBaseForCommonInstructions extends MapReduceBase
//distributed cache data handling
public static boolean isJobLocal = false; //set from MapperBase
- public static HashMap<Byte, DistributedCacheInput> dcValues = new HashMap<Byte, DistributedCacheInput>();
+ public static HashMap<Byte, DistributedCacheInput> dcValues = new HashMap<>();
- protected HashMap<Byte, MatrixCharacteristics> dimensions=new HashMap<Byte, MatrixCharacteristics>();
+ protected HashMap<Byte, MatrixCharacteristics> dimensions=new HashMap<>();
//temporary variables
protected IndexedMatrixValue tempValue=null;
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRJobConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRJobConfiguration.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRJobConfiguration.java
index 5cd5daf..269fe52 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRJobConfiguration.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MRJobConfiguration.java
@@ -708,7 +708,7 @@ public class MRJobConfiguration
thisFile = thisFile.makeQualified(fs);
Path thisDir=thisFile.getParent().makeQualified(fs);
- ArrayList<Byte> representativeMatrixes=new ArrayList<Byte>();
+ ArrayList<Byte> representativeMatrixes=new ArrayList<>();
for(int i=0; i<matrices.length; i++)
{
Path p = new Path(matrices[i]).makeQualified(fs);
@@ -1008,8 +1008,8 @@ public class MRJobConfiguration
}
//remove redundant inputs and pure broadcast variables
- ArrayList<Path> lpaths = new ArrayList<Path>();
- ArrayList<InputInfo> liinfos = new ArrayList<InputInfo>();
+ ArrayList<Path> lpaths = new ArrayList<>();
+ ArrayList<InputInfo> liinfos = new ArrayList<>();
for(int i=0; i<inputs.length; i++)
{
Path p = new Path(inputs[i]);
@@ -1092,7 +1092,7 @@ public class MRJobConfiguration
}
//remove redundant input files
- ArrayList<Path> paths=new ArrayList<Path>();
+ ArrayList<Path> paths=new ArrayList<>();
for(int i=0; i<inputs.length; i++)
{
String name=inputs[i];
@@ -1231,8 +1231,8 @@ public class MRJobConfiguration
String instructionsInMapper, String reblockInstructions, String aggInstructionsInReducer, String aggBinInstructions,
String otherInstructionsInReducer, byte[] resultIndexes, HashSet<Byte> mapOutputIndexes, boolean forMMCJ) throws DMLRuntimeException
{
- HashSet<Byte> intermediateMatrixIndexes=new HashSet<Byte>();
- HashMap<Byte, MatrixCharacteristics> dims=new HashMap<Byte, MatrixCharacteristics>();
+ HashSet<Byte> intermediateMatrixIndexes=new HashSet<>();
+ HashMap<Byte, MatrixCharacteristics> dims=new HashMap<>();
for(byte i: inputIndexes){
MatrixCharacteristics dim=new MatrixCharacteristics(getNumRows(job, i), getNumColumns(job, i),
getNumRowsPerBlock(job, i), getNumColumnsPerBlock(job, i), getNumNonZero(job, i));
@@ -1354,8 +1354,8 @@ public class MRJobConfiguration
if(!forMMCJ)
{
//store the skylines
- ArrayList<Long> xs=new ArrayList<Long>(mapOutputIndexes.size());
- ArrayList<Long> ys=new ArrayList<Long>(mapOutputIndexes.size());
+ ArrayList<Long> xs=new ArrayList<>(mapOutputIndexes.size());
+ ArrayList<Long> ys=new ArrayList<>(mapOutputIndexes.size());
for(byte idx: mapOutputIndexes)
{
MatrixCharacteristics dim=dims.get(idx);
@@ -1387,7 +1387,7 @@ public class MRJobConfiguration
}
}
//sort by x
- TreeMap<Long, Long> map=new TreeMap<Long, Long>();
+ TreeMap<Long, Long> map=new TreeMap<>();
for(int i=0; i<xs.size(); i++)
map.put(xs.get(i), ys.get(i));
numReduceGroups=0;
@@ -1586,7 +1586,7 @@ public class MRJobConfiguration
{
//find out what results are needed to send to reducers
- HashSet<Byte> indexesInMapper=new HashSet<Byte>();
+ HashSet<Byte> indexesInMapper=new HashSet<>();
for(byte b: inputIndexes)
indexesInMapper.add(b);
@@ -1602,7 +1602,7 @@ public class MRJobConfiguration
getIndexes(reblockIns, indexesInMapper);
MRInstruction[] insReducer = MRInstructionParser.parseAggregateInstructions(aggInstructionsInReducer);
- HashSet<Byte> indexesInReducer=new HashSet<Byte>();
+ HashSet<Byte> indexesInReducer=new HashSet<>();
getIndexes(insReducer, indexesInReducer);
insReducer = MRInstructionParser.parseMixedInstructions(otherInstructionsInReducer);
@@ -1622,14 +1622,14 @@ public class MRJobConfiguration
byte[] resultIndexes=MRJobConfiguration.getResultIndexes(job);
Converter[] outputConverters=new Converter[resultIndexes.length];
MatrixCharacteristics[] stats=new MatrixCharacteristics[resultIndexes.length];
- HashMap<Byte, ArrayList<Integer>> tagMapping=new HashMap<Byte, ArrayList<Integer>>();
+ HashMap<Byte, ArrayList<Integer>> tagMapping=new HashMap<>();
for(int i=0; i<resultIndexes.length; i++)
{
byte output=resultIndexes[i];
ArrayList<Integer> vec=tagMapping.get(output);
if(vec==null)
{
- vec=new ArrayList<Integer>();
+ vec=new ArrayList<>();
tagMapping.put(output, vec);
}
vec.add(i);
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/MapperBase.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MapperBase.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MapperBase.java
index 878c236..3b630ae 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/MapperBase.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/MapperBase.java
@@ -66,19 +66,19 @@ public abstract class MapperBase extends MRBaseForCommonInstructions
protected int[] lastblockclens=null;
//rand instructions that need to be performed in mapper
- protected ArrayList<DataGenMRInstruction> dataGen_instructions=new ArrayList<DataGenMRInstruction>();
+ protected ArrayList<DataGenMRInstruction> dataGen_instructions=new ArrayList<>();
//instructions that need to be performed in mapper
- protected ArrayList<ArrayList<MRInstruction>> mapper_instructions=new ArrayList<ArrayList<MRInstruction>>();
+ protected ArrayList<ArrayList<MRInstruction>> mapper_instructions=new ArrayList<>();
//block instructions that need to be performed in part by mapper
- protected ArrayList<ArrayList<ReblockInstruction>> reblock_instructions=new ArrayList<ArrayList<ReblockInstruction>>();
+ protected ArrayList<ArrayList<ReblockInstruction>> reblock_instructions=new ArrayList<>();
//csv block instructions that need to be performed in part by mapper
- protected ArrayList<ArrayList<CSVReblockInstruction>> csv_reblock_instructions=new ArrayList<ArrayList<CSVReblockInstruction>>();
+ protected ArrayList<ArrayList<CSVReblockInstruction>> csv_reblock_instructions=new ArrayList<>();
//the indexes of the matrices that needed to be outputted
- protected ArrayList<ArrayList<Byte>> outputIndexes=new ArrayList<ArrayList<Byte>>();
+ protected ArrayList<ArrayList<Byte>> outputIndexes=new ArrayList<>();
//converter to convert the input record into indexes and matrix value (can be a cell or a block)
protected Converter inputConverter=null;
@@ -86,7 +86,7 @@ public abstract class MapperBase extends MRBaseForCommonInstructions
//a counter to measure the time spent in a mapper
protected static enum Counters {
MAP_TIME
- };
+ }
@SuppressWarnings("unchecked")
@@ -280,14 +280,14 @@ public abstract class MapperBase extends MRBaseForCommonInstructions
}
//collect unary instructions for each representative matrix
- HashSet<Byte> set=new HashSet<Byte>();
+ HashSet<Byte> set=new HashSet<>();
for(int i=0; i<representativeMatrixes.size(); i++)
{
set.clear();
set.add(representativeMatrixes.get(i));
//collect the relavent datagen instructions for this representative matrix
- ArrayList<DataGenMRInstruction> dataGensForThisMatrix=new ArrayList<DataGenMRInstruction>();
+ ArrayList<DataGenMRInstruction> dataGensForThisMatrix=new ArrayList<>();
if(allDataGenIns!=null)
{
for(DataGenMRInstruction ins:allDataGenIns)
@@ -307,7 +307,7 @@ public abstract class MapperBase extends MRBaseForCommonInstructions
dataGen_instructions.add(dataGensForThisMatrix.get(0));
//collect the relavent instructions for this representative matrix
- ArrayList<MRInstruction> opsForThisMatrix=new ArrayList<MRInstruction>();
+ ArrayList<MRInstruction> opsForThisMatrix=new ArrayList<>();
if(allMapperIns!=null)
{
@@ -345,7 +345,7 @@ public abstract class MapperBase extends MRBaseForCommonInstructions
mapper_instructions.add(opsForThisMatrix);
//collect the relavent reblock instructions for this representative matrix
- ArrayList<ReblockInstruction> reblocksForThisMatrix=new ArrayList<ReblockInstruction>();
+ ArrayList<ReblockInstruction> reblocksForThisMatrix=new ArrayList<>();
if(allReblockIns!=null)
{
for(ReblockInstruction ins:allReblockIns)
@@ -361,7 +361,7 @@ public abstract class MapperBase extends MRBaseForCommonInstructions
reblock_instructions.add(reblocksForThisMatrix);
//collect the relavent reblock instructions for this representative matrix
- ArrayList<CSVReblockInstruction> csvReblocksForThisMatrix=new ArrayList<CSVReblockInstruction>();
+ ArrayList<CSVReblockInstruction> csvReblocksForThisMatrix=new ArrayList<>();
if(allCSVReblockIns!=null)
{
for(CSVReblockInstruction ins:allCSVReblockIns)
@@ -377,7 +377,7 @@ public abstract class MapperBase extends MRBaseForCommonInstructions
csv_reblock_instructions.add(csvReblocksForThisMatrix);
//collect the output indexes for this representative matrix
- ArrayList<Byte> outsForThisMatrix=new ArrayList<Byte>();
+ ArrayList<Byte> outsForThisMatrix=new ArrayList<>();
for(byte output: outputs)
{
if(set.contains(output))
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReblockMapper.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReblockMapper.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReblockMapper.java
index b32e5f8..de34f3a 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReblockMapper.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReblockMapper.java
@@ -49,12 +49,12 @@ public class ReblockMapper extends MapperBase
//state of reblock mapper
private OutputCollector<Writable, Writable> cachedCollector = null;
private JobConf cachedJobConf = null;
- private HashMap<Byte, MatrixCharacteristics> dimensionsOut = new HashMap<Byte, MatrixCharacteristics>();
- private HashMap<Byte, MatrixCharacteristics> dimensionsIn = new HashMap<Byte, MatrixCharacteristics>();
- private HashMap<Byte, Boolean> emptyBlocks = new HashMap<Byte, Boolean>();
+ private HashMap<Byte, MatrixCharacteristics> dimensionsOut = new HashMap<>();
+ private HashMap<Byte, MatrixCharacteristics> dimensionsIn = new HashMap<>();
+ private HashMap<Byte, Boolean> emptyBlocks = new HashMap<>();
//reblock buffer
- private HashMap<Byte, ReblockBuffer> buffer = new HashMap<Byte,ReblockBuffer>();
+ private HashMap<Byte, ReblockBuffer> buffer = new HashMap<>();
private int buffersize =-1;
@Override
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReblockReducer.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReblockReducer.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReblockReducer.java
index 46c4bf6..3f6de3c 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReblockReducer.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReblockReducer.java
@@ -42,7 +42,7 @@ public class ReblockReducer extends ReduceBase
implements Reducer<MatrixIndexes, TaggedAdaptivePartialBlock, MatrixIndexes, MatrixBlock>
{
- private HashMap<Byte, MatrixCharacteristics> dimensions = new HashMap<Byte, MatrixCharacteristics>();
+ private HashMap<Byte, MatrixCharacteristics> dimensions = new HashMap<>();
@Override
public void reduce(MatrixIndexes indexes, Iterator<TaggedAdaptivePartialBlock> values,
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReduceBase.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReduceBase.java b/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReduceBase.java
index 60b4990..eade689 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReduceBase.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/mapred/ReduceBase.java
@@ -44,10 +44,8 @@ import org.apache.sysml.runtime.util.MapReduceTool;
public class ReduceBase extends MRBaseForCommonInstructions
{
-
//aggregate instructions
- protected HashMap<Byte, ArrayList<AggregateInstruction>>
- agg_instructions=new HashMap<Byte, ArrayList<AggregateInstruction>>();
+ protected HashMap<Byte, ArrayList<AggregateInstruction>> agg_instructions=new HashMap<>();
//default aggregate operation
protected static final AggregateOperator DEFAULT_AGG_OP = new AggregateOperator(0, Plus.getPlusFnObject());
@@ -67,7 +65,7 @@ public class ReduceBase extends MRBaseForCommonInstructions
protected CollectMultipleConvertedOutputs collectFinalMultipleOutputs;
//a counter to calculate the time spent in a reducer or a combiner
- public static enum Counters {COMBINE_OR_REDUCE_TIME };
+ public static enum Counters {COMBINE_OR_REDUCE_TIME }
//the counters to record how many nonZero cells have been produced for each output
protected long[] resultsNonZeros=null;
@@ -120,7 +118,7 @@ public class ReduceBase extends MRBaseForCommonInstructions
//parse unary and binary operations
MRInstruction[] tmp = MRJobConfiguration.getInstructionsInReducer(job);
if( tmp != null ) {
- mixed_instructions=new ArrayList<MRInstruction>();
+ mixed_instructions=new ArrayList<>();
Collections.addAll(mixed_instructions, tmp);
}
@@ -147,7 +145,7 @@ public class ReduceBase extends MRBaseForCommonInstructions
ArrayList<AggregateInstruction> vec=agg_instructions.get(ins.input);
if(vec==null)
{
- vec = new ArrayList<AggregateInstruction>();
+ vec = new ArrayList<>();
agg_instructions.put(ins.input, vec);
}
vec.add(ins);
@@ -162,7 +160,7 @@ public class ReduceBase extends MRBaseForCommonInstructions
vec=agg_instructions.get(partialIns.input);
if(vec==null)
{
- vec=new ArrayList<AggregateInstruction>();
+ vec=new ArrayList<>();
agg_instructions.put(partialIns.input, vec);
}
vec.add(partialIns);
@@ -179,7 +177,7 @@ public class ReduceBase extends MRBaseForCommonInstructions
protected ArrayList<Integer> getOutputIndexes(byte outputTag)
{
- ArrayList<Integer> ret = new ArrayList<Integer>();
+ ArrayList<Integer> ret = new ArrayList<>();
for(int i=0; i<resultIndexes.length; i++)
if(resultIndexes[i]==outputTag)
ret.add(i);
@@ -188,7 +186,7 @@ public class ReduceBase extends MRBaseForCommonInstructions
protected static ArrayList<Integer> getOutputIndexes(byte outputTag, byte[] resultIndexes)
{
- ArrayList<Integer> ret=new ArrayList<Integer>();
+ ArrayList<Integer> ret=new ArrayList<>();
for(int i=0; i<resultIndexes.length; i++)
if(resultIndexes[i]==outputTag)
ret.add(i);
http://git-wip-us.apache.org/repos/asf/systemml/blob/40dd894e/src/main/java/org/apache/sysml/runtime/matrix/operators/CMOperator.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/sysml/runtime/matrix/operators/CMOperator.java b/src/main/java/org/apache/sysml/runtime/matrix/operators/CMOperator.java
index e89ced6..7a6c17b 100644
--- a/src/main/java/org/apache/sysml/runtime/matrix/operators/CMOperator.java
+++ b/src/main/java/org/apache/sysml/runtime/matrix/operators/CMOperator.java
@@ -38,7 +38,7 @@ public class CMOperator extends Operator
CM4,
VARIANCE,
INVALID
- };
+ }
public ValueFunction fn;
public AggregateOperationTypes aggOpType;