How to get entity size in GAE / J?

The GAE documentation states that the maximum size of an entity is 1 MB. Since I store a lot of data inside objects that I would like to know when I approach this limit.

I know the GAE / Pyhon method model_to_protobuf(..), but I can not find anything for Java.

I also know that GAE uses protobuf to serialize entities, so I could do the same. But I would like to avoid code duplication, as GAE is already doing this under the hood.

Is there a programmatic way to get the size of an entity in Java, preferably before the entity is actually saved?

+5
source share
1 answer

It looks like this method should fit the bill for you:

public static EntityProto convertToPb(Entity entity)

, Python.

+3

All Articles