for (Key key : journalMap.keySet()) {
Entity targetEntity = journalMap.get(key);
boolean put = targetEntity != null;
EntityProto targetProto =
put ? EntityTranslator.convertToPb(targetEntity) : null;
int size = put ? targetProto.encodingSize() : 0;
if (totalSize != 0
&& totalSize + size + DatastoreUtil.EXTRA_SIZE > DatastoreUtil.MAX_ENTITY_SIZE) {
entity.setUnindexedProperty(PUT_LIST_PROPERTY, putList);
entity.setUnindexedProperty(DELETE_LIST_PROPERTY, deleteList);
DatastoreUtil.put(ds, null, entity);