YCSB originially used String objects to represent field values. This led to two performance issues.
First, it leads to unnecessary conversions between UTF-16 and UTF-8, both during field generation, and when passing data to byte-based backend drivers.
Second, Java strings are represented internally using UTF-16, and are built by appending to a growable array type (StringBuilder or StringBuffer), then calling a toString() method. This leads to a 4x memory overhead as field values are being built, which prevented YCSB from driving large object stores.
The StringByteIterator class contains a number of convenience methods for backend drivers that convert between Map<String,String> and Map<String,ByteBuffer>. @author searsbyte
values.
@see org.apache.commons.collections.primitives.adapters.ByteIteratorIterator
@see org.apache.commons.collections.primitives.adapters.IteratorByteIterator
@since Commons Primitives 1.0
@version $Revision: 1.3 $ $Date: 2003/10/16 20:49:36 $
@author Rodney Waldhoff
|
|
|
|
|
|