YCSB-specific buffer class. ByteIterators are designed to support efficient field generation, and to allow backend drivers that can stream fields (instead of materializing them in RAM) to do so.
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 sears