Why no entity kind with name _BlobInfo_ in datastore is created when application is deployed on GAE?
Asked Answered
A

1

6

When we upload files to Blobstore on Google App Engine we find that with every upload an entity of kind _BlobInfo_ is created which can be seen in the local development console under datastore viewer at http://localhost:8888/_ah/admin, however after the application is deployed to App Engine no such entities are created when we upload files to the Blobstore. It looks strange to me and wanted to know if I'm missing something here.

Asiatic answered 25/10, 2014 at 18:28 Comment(1)
I understand that behaviour as the dev_appservers way of emulating the blob/data-store. When deployed no such entity is needed as that entity is now stored in the blobstore proper. You are not missing anything.Kacykaczer
D
4

_BlobInfo_ is not a special name and most likely your app doesn't create entities with this name.

In production environment __BlobInfo__ is an internal name for storing information about blobs stored in the Blobstore. Note that there are two underscore characters (_) before and after the word BlobInfo. This entity is only created if your app creates and saves blobs into the Blobstore.

Since this is an internal entity, it is excluded from the Datastore Viewer by default. It is also exluded from the Datastore Statistics page, but they appear as BlobInfo under Kind: "All Entities".
By using a little trick, you can also show detailed statistics for the __BlobInfo__ entity: choose any entity from the dropdown list, and afte the page has reloaded, in the url modify the parameter kind=XXX to kind=__BlobInfo__ and hit enter. Now the page will reload showing statistics for this even though it is hidden from the dropdown list.

However, you can list these entities. For example go to the Datastore Viewer of your admin console, and check "By GQL" so you can enter a GQL to list your entites. Now enter the following GQL query:

SELECT * FROM __BlobInfo__

This will list your BlobInfo entities.

Note that the Blob Viewer page of your admin console also displays blobs based on the entities stored under the name __BlobInfo__. __BlobInfo__ entities also contain more properties than just the ones displayed on the Blob Viewer page.

All the properties are the following:

  • ID/Name
  • content_type
  • creation
  • creation_handle
  • filename
  • md5_hash
  • size
  • upload_id

These are also available from your application if you happen to query these entities.

Devault answered 27/10, 2014 at 12:28 Comment(1)
Thanks for the detailed and enlightening explanation! ;)Asiatic

© 2022 - 2024 — McMap. All rights reserved.