google-cloud-datastore

Local datastore not persisted between application restarts

风格不统一 提交于 2019-12-11 02:49:26
问题 I am running the GuestBook example from Google Developer CodeLab. When adding an entry, it shows up in the list of greetings and in the local datastore So far so good... When I restart the application, however, only some of the entries still exist, while some disappear entirely, both from the list maintained by my app, and from the local datastore, as seen in above link. I am using the google plugin for Eclipse to develop and test my application. Can anyone point me in the right direction?

Spring Security ACL on App Engine Datastore

只愿长相守 提交于 2019-12-11 02:12:08
问题 We are using Spring Security ACL infrastructure in conjuction with App Engine Datastore. We do not use low-level Datastore API but rather we use Objectify framework to access Datatstore. We need to transform Spring Security ACL model (suitable for RDBMS) into model more suitable for schema-less object-oriented Datastore. So far we have ended up with two entities described below. Acl id: Long domainObject: Key (ancestor/parent) entries: List<AclEntry> (embedded) owner: String AclEntry sid:

Is there some performance issue between leaving empty ListProperties or using dynamic (expando) properties?

﹥>﹥吖頭↗ 提交于 2019-12-11 01:57:34
问题 Is there a datastore performance difference between adding dynamic properties of the expando class when they are needed for an entity or the simpler (for me) framework of just setting up all possible properties I might need from the start even though most instances will just be left empty. In my specific case I would be having 5-8 empty ReferenceList properties as 'overhead' that will be empty when I skip using expando class. 回答1: There is a penalty for setting up all the possible properties

Big query load fails with Bad Character (ASCII 0) while importing Datastore backup

一世执手 提交于 2019-12-11 01:55:40
问题 This may look like already discussed scenario. I am trying to load Google App Engine DataStore backup into BQ using Talend tBigQueryBulkExec component, which does same as BQ Shell CLI. It connects to BQ and tries to read files from GCS and move to defined Dataset.Tablename as given in component settings. Error Message: location":"File: 0 / Line:8 / Field:1","message":"Bad character (ASCII 0) encountered: field starts with: ","reason":"invalid"} Entire message: {"configuration":{"load":{

Connect google datastore from existing google compute engine in python

对着背影说爱祢 提交于 2019-12-11 01:36:36
问题 I'm trying to connect to Datastore from existing compute engine instance and I'm getting: [ python 2.7 - googledatastore-v1beta2_rev1_2.1.0-py2.7 ] googledatastore.connection.RPCError: commit RPC client failure with HTTP(403) Forbidden: Unauthorized. the Datastore API is enabled, Permissions is set but GCE is in different zone, one project what else ? GCE env: DATASTORE_DATASET = project_id DATASTORE_PRIVATE_KEY_FILE = absolute path to pem file DATASTORE_SERVICE_ACCOUNT = service_account

Getting Invalid Key message thrown when creating child records

只谈情不闲聊 提交于 2019-12-11 01:27:57
问题 I am having problems saving programs records when using a parent key for the account. This code fails with error "invalid key" (see bottom for complete): key := datastore.NewIncompleteKey(ctx, "programs", actKey) _, err = datastore.Put(ctx, key, &Program{Name: names[i]}) This passes: key := datastore.NewIncompleteKey(ctx, "programs", nil) _, err = datastore.Put(ctx, key, &Program{Name: names[i]}) Complete code: // insert test account actKey := datastore.NewIncompleteKey(ctx, "accounts", nil)

Can I have the benefit of parent-child relations without the cost of datastore contention?

爷,独闯天下 提交于 2019-12-11 01:27:06
问题 Assumptions: 1) Google AppEngine has the concept of Entity Groups. 2) Entities in an entity group form a tree. However, as far as I understood, every put() to any entity in that tree will lock the whole tree (not just the immediate parent) for a while. 3) Users are allowed to write ca. 5 times per seconds to the tree. 4) There is no way to have a non-locking behaviour (i.e. by making them unindexed properties) Would it be a smart idea to come up with my own parent-child model that does not

Appengine backreferences - need composite index?

ⅰ亾dé卋堺 提交于 2019-12-11 00:26:42
问题 I have a query that is very recently starting to throw: "The built-in indices are not efficient enough for this query and your data. Please add a composite index for this query." I checked the line on which this exception is being thrown, and the problem query is this one: count = self.vote_set.filter("direction =", 1).count() This is literally a one-filter operation using appengine's built-in backreferences. I have no idea how to optimize this query...anyone have any suggestions? I tried to

How to use ndb key with integer_id?

泪湿孤枕 提交于 2019-12-11 00:09:48
问题 I see the document https://developers.google.com/appengine/docs/python/ndb/keyclass#Key_integer_id Returns the integer id in the last (kind, id) pair, or None if the key has an string id or is incomplete. see I think the id of a key can be a int ; so I write r = ndb.Key(UserSession, int(id)).get() if r: return r.session but the dev_server.py , will always raise File "/home/bitcoin/down/google_appengine/google/appengine/datastore/datastore_stub_util.py", line 346, in CheckReference raise

Why the query doesn't return results when the ancestor is not provided?

廉价感情. 提交于 2019-12-10 23:35:48
问题 Why the filter doesn't work when the ancestor is not specified? Isn't it supposed to work on entity type regardless the ancestor? My use case: I've set-up several entities with a parent key. The key corresponds with another entity (the main entity) so that I can get the children by ancestor(main entity key). However the issue seems to be that I can't query the entity properties anymore unless I specify the ancestor. Is this the way it should work? Below is some pseudo code. I can provide