Class ByteBuffer
java.lang.Object
org.apache.sysds.runtime.controlprogram.caching.ByteBuffer
Wrapper for WriteBuffer byte array per matrix/frame in order to
support matrix/frame serialization outside global lock.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCacheBlock<?>voidevictBuffer(String fname) voidlonggetSize()Returns the buffer size in bytes.booleanstatic booleanisValidCapacity(long size, CacheBlock<?> cb) Determines if byte buffer can hold the given size given this specific cache block.voidserializeBlock(CacheBlock<?> cb)
-
Constructor Details
-
ByteBuffer
public ByteBuffer(long size)
-
-
Method Details
-
serializeBlock
-
deserializeBlock
- Throws:
IOException
-
evictBuffer
- Throws:
IOException
-
getSize
public long getSize()Returns the buffer size in bytes.- Returns:
- buffer size in bytes
-
isShallow
public boolean isShallow() -
freeMemory
public void freeMemory() -
checkSerialized
public void checkSerialized() -
isValidCapacity
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 sizecb- cache block- Returns:
- true if valid capacity
-