google-cloud-datastore

The request to API call datastore_v3.Put() was too large. using Objectify (DataStore) and not uploading files

房东的猫 提交于 2019-12-23 20:29:09
问题 I get the following error. com.google.apphosting.api.ApiProxy$RequestTooLargeException: The request to API call datastore_v3.Put() was too large. I am using Objectify 4.0 and not uploading any file. I am using the DataStore for my app, but the only item above 1Mb is a _values blob in _ah_SESSION entity. The images of the console are in: http://goo.gl/qP7v7U I dont know how to troubleshoot the issue and even when the error has been asked before, my problem is that I am not using files and I am

Objectify: Filter by Ref (or Key) of a Certain Kind

北城余情 提交于 2019-12-23 20:24:06
问题 Say I have these classes: @Entity class MyEntity { @Id String id; @Index Ref<?> ref; } @Entity class Kind2 { ... } Can I query for all MyEntitiy objects where ref refers to any instance of Kind2 ? If so, how? 回答1: Moshe's answer is really the right one. However, you can technically hack something that works by performing inequality queries on the key. Ie, >= KEY('Kind2', 0) and <= KEY('Kind2', MAX_LONG) . This gets significantly more complicated if your entities have parents. I wouldn't

How to speedup bulk importing into google cloud datastore with multiple workers?

不想你离开。 提交于 2019-12-23 19:28:47
问题 I have an apache-beam based dataflow job to read using vcf source from a single text file (stored in google cloud storage), transform text lines into datastore Entities and write them into the datastore sink. The workflow works fine but the cons I noticed is that: The write speed into datastore is at most around 25-30 entities per second. I tried to use --autoscalingAlgorithm=THROUGHPUT_BASED --numWorkers=10 --maxNumWorkers=100 but the execution seems to prefer one worker (see graph below:

database design in google app engine

て烟熏妆下的殇ゞ 提交于 2019-12-23 18:06:05
问题 i am designing a simple project based to do list. the idea is to define tasks under project ( no workflow - just "task is completed" or not is required. ) in a hirarchial way. i.e. each task has multiple task and that task may have other multiple task. a project can be said to be completed if all task under that project are completed. , i tought of using refrenceproeperty to create hirarchy , but could not figure out easy way ( which do not take more than 30 seconds to find all the children

App Engine Datastore IN Operator - how to use?

荒凉一梦 提交于 2019-12-23 16:27:22
问题 Reading: http://code.google.com/appengine/docs/python/datastore/gqlreference.html I want to use: := IN but am unsure how to make it work. Let's assume the following class User(db.Model): name = db.StringProperty() class UniqueListOfSavedItems(db.Model): str = db.StringPropery() datesaved = db.DateTimeProperty() class UserListOfSavedItems(db.Model): name = db.ReferenceProperty(User, collection='user') str = db.ReferenceProperty(UniqueListOfSavedItems, collection='itemlist') How can I do a

AppEngine datastore query for all entities that have a given property (Java)

為{幸葍}努か 提交于 2019-12-23 16:10:24
问题 I am trying to figure out an elegant way to query all of the entities in an AppEngine datastore that have a certain property. Since entities that lack a property aren't included in an index, basically what I want to do is to retrieve the index for a given property. I'm sure it's possible to do something like: Filter bigger = new FilterPredicate(PROPERTY, FilterOperator.GREATER_THAN_OR_EQUAL, 0); Filter smaller = new FilterPredicate(PROPERTY, FilterOperator.LESS_THAN_OR_EQUAL, 0); Filter

Query for model by key

眉间皱痕 提交于 2019-12-23 15:56:20
问题 What I'm trying to do is query the datastore for a model where the key is not the key of an object I already have. Here's some code: class User(db.Model): partner = db.SelfReferenceProperty() def text_message(self, msg): user = User.get_or_insert(msg.sender) if not user.partner: # user doesn't have a partner, find them one # BUG: this line returns 'user' himself... :( other = db.Query(User).filter('partner =', None).get() if other: # connect users else: # no one to connect to! The idea is to

How to insert bulk data in Google App Engine Datastore?

馋奶兔 提交于 2019-12-23 15:08:02
问题 I have some CSV files for cities,state and countries with their ids, names etc. I want to put all this data into Google app engine datastore. Can someone please suggest an efficient way of doing this on development server as well as on the production server? Thanks in advance. 回答1: You're in luck. The functionality you described is baked into appcfg.py: http://code.google.com/appengine/docs/python/tools/uploadingdata.html 来源: https://stackoverflow.com/questions/3618147/how-to-insert-bulk-data

Importing a large CSV from Cloud Storage into App Engine Datastore

徘徊边缘 提交于 2019-12-23 13:34:06
问题 I have a large CSV file, on the order of 1 GB big, and want to create entities into the datastore, one entity per row. That CSV file is currently residing in Google Cloud Storage. Is there a clean way to do this? All the examples I can find online seem to rely on having the CSV file locally, or don't look like they would scale very well. Ideally there's a streaming API that lets me read in small enough pieces from Cloud Storage to make update calls to the Datastore, but I haven't been able to

How do i get all child entities in Google App Engine (Low-level API)

青春壹個敷衍的年華 提交于 2019-12-23 12:57:55
问题 I'm using the low-level API in Google App Engine for Java and want to get all the child entities of a particular parent entity: Given the following graph: Parent (1) | + --- Child A (2) | | | + --- Child B (3) | + --- Child A (4) I want a list like the following [Child A (2), Child B (3), Child A (4)] Here is my best attempt: Entity pe = new Entity("parent"); Entity c1 = new Entity("childA", pe.getKey()); Entity c2 = new Entity("childB", c1.getKey()); Entity c3 = new Entity("childA", pe