如何在Google App引擎应用程序(Java)中生成datastore-indexes.xml [英] How generate datastore-indexes.xml in Google App engine application (Java)

查看:112
本文介绍了如何在Google App引擎应用程序(Java)中生成datastore-indexes.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Java应用程序,并将其部署在Google App引擎上.我们在数据存储区中创建了约150个索引,这些索引在生产中运行良好.

We have a java application and we deployed this on Google App engine. We created around 150 indexes in datastore and which are running fine in production.

但是以某种方式我们错过了datastore-indexes-auto.xml中的索引信息,并且没有任何名为datastore-indexes.xml的文件.

but somehow we missed indexes information in datastore-indexes-auto.xml and there is no any file with name datastore-indexes.xml.

现在,我们希望拥有datastore-indexes.xml/datastore-indexes-auto.xml,其中包含现有的所有索引,这些索引现在可以在生产环境中使用.

Now we want to have datastore-indexes.xml / datastore-indexes-auto.xml with all existing indexes which serving in production now.

我们如何做到这一点?我检查了appcfg/gcloud命令,没有任何命令可以从App Engine应用程序导入/下载索引文件.

How can we do this? I checked appcfg/gcloud commands, there is no any command to import/download the indexes file from app engine application.

谢谢

推荐答案

您可以下载已部署的应用程序代码( Google Cloud DataStore自动索引,但正在查找特定于Java的文件而不是index.yaml),然后从那里复制/粘贴索引配置.

You could download your deployed app code (How do I download a specific service's source code off of AppEngine?) or check it in StackDriver (similar to Google Cloud DataStore automatic indexing, but looking for the java-specific file(s) instead of index.yaml) and copy/paste the index configs from there.

将这些配置放入应用程序的版本控制的datastore-indexes.xml文件中(如果需要,请创建它)-这些将是手动维护的索引.开发服务器将继续在datastore-indexes-auto.xml中自动维护丢失的内容.数据存储区将在部署时合并2个文件中的信息.

Place those configs into your app's version-controlled datastore-indexes.xml file (create it if needed) - these will be the manually-maintained indexes. The development server will continue maintain the missing ones automatically in datastore-indexes-auto.xml. The datastore will combine the info from the 2 files at deployment time.

请注意,数据存储区索引是累积性的,如果在xml文件的较新版本中存在的索引较少,它们将不会自动删除,它们对我来说必须

Note that the Datastore indexes are cumulative, they're not automatically deleted if fewer of them are present in newer versions of the xml files, they have to me manually vacuumed/deleted. So check that the index configs recovered with the above method(s) are indeed all of those displayed in the Datastore Indexes page, any missing ones would have to be reconstructed manually from that page info.

这篇关于如何在Google App引擎应用程序(Java)中生成datastore-indexes.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆