// TODO: state.getCurrentRowKey() should take an ImmutableBytesWritable arg to prevent byte copy
byte[] dataRowKey = state.getCurrentRowKey();
for (IndexMaintainer maintainer : indexMaintainers) {
// TODO: if more efficient, I could do this just once with all columns in all indexes
Pair<Scanner,IndexUpdate> statePair = state.getIndexedColumnsTableState(maintainer.getAllColumns());
Scanner scanner = statePair.getFirst();
IndexUpdate indexUpdate = statePair.getSecond();
indexUpdate.setTable(maintainer.getIndexTableName());
ValueGetter valueGetter = IndexManagementUtil.createGetterFromScanner(scanner, dataRowKey);
ptr.set(dataRowKey);
Delete delete =
maintainer.buildDeleteMutation(kvBuilder, valueGetter, ptr,
state.getPendingUpdate(), state.getCurrentTimestamp(), env.getRegion().getStartKey(), env.getRegion().getEndKey());
scanner.close();
indexUpdate.setUpdate(delete);
indexUpdates.add(indexUpdate);
}
return indexUpdates;
}