google-cloud-datastore

GAE Cloud Datastore: Get most frequently written models

心不动则不痛 提交于 2019-12-06 07:14:04
问题 I am trying to get the list of models in decreasing order of most frequently written models. This is what I have tried so far.This client query set gives the details of models and their attributes/properties, with these model related details : Entity count, Built-in index count, Built-in index size, Data size, Composite index size, Composite index count, Total Size . But there is no detail about write frequencies and/or any analytics about database put() or save() operations. from google

Service error in memcache with Java Google App Engine Standard at random time periods

倖福魔咒の 提交于 2019-12-06 06:22:21
问题 In the past month, our Java Google App Engine Standard Web App started getting strange errors at seemingly random times (see stack trace below). Around this time we made the following changes: Switch from Java7 runtime to Java8/Jetty9 runtime (which allowed us more flexibility in linking to a 3rd party payments library). Switch to deploying with the Google Cloud SDK, instead of the separate Google App Engine SDK. Yesterday we experienced 3 periods with errors. One of these occurred from

GAE: remote_api and Application Default Credentials

橙三吉。 提交于 2019-12-06 06:12:13
问题 Since today i've been using remote_api (python) to access the datastore on GAE. I usually do remote_api_shell.py -s <mydomain> . Today I tried and it fails, the error is: oauth2client.client.ApplicationDefaultCredentialsError: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google

validator for repeated ndb.StructuredProperty fails to fire

梦想的初衷 提交于 2019-12-06 06:09:16
Here is my ndb Model from google.appengine.ext import ndb from mainsite.rainbow.models.CFCSocialUser import CFCSocialUser class CFCSocialGroup(ndb.Model): def remove_duplicate(self, value): raise Exception("Duplicate user detected") name = ndb.StringProperty(required=True) created_on = ndb.DateTimeProperty(auto_now_add=True) updated_on = ndb.DateTimeProperty(auto_now=True) created_by = ndb.StructuredProperty(CFCSocialUser) members = ndb.StructuredProperty(CFCSocialUser, repeated=True, validator=remove_duplicate) @staticmethod def create_group(name): """Create a new group""" group =

App engine + endpoint generating a string instead of byte array as method argument

邮差的信 提交于 2019-12-06 04:46:42
I have GAE + endpoints working between an Android client and app engine backend. I'm now at the point where I want to store a small image as a Blob datatype using JDO. I have the following two methods in my model's backend: public byte[] getPicture() { if (picture == null) { return null; } return picture.getBytes(); } public void setPicture(byte[] bytes) { this.picture = new Blob(bytes); } However, when I generate my endpoint for my Android client, the setPicture(byte[] bytes) method signature gets transformed to setPicture(String bytes). Is that a bug or intended? If intended, how am I

invalid filter: Only one property per query may have inequality filters (>=, <=, >, <)

狂风中的少年 提交于 2019-12-06 04:21:55
I have a number of items which are bookable in certain timeslots. Eg. a tennis court. So each item has got a number of associated availability slots each defined by begintime and endtime. Begintime and endtime are defined as datetime-objects so an availability slot from 09.00 - 11.30, is stored as eg. 2013-12-13 09.00 (begintime) to 2013-12-13 11.30 (endtime). When a booking request comes in, I need to find out whether the tennis court is available for the desired timeslot. So I am trying to filter availability slots based on start-time and end-time, and my query looks like this: desired

How to dynamically build JDO Queries on multiple parameters

有些话、适合烂在心里 提交于 2019-12-06 04:16:02
问题 One can easily use JDO syntax to query on multiple parameters as follows: //specify the persistent entity you're querying and you filter usign params query = pm.newQuery(MyClass.class, " customer == paramCustomer && date >= paramStartDate && date <=paramEndDate "); // declare params used above query.declareParameters("com.google.appengine.api.users.User paramCustomer, java.util.Date paramStartDate, java.util.Date paramEndDate"); //pass the object declared as params MyClassList = (List<MyClass

Complex Class Hierarchy in Google AppEngine (Java)

随声附和 提交于 2019-12-06 04:08:55
Is it possible to have multiple classes that inherit/extends same class in Google AppEngine with Java (GAE/J) for my entities (JDO). For example I have: Content (Abstract class) Course and then my Course will have : list of Video that is extends Content list of Books At the same time Video has list of Tags Book has list of Tags Course has list of Tags Is it possible to do it GAE? I'm doing similar to this but having so much problems. Is there any examples of this kind of stuff? Update based on new question title I still don't understand what your difficulty is, but I will give it a shot Your

Google Datastore - Problems updating entity

那年仲夏 提交于 2019-12-06 03:47:53
I am dusting off my google app-engine / datastore skills ... and getting stuck on something very simple. As per the example on the GAE documentation I am trying to update an entity as follows: // persistence and business logic PersistenceManager pm = PMF.get().getPersistenceManager(); // get it NickName n = pm.getObjectById(NickName.class, nicknameId); // update fields n.givenName = "new name"; n.nickName = "new nickname"; n.timeStamp = new Date(); // close manager to persist changes pm.close(); This doesn't work (as in the changes are not persisted, but no errors or anything else)! At the

App Engine (Python) Datastore Precall API Hooks

杀马特。学长 韩版系。学妹 提交于 2019-12-06 03:47:33
问题 Background So let's say I'm making app for GAE, and I want to use API Hooks. BIG EDIT : In the original version of this question, I described my use case, but some folks correctly pointed out that it was not really suited for API Hooks. Granted! Consider me helped. But now my issue is academic: I still don't know how to use hooks in practice, and I'd like to. I've rewritten my question to make it much more generic. Code So I make a model like this: class Model(db.Model): user = db