google-cloud-datastore

How to get the number of rows in a table in a Datastore?

独自空忆成欢 提交于 2019-12-03 19:34:28
问题 In many cases, it could be useful to know the number of rows in a table (a kind) in a datastore using Google Application Engine. There is not clear and fast solution . At least I have not found one.. Have you? 回答1: You can efficiently get a count of all entities of a particular kind (i.e., number of rows in a table) using the Datastore Statistics. Simple example: from google.appengine.ext.db import stats kind_stats = stats.KindStat().all().filter("kind_name =", "NameOfYourModel").get() count

What is the purpose of ancestors in the google app engine datastore?

谁说胖子不能爱 提交于 2019-12-03 17:52:36
问题 I have been playing around with google app engine and its datastore recently and created a datamodel and relationships using reference properties. However I am unclear about the concept of ancestors wrt the datastore. What is their purpose and why should I use them? How do they relate to reference properties of datastore entities? 回答1: Another benefit of entity groups/ancestors is to create islands of strong consistency (as opposed to eventual consistency). For instance, you could have a

For Google App Engine (java), how do I set and use chunk size in FetchOptions?

不羁岁月 提交于 2019-12-03 17:31:10
问题 Im running a query and it is currently returning 1400 results and because of this I am getting the following warning in the log file: com.google.appengine.api.datastore.QueryResultsSourceImpl logChunkSizeWarning: This query does not have a chunk size set in FetchOptions and has returned over 1000 results. If result sets of this size are common for this query, consider setting a chunk size to improve performance. I can't find any examples anywhere as to how to actually implement this, there is

Google App Engine Java: how to remove unused indexes?

余生长醉 提交于 2019-12-03 17:15:41
If I found information about removing unused indexes, like in Uploading and Managing a Python App / Deleting Unused Indexes , it was only for the Python environment... Any way to tag an index in the [~project]/war/WEB-INF/datastore-indexes.xml file? Since version 1.4.2 the Java SDK supports the vacuum_indexes action. Run this command to delete unused indices: ./<appengine-java-sdk-path>/bin/appcfg.sh vacuum_indexes <myapp-path>/war On Windows with the Eclipse SDK it's something like: <eclipse-path>\plugins\com.google.appengine.eclipse.sdkbundle_1.4.3.v201103311225\appengine-java-sdk-1.4.3\bin

Video website on google application engine

余生长醉 提交于 2019-12-03 17:11:02
I am going to work on a video website where users/admin will be able to upload the videos and play them using some opensource javascript player. However, I want to know if it is a good idea to start this kind of project on google app engine considering its limitations to server and store the data. What are the issues which I may have to encounter on Google application engine and if there are any possible solutions for those issues. Currently, I have doubts on converting the videos while uploading, creating images from the videos uploaded (something like ffmpeg for google app engine) and

Is there any tool to backup/restore Google Datastore entities?

北战南征 提交于 2019-12-03 16:23:34
问题 I've playing around with Google App Engine and Google Datastore for a while now and I am facing the need to take regular backups of my stuff up on the cloud. Is there any sort of general purpose tool that allows you to download all your data from a specific instance of google-datastore and restore it to another one? If so, please enlighten me, if not - someone should do it! 回答1: You can use the BulkLoader that is described in the Google Appengine Docs 回答2: There is an opensource application

How to sort responses in Objectify?

随声附和 提交于 2019-12-03 16:21:18
问题 I'm currently building an app for deployment to GAE, using Objectify 3.1. I am getting strange results when attempting to do a query with an order() clause. My domain: public class InvoiceLineItem { private int units; private BigDecimal unitCost; private BigDecimal extendedCost; private String description; @Parent Key<Invoice> invoice; } I am attempting to gather all of the InvoiceLineItems associated with a given Invoice using the following: ofy ().query (InvoiceLineItem.class).ancestor

Google App Engine local datastore path configuration

不想你离开。 提交于 2019-12-03 15:49:00
Sorry for asking the nth permutation of this question, but i'm stymied. I'm running GAE for python2.5 on OS X, and i'm losing all data between reboots. From what I understand from related SO posts, the default location for local datastore file is wiped with each reboot. I have tried changing the location to a central /datastores directory with: dev_appserver.py --datastore_path=/Users/Me/gae_apps/datastores /Users/Me/gae_apps/app_1 which doesn't generate an error, but when i fire up dev_appserver.py after rebooting, I see this output, and the data is again wiped: WARNING 2011-07-14 17:50:56

Google Cloud Datastore vs Google App Engine

隐身守侯 提交于 2019-12-03 15:25:59
问题 I was having a look at the new Google Cloud Datastore and looks great. But there is something I could not understand... is it supposed to substitute Google App Engine Datastore? How can I use it inside GAE? What are the differences between both of them? I have a GAE app in Java that uses 3 entities with thousands of rows each one, and I need to do joins quite often... 回答1: The cloud datastore is the App Engine datastore, for use outside App Engine. You won't get any benefit trying to use it

How do I unlock the app engine database when localhost runs?

拥有回忆 提交于 2019-12-03 14:17:17
Right now I get a blank page when localhost runs, but the deployed app is fine. The logs show the "database is locked". How do I "unlock" the database for localhost? This can happen if you're running multiple instances of dev_appserver without giving them distinct datastore files/directories. If you need to be running multiple instances, see dev_appserver.py --help and look at the options for specifying paths/files. Paul Bendevis Dave W. Smith has the right idea. I had this same issue and looking into the docs you need to set the --storage_path='some/path' to be different for each instance of