public long sizeInBytes ( ) throws IOException { long memoryBlockUsage = 0 ; for ( StreamBlock b : m_memoryDeque ) { //Use only total size, but throw in the USO //to make book keeping consistent when flushed to disk //Also dont count persisted blocks. memoryBlockUsage += b . totalSize ( ) ; } //Subtract USO from on disk size return memoryBlockUsage + m_reader . sizeInBytes ( ) - ( StreamBlock . HEADER_SIZE * m_reader . getNumObjects ( ) ) ; }
Only used in tests should be removed .