Java – how to get entity size in gae / J?

The gae document mentions that the maximum entity size is 1MB Because I store a lot of data in entities, I want to know when I approach this limit

I know the gae / Python method model_ to_ protobuf(..), But I can't find anything Java

I also know that gae internally uses protobuf to serialize entities, so I can do the same But I want to avoid duplicate code because gae has done it behind the scenes

Is there a programming way to get the entity size in Java, preferably before actually storing the entity?

Solution

It seems that this method should fit your bill:

public static EntityProto convertToPb(Entity entity)

And match the content you find on the python side

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>