google-cloud-datastore

The 5 writes per second for an entity group

六月ゝ 毕业季﹏ 提交于 2019-12-06 00:46:41
问题 Suppose we have 5 entities: A,B,C,D,E with the following ancestor hierarchy: A / \ B C / \ D E I have two questions about this: Do we have 2 entity groups here (A,B,D) and (A,C,E) or just 1 entity group (A,B,C,D,E)? If we want to update entities D and E, can we update each of them 5 times per second or should the combined writes for D,E not exceed 5? 回答1: There is only one entity without a parent here - that is, A. It is therefore a root entity of the sole entity group that contains A, B, C,

Google Datastore Strong consistency and Entity Group max size

狂风中的少年 提交于 2019-12-06 00:27:27
In a shared expenses app that shows payments dues and shared expenses details for each group. As a financial application, so many operations are transactional, which requires strong consistency to ensure data integrity. We used Entity Groups and ancestor queries which seems to have solved the issue of strong consistency, this caused the entity group to be large in size. As the shared 'group' is now the parent of members, expenses, payments, dues..etc. Until now we don't see a problem, but we are worried as this scales, expenses and/or payments can scale to the order of 10~100K entities. After

Spring, Hibernate with google app engine

假装没事ソ 提交于 2019-12-06 00:21:05
Project Name: CarpoolDB, I have added the jar for this project in another application name Carpool. While running the Carpool app I am getting following exception. Project: Carpool. Here i am getting exception as "carpoolService" not getting autowired while running as "Google Web application" but same runs under Tomcat and beans properly get injected. @Controller public class PlacesSearchController { @Autowired CarpoolService carpoolService=null; public CarpoolService getCarpoolService() { return carpoolService; } public void setCarpoolService(CarpoolService carpoolService) { this

Using the App Engine datastore to find overlapping ranges

不问归期 提交于 2019-12-06 00:10:54
I'm using Google App Engine for Java with the JDO interface for the datastorage for an application for a CrimeWatch organization. One of the features I'm trying to implement is an away log where people report when they're going to be away for an extended period of time (so the patrols know to keep an eye on the houses). In the app, I have an AwayLogEntry object with a start and end date, and the other fields needed. I need to make a report available to the people who patrol the neighborhood of who is away in a given time period (usually the upcoming week). I'm trying to build a report that

Are ndb cached read ops still counted as datastore read ops for billing purposes?

余生颓废 提交于 2019-12-05 23:35:19
From NDB Caching : NDB manages caches for you. There are two caching levels: an in-context cache and a gateway to App Engine's standard caching service, memcache. Both caches are enabled by default for all entity types, but can be configured to suit advanced needs. My app doesn't make any ndb caching configuration change, so it must be using the defaults - both caching levels enabled. I'm running some tests on my staging environment (a separate, dedicated GAE project) where I can totally isolate sequences of activity from any spurious external requests. Each sequence of activity consists of a

NDB querying results that start with a string

帅比萌擦擦* 提交于 2019-12-05 22:57:26
Working with Google App Engine's NDB, I'm looking to query for all items that start with a user-inputted string. Example: abc_123 abcdefg 123abc Querying for "abc" should return abc_123, abcdefg (however, not 123abc as it doesn't start with "abc") I previously used the code below for a similar but different purpose: q = q.filter(order._properties[kw].IN(values_list)) which filtered for all values in values_list that were in kw, I am now looking to filter for all values that start with a string that are in kw. Try: Kind.query(ndb.AND(Kind.property >= "abc", Kind.property <= "abcz")) 来源: https:/

How can I programmatically determine which Datastore indexes are in error?

若如初见. 提交于 2019-12-05 22:21:51
When I run update_indexes on Google Datastore I get the message below. It is telling me to determine which indexes are in error by looking at the GUI, then delete these indexes. I have 51 erroneous indexes out of 200, and copying them out of the GUI is not feasible. (Edit: By laboriously removing and adding indexes from the datastore-indexes.xml, we identified the one problematic index.) Good devops procedure demands that we do this sort of thing automatically. How does one determine which indexes are in error programmatically? (Python, bash, or even Java are OK.) Cannot build indexes that are

Can Objectify library be used outside GAE?

随声附和 提交于 2019-12-05 19:50:22
I want to use the Google Cloud Datastore. However, I am not using GAE. Can I still use the Objectify library? If so how? The documentation doesnt say anything about how to configure it to authenticate against Datastore. No, you can't. Here is a comment from the creator on the topic. Objectify is meant for use within GAE only. Other ORM for Java which can interface with the Datastore, such as JDO, JPA, etc. are similar. In order to access your Datastore from the outside world, you'll either want to write handlers within your GAE app's API which can do the Datastore interfacing for you, simply

Datastore Query returns null

北慕城南 提交于 2019-12-05 19:26:37
I am trying to retrieve a sorted list of the players scores from a datastore Entity of type"User" After executing: List<User> entities = ofy().load().type(User.class).order("-score").list(); Knowing that I indexed the "score" attribute. Here is the "User.class" @Id String userName; String password; @Index int score; The entities seem to be null and i can't get the entities details.What am I missing??? I am still working on that I managed to modify the method to: @Override public User display(){ List<User> list = ofy().load().type(User.class).order("-score").limit(5).list(); User u= list.get

Flattening nested structs leads to a slice of slices

假装没事ソ 提交于 2019-12-05 18:59:39
So I have a struct like this type Bus struct { Number string Name string DirectStations []Station // Station is another struct ReverseStations []Station } and I'm trying to store an instance of this to the Datastore: key := datastore.NewKey(c, "Bus", bus.Number, 0, nil) _, err := datastore.Put(c, key, &bus) but I'm getting the error datastore: flattening nested structs leads to a slice of slices: field "DirectStations" How does one solve this? Edit: Turns out you can't have a slice of struct, where that struct contains other slices. Just encode this struct into json (bytes) and store the json