Class ByteBuffer
- java.lang.Object
- 
- org.apache.sysds.runtime.controlprogram.caching.ByteBuffer
 
- 
 public class ByteBuffer extends Object Wrapper for WriteBuffer byte array per matrix/frame in order to support matrix/frame serialization outside global lock.
- 
- 
Constructor SummaryConstructors Constructor Description ByteBuffer(long size)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckSerialized()CacheBlockdeserializeBlock()voidevictBuffer(String fname)voidfreeMemory()longgetSize()Returns the buffer size in bytes.booleanisShallow()static booleanisValidCapacity(long size, CacheBlock cb)Determines if byte buffer can hold the given size given this specific cache block.voidserializeBlock(CacheBlock cb)
 
- 
- 
- 
Method Detail- 
serializeBlockpublic void serializeBlock(CacheBlock cb) throws IOException - Throws:
- IOException
 
 - 
deserializeBlockpublic CacheBlock deserializeBlock() throws IOException - Throws:
- IOException
 
 - 
evictBufferpublic void evictBuffer(String fname) throws IOException - Throws:
- IOException
 
 - 
getSizepublic long getSize() Returns the buffer size in bytes.- Returns:
- buffer size in bytes
 
 - 
isShallowpublic boolean isShallow() 
 - 
freeMemorypublic void freeMemory() 
 - 
checkSerializedpublic void checkSerialized() 
 - 
isValidCapacitypublic static boolean isValidCapacity(long size, CacheBlock cb)Determines if byte buffer can hold the given size given this specific cache block. This call is consistent with 'serializeBlock' and allows for internal optimization according to dense/sparse representation.- Parameters:
- size- the size
- cb- cache block
- Returns:
- true if valid capacity
 
 
- 
 
-