How to get entity size in GAE/J?
google-app-engine, java
Solution
It looks like this method should fit the bill for you:
public static EntityProto convertToPb(Entity entity)
and matches up with what you've found on the Python side.
Problem
GAE documentation mentions that the max entity size is 1Mb. Since I'm storing a lot of data inside entities I'd like to know when I'm approaching this limit. I'm aware of GAE/Pyhon method `model_to_protobuf(..)`, but I can't find anything for Java. I'm also aware that GAE uses protobuf internally to serialize entities, so I could do the same. But I'd like to avoid duplicate code as GAE is already doing this under the hood. Is there a programmatic way to get entity size in Java, preferably before entity is actually stored?