public String toString(final RowDef rowDef)
{
if (rowDef == null) {
return toStringWithoutRowDef("No RowDef provided");
}
final AkibanAppender sb = AkibanAppender.of(new StringBuilder());
RowDataValueSource source = new RowDataValueSource();
try {
sb.append(rowDef.table().getName().getTableName());
for (int i = 0; i < getFieldCount(); i++) {
final FieldDef fieldDef = rowDef.getFieldDef(i);
sb.append(i == 0 ? '(' : ',');
final long location = fieldDef.getRowDef().fieldLocation(
this, fieldDef.getFieldIndex());
if (location == 0) {
// sb.append("null");
} else {
source.bind(fieldDef, this);
fieldDef.column().getType().format(source, sb);
}
}
sb.append(')');
} catch (Exception e) {
int size = Math.min(getRowSize(), 64);
if (size > 0 && rowStart >= 0) {
sb.append(AkServerUtil.dump(bytes, rowStart, size));
}
return sb.toString();
}
return sb.toString();
}