Class MatrixObject
- java.lang.Object
- 
- org.apache.sysds.runtime.instructions.cp.Data
- 
- org.apache.sysds.runtime.controlprogram.caching.CacheableData<MatrixBlock>
- 
- org.apache.sysds.runtime.controlprogram.caching.MatrixObject
 
 
 
- 
- All Implemented Interfaces:
- Serializable
 
 public class MatrixObject extends CacheableData<MatrixBlock> Represents a matrix in control program. This class contains method to read matrices from HDFS and convert them to a specific format/representation. It is also able to write several formats/representation of matrices to HDFS. IMPORTANT: Preserve one-to-one correspondence betweenMatrixObjectandMatrixBlockobjects, for cache purposes. Do not change aMatrixBlockobject without informing itsMatrixObjectobject.- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classMatrixObject.UpdateType- 
Nested classes/interfaces inherited from class org.apache.sysds.runtime.controlprogram.caching.CacheableDataCacheableData.CacheStatus
 
- 
 - 
Field Summary- 
Fields inherited from class org.apache.sysds.runtime.controlprogram.caching.CacheableDatacacheEvictionLocalFilePath, cacheEvictionLocalFilePrefix, CACHING_ASYNC_FILECLEANUP, CACHING_ASYNC_SERIALIZE, CACHING_BUFFER_PAGECACHE, CACHING_BUFFER_POLICY, CACHING_COUNTER_GROUP_NAME, CACHING_EVICTION_FILEEXTENSION, CACHING_THRESHOLD, CACHING_WRITE_CACHE_ON_READ
 
- 
 - 
Constructor SummaryConstructors Constructor Description MatrixObject(Types.ValueType vt, String file)Constructor that takes the value type and the HDFS filename.MatrixObject(Types.ValueType vt, String file, MetaData mtd)Constructor that takes the value type, HDFS filename and associated metadata.MatrixObject(Types.ValueType vt, String file, MetaData mtd, MatrixBlock data)Constructor that takes the value type, HDFS filename and associated metadata and a MatrixBlock used for creation after serializationMatrixObject(MatrixObject mo)Copy constructor that copies meta data but NO data.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetBlocksize()longgetNnz()StringgetPartitionFileName(IndexRange pred, int blen)ParForProgramBlock.PDataPartitionFormatgetPartitionFormat()intgetPartitionSize()doublegetSparsity()MatrixObject.UpdateTypegetUpdateType()booleanisDiag()booleanisMarked()booleanisPartitioned()MatrixBlockreadMatrixPartition(IndexRange pred)NOTE: for reading matrix partitions, we could cache (in its real sense) the read block with soft references (no need for eviction, as partitioning only applied for read-only matrices).voidrefreshMetaData()Make the matrix metadata consistent with the in-memory matrix datavoidsetDiag(boolean diag)voidsetInMemoryPartition(MatrixBlock block)voidsetMarkForLinCache(boolean mark)voidsetPartitioned(ParForProgramBlock.PDataPartitionFormat format, int n)voidsetUpdateType(MatrixObject.UpdateType flag)StringtoString()voidunsetPartitioned()voidupdateDataCharacteristics(DataCharacteristics dc)- 
Methods inherited from class org.apache.sysds.runtime.controlprogram.caching.CacheableDataacquireModify, acquireRead, acquireReadAndRelease, addBroadcastSize, cleanupCacheDir, cleanupCacheDir, clearData, clearData, disableCaching, enableCaching, enableCleanup, exportData, exportData, exportData, exportData, exportData, freeEvictedBlob, getBroadcastHandle, getBroadcastSize, getCacheLineage, getCompressedSize, getDataCharacteristics, getDataSize, getDebugName, getDim, getFedMapping, getFileFormatProperties, getFileName, getGPUObject, getMetaData, getNumColumns, getNumRows, getRDDHandle, getStatus, getUniqueID, hasValidLineage, initCaching, initCaching, isBelowCachingThreshold, isCached, isCachingActive, isCleanupEnabled, isCompressed, isDirty, isFederated, isFederated, isFederatedExcept, isHDFSFileExists, isPendingRDDOps, moveData, release, removeGPUObject, removeMetaData, setBroadcastHandle, setCacheLineage, setCompressedSize, setDirty, setEmptyStatus, setFedMapping, setFileFormatProperties, setFileName, setGPUObject, setHDFSFileExists, setMetaData, setRDDHandle
 - 
Methods inherited from class org.apache.sysds.runtime.instructions.cp.DatagetDataType, getPrivacyConstraint, getValueType, setPrivacyConstraints
 
- 
 
- 
- 
- 
Constructor Detail- 
MatrixObjectpublic MatrixObject(Types.ValueType vt, String file) Constructor that takes the value type and the HDFS filename.- Parameters:
- vt- value type
- file- file name
 
 - 
MatrixObjectpublic MatrixObject(Types.ValueType vt, String file, MetaData mtd) Constructor that takes the value type, HDFS filename and associated metadata.- Parameters:
- vt- value type
- file- file name
- mtd- metadata
 
 - 
MatrixObjectpublic MatrixObject(Types.ValueType vt, String file, MetaData mtd, MatrixBlock data) Constructor that takes the value type, HDFS filename and associated metadata and a MatrixBlock used for creation after serialization- Parameters:
- vt- value type
- file- file name
- mtd- metadata
- data- matrix block data
 
 - 
MatrixObjectpublic MatrixObject(MatrixObject mo) Copy constructor that copies meta data but NO data.- Parameters:
- mo- matrix object
 
 
- 
 - 
Method Detail- 
setUpdateTypepublic void setUpdateType(MatrixObject.UpdateType flag) 
 - 
getUpdateTypepublic MatrixObject.UpdateType getUpdateType() 
 - 
isDiagpublic boolean isDiag() 
 - 
setDiagpublic void setDiag(boolean diag) 
 - 
setMarkForLinCachepublic void setMarkForLinCache(boolean mark) 
 - 
isMarkedpublic boolean isMarked() 
 - 
updateDataCharacteristicspublic void updateDataCharacteristics(DataCharacteristics dc) - Overrides:
- updateDataCharacteristicsin class- Data
 
 - 
refreshMetaDatapublic void refreshMetaData() Make the matrix metadata consistent with the in-memory matrix data- Specified by:
- refreshMetaDatain class- CacheableData<MatrixBlock>
 
 - 
getBlocksizepublic long getBlocksize() - Overrides:
- getBlocksizein class- CacheableData<MatrixBlock>
 
 - 
getNnzpublic long getNnz() 
 - 
getSparsitypublic double getSparsity() 
 - 
setPartitionedpublic void setPartitioned(ParForProgramBlock.PDataPartitionFormat format, int n) 
 - 
unsetPartitionedpublic void unsetPartitioned() 
 - 
isPartitionedpublic boolean isPartitioned() 
 - 
getPartitionFormatpublic ParForProgramBlock.PDataPartitionFormat getPartitionFormat() 
 - 
getPartitionSizepublic int getPartitionSize() 
 - 
setInMemoryPartitionpublic void setInMemoryPartition(MatrixBlock block) 
 - 
readMatrixPartitionpublic MatrixBlock readMatrixPartition(IndexRange pred) NOTE: for reading matrix partitions, we could cache (in its real sense) the read block with soft references (no need for eviction, as partitioning only applied for read-only matrices). However, since we currently only support row- and column-wise partitioning caching is not applied yet. This could be changed once we also support column-block-wise and row-block-wise. Furthermore, as we reject to partition vectors and support only full row or column indexing, no metadata (apart from the partition flag) is required.- Parameters:
- pred- index range
- Returns:
- matrix block
 
 - 
getPartitionFileNamepublic String getPartitionFileName(IndexRange pred, int blen) 
 - 
toStringpublic String toString() - Overrides:
- toStringin class- CacheableData<MatrixBlock>
 
 
- 
 
-