Class PartitionedBlock<T extends CacheBlock>
java.lang.Object
org.apache.sysds.runtime.instructions.spark.data.PartitionedBlock<T>
- All Implemented Interfaces:
Externalizable,Serializable
This class is for partitioned matrix/frame blocks, to be used as broadcasts.
Distributed tasks require block-partitioned broadcasts but a lazy partitioning
per task would create instance-local copies and hence replicate broadcast
variables which are shared by all tasks within an executor.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPartitionedBlock(int rlen, int clen, int blen) PartitionedBlock(T block, int blen) PartitionedBlock(T block, long[] dims, int blen) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreatePartition(int offset, int numBlks) getBlock(int[] ix) getBlock(int rowIndex, int colIndex) longlonggetDim(int i) longlonglongintintgetNumDimBlocks(int dim) intlongvoidRedirects the default java serialization via externalizable to our default hadoop writable serialization for efficient broadcast deserialization.voidvoidRedirects the default java serialization via externalizable to our default hadoop writable serialization for efficient broadcast serialization.
-
Constructor Details
-
PartitionedBlock
public PartitionedBlock() -
PartitionedBlock
-
PartitionedBlock
-
PartitionedBlock
public PartitionedBlock(int rlen, int clen, int blen)
-
-
Method Details
-
createPartition
-
getNumRows
public long getNumRows() -
getNumCols
public long getNumCols() -
getDim
public long getDim(int i) -
getBlocksize
public long getBlocksize() -
getNumRowBlocks
public int getNumRowBlocks() -
getNumColumnBlocks
public int getNumColumnBlocks() -
getNumDimBlocks
public int getNumDimBlocks(int dim) -
getBlock
-
getBlock
-
setBlock
-
getInMemorySize
public long getInMemorySize() -
getExactSerializedSize
public long getExactSerializedSize() -
clearBlocks
public void clearBlocks() -
readExternal
Redirects the default java serialization via externalizable to our default hadoop writable serialization for efficient broadcast deserialization.- Specified by:
readExternalin interfaceExternalizable- Parameters:
is- object input- Throws:
IOException- if IOException occurs
-
writeExternal
Redirects the default java serialization via externalizable to our default hadoop writable serialization for efficient broadcast serialization.- Specified by:
writeExternalin interfaceExternalizable- Parameters:
os- object output- Throws:
IOException- if IOException occurs
-