org.apache.mahout.math.hadoop.stochasticsvd
Class DenseBlockWritable
java.lang.Object
org.apache.mahout.math.hadoop.stochasticsvd.DenseBlockWritable
- All Implemented Interfaces:
- org.apache.hadoop.io.Writable
public class DenseBlockWritable
- extends Object
- implements org.apache.hadoop.io.Writable
Ad-hoc substitution for MatrixWritable
.
Perhaps more useful for situations with mostly dense data (such as Q-blocks)
but reduces GC by reusing the same block memory between loads and writes.
in case of Q blocks, it doesn't even matter if they this data is dense cause
we need to unpack it into dense for fast access in computations anyway and
even if it is not so dense the block compressor in sequence files will take
care of it for the serialized size.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DenseBlockWritable
public DenseBlockWritable()
setBlock
public void setBlock(double[][] block)
getBlock
public double[][] getBlock()
readFields
public void readFields(DataInput in)
throws IOException
- Specified by:
readFields
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
write
public void write(DataOutput out)
throws IOException
- Specified by:
write
in interface org.apache.hadoop.io.Writable
- Throws:
IOException
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.