final int baseEncodedReqSize = baseReq.encodingSize();
final List<Future<PutResponse>> futures = new ArrayList<Future<PutResponse>>();
int encodedReqSize = baseEncodedReqSize;
PutRequest req = baseReq.clone();
for (Entity entity : entities) {
EntityProto proto = EntityTranslator.convertToPb(entity);
int encodedEntitySize = Protocol.stringSize(proto.encodingSize()) + 1;
if (getDatastoreServiceConfig().exceedsWriteLimits(
req.entitySize() + 1, encodedReqSize + encodedEntitySize)) {
futures.add(makeAsyncCall(apiConfig, "Put", req, new PutResponse()));
encodedReqSize = baseEncodedReqSize;
req = baseReq.clone();