public static List<Mutation> generateIndexData(PTable indexTable, PTable dataTable,
Mutation dataMutation, ImmutableBytesWritable ptr, KeyValueBuilder builder)
throws SQLException {
byte[] dataRowKey = dataMutation.getRow();
RowKeySchema dataRowKeySchema = dataTable.getRowKeySchema();
List<PColumn> dataPKColumns = dataTable.getPKColumns();
int i = 0;
int indexOffset = 0;
Boolean hasValue;
// Skip salt column
int maxOffset = dataRowKey.length;
dataRowKeySchema.iterator(dataRowKey, ptr, dataTable.getBucketNum() == null ? i : ++i);
List<PColumn> indexPKColumns = indexTable.getPKColumns();
List<PColumn> indexColumns = indexTable.getColumns();
int nIndexColumns = indexPKColumns.size();
int maxIndexValues = indexColumns.size() - nIndexColumns - indexOffset;
BitSet indexValuesSet = new BitSet(maxIndexValues);
byte[][] indexValues = new byte[indexColumns.size() - indexOffset][];
while ((hasValue = dataRowKeySchema.next(ptr, i, maxOffset)) != null) {
if (hasValue) {
PColumn dataColumn = dataPKColumns.get(i);
PColumn indexColumn = indexTable.getColumn(IndexUtil.getIndexColumnName(dataColumn));
coerceDataValueToIndexValue(dataColumn, indexColumn, ptr);
indexValues[indexColumn.getPosition()-indexOffset] = ptr.copyBytes();