@Override protected void cleanup(Context context) throws IOException, InterruptedException { try { if (sqAccum != null) { /* * hack: we will output sq partial sums with index -1 for summation. */ SparseRowBlockWritable sbrw = new SparseRowBlockWritable(1); sbrw.plusRow(0, sqAccum); LongWritable lw = new LongWritable(-1); context.write(lw, sbrw); } } finally { IOUtils.close(closeables); } }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { try { if (sqAccum != null) { /* * hack: we will output sq partial sums with index -1 for summation. */ SparseRowBlockWritable sbrw = new SparseRowBlockWritable(1); sbrw.plusRow(0, sqAccum); LongWritable lw = new LongWritable(-1); context.write(lw, sbrw); } } finally { IOUtils.close(closeables); } }
@Override protected void cleanup(Context context) throws IOException, InterruptedException { try { if (sqAccum != null) { /* * hack: we will output sq partial sums with index -1 for summation. */ SparseRowBlockWritable sbrw = new SparseRowBlockWritable(1); sbrw.plusRow(0, sqAccum); LongWritable lw = new LongWritable(-1); context.write(lw, sbrw); } } finally { IOUtils.close(closeables); } }
@Override public void collect(Long rowIndex, Vector v) throws IOException { long blockKey = rowIndex / height; if (blockKey != currentBlockNum) { flushBlock(); if (block == null) { block = new SparseRowBlockWritable(100); } currentBlockNum = blockKey; } block.plusRow((int) (rowIndex % height), v); }
@Override public void collect(Long rowIndex, Vector v) throws IOException { long blockKey = rowIndex / height; if (blockKey != currentBlockNum) { flushBlock(); if (block == null) { block = new SparseRowBlockWritable(100); } currentBlockNum = blockKey; } block.plusRow((int) (rowIndex % height), v); }
@Override public void collect(Long rowIndex, Vector v) throws IOException { long blockKey = rowIndex / height; if (blockKey != currentBlockNum) { flushBlock(); if (block == null) { block = new SparseRowBlockWritable(100); } currentBlockNum = blockKey; } block.plusRow((int) (rowIndex % height), v); }