int rowNumber = 2;
for (DataEntry dataEntry : dataToUpload) {
for (Map.Entry<Integer, AnalyticsColumn> column : columnTypeMap.entrySet()) {
int columnNumber = column.getKey();
String dimensionName = column.getValue().getName();
CellEntry cellEntry = worksheet.getCell(rowNumber, columnNumber);
String value = dataEntry.stringValueOf(dimensionName);
cellEntry.changeInputValueLocal(value);
updatedCells.add(cellEntry);
}
rowNumber++;
}
// send the updates in chunks of 1000 to ensure we don't send too much
// data in one batch
List<List<CellEntry>> batches = chunkList(updatedCells, 1000);
for (List<CellEntry> batch : batches) {
CellFeed batchFeed = new CellFeed();
for (CellEntry cellEntry : batch) {
Cell cell = cellEntry.getCell();
BatchUtils.setBatchId(cellEntry, "R" + cell.getRow() + "C" + cell.getCol());
BatchUtils.setBatchOperationType(cellEntry, BatchOperationType.UPDATE);
batchFeed.getEntries().add(cellEntry);
}