google-cloud-datastore

Google App Engine appcfg.py shows the help message for every command

我只是一个虾纸丫 提交于 2019-12-09 05:55:00
问题 I have GWT app, which is deployed on GAE (Java). I'm trying to download data from App Engine datastore using appcfg.py . I did all the setup according to http://ikaisays.com/2010/06/10/using-the-bulkloader-with-java-app-engine/ . GAE Python SDK version is 1.4.3 Python version is 2.5.4 appcfg.py is on my PATH. When I run appcfg.py on the command-line, I get the "help" message. But the problem is that no matter which command I use, it always returns the help message. I have not been able to run

got 'invalid_grant' in oauth2 SignedJwtAssertionCredentials

☆樱花仙子☆ 提交于 2019-12-09 05:16:52
问题 I am trying to make an oauth2 access_token in a server-to-server JSON API scenario. But it failed with invalid_grant error, please help. from oauth2client.client import SignedJwtAssertionCredentials KEY_FILE = 'xxxxxxxxxxxx-privatekey.p12' with open(KEY_FILE, 'r') as fd: key = fd.read() SERVICE_ACCOUNT_EMAIL = 'xxxxxx.apps.googleusercontent.com' credentials = SignedJwtAssertionCredentials(SERVICE_ACCOUNT_EMAIL, key, scope="https://www.googleapis.com/auth/datastore https://www.googleapis.com

GAE python NDB projection query working in development but not in production

馋奶兔 提交于 2019-12-09 04:13:30
I've been hitting my head against the wall because my Google App Engine python project has a very simple NDB projection query which works fine on my local machine, but mysteriously fails when deployed to production. Adding to the mystery... as a test I added an identical projection on another property, and it works in both dev and production! Could anyone help please?! Here are more details: I have the following entity that represents an expense: class Entry(ndb.Model): datetime = ndb.DateTimeProperty(indexed=True, required=True) amount = ndb.IntegerProperty(indexed=False, required=True) payee

Java datastore write performance: Objectify vs. JPA

ε祈祈猫儿з 提交于 2019-12-09 03:41:25
I ran two five minute long simple benchmarks against the datastore. One used the JPA implementation on top of Datanucleus provided by Google and the other used Objectify for persistence. Each request created 10 new indexed entities with the same 9 fields, each using another datatype. To avoid any effects by the network connection the benchmark returned the timespan between the start and the end of 10 writes. AVG Median 10% 90% 99% JPA 76.5 76 53 98 114 Objectify 41.1 40 39 43 57 Objectify TX 50.6 50 44 60 69 As you can see using Objectify is much faster than JPA. Are there any performance

Implementing “Starts with” and “Ends with” queries with Google App Engine

余生长醉 提交于 2019-12-09 00:03:25
问题 Am wondering if anyone can provide some guidance on how I might implement a starts with or ends with query against a Datastore model using Python? In pseudo code, it would work something like... Query for all entities A where property P starts with X or Query for all entities B where property P ends with X Thanks, Matt 回答1: You can do a 'starts with' query by using inequality filters: MyModel.all().filter('prop >=', prefix).filter('prop <', prefix + u'\ufffd') Doing an 'ends with' query would

Wrong dependency in Google Cloud SDK for google-auth?

我只是一个虾纸丫 提交于 2019-12-08 17:42:02
问题 i am using google cloud storage and google cloud datastore api (locally, for now), in a Standard Environment app. I am having a very weird behaviour trying to running my tests (with pytest): i have discovered that, during tests, the dev_appserver.fix_sys_path command run by pytest-beds that i am using (https://github.com/kaste/pytest-beds/blob/master/testbeds/plugin.py#L35) puts the bundled google-cloud libraries before my custom versions: /Users/username/google-cloud-sdk/platform/google

How to delete a kind in Google cloud datastore

眉间皱痕 提交于 2019-12-08 17:03:45
问题 In the Cloud Datastore Admin console, I can only delete all entities of a certain kind . I am wondering how to delete the kind along with all its entities as well. I am using datastore emulator as the local dev server. 回答1: After you delete all the entities of a kind, the kind will no longer appear in the Cloud Datastore Admin console. I don't recall if it is immediate. It might take 24 hours or so. 来源: https://stackoverflow.com/questions/42576533/how-to-delete-a-kind-in-google-cloud

How many objects is “too many” for in a single transaction to Google's DataStore (High Replication)?

跟風遠走 提交于 2019-12-08 16:56:53
问题 I have following entity (non-relevant fields/methods are removed). public class HitsStatsTotalDO { @Id transient private Long targetId; public Key<HitsStatsTotalDO> createKey() { return new Key<HitsStatsTotalDO>(HitsStatsTotalDO.class, targetId); } } So... I'm trying to do batch get for 10 objects for which I construct keys using HitsStatsTotalDO.createKey() . I'm attempting to fetch them in transaction like this: final List<Key<HitsStatsTotalDO>> keys = .... // This is being called in

Google Cloud Datastore - What is the correct syntax to filter by Key in the Developer Console?

徘徊边缘 提交于 2019-12-08 16:55:16
问题 I'm trying to query for an entity User in a Google cloud datastore with a key, using Googles developers console query filter. (Google Cloud Developer Console -> Cloud Datastore -> Query) I fail to decipher the example syntax and am always prompted with the following error message: Error: Keys for datastore operations must be in the format Key('kind0', 'name0'/id0, 'kind1', 'name1'/id1, ...) On appengine.google.com I used to query for a specific key on a User like this: SELECT * FROM User

I cannot enable firestore on a project although I'm not using AppEngine nor Datastore

我只是一个虾纸丫 提交于 2019-12-08 16:39:13
问题 I'm trying to activate firestore on a project on which I'm not using AppEngine nor Datastore and having this error message. Cannot enable Firestore for this project Currently Firestore cannot be enabled in projects already using Cloud Datastore or App Engine To be more precise, I used to use datastore but now there is no entities in my project datastore. So maybe there is something that I need to disable explicitly Thx in advance for your help 回答1: Unfortunately since you have previously used