- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
com.google.appengine.api.datastore.Cursor
只是将索引位置存储到 GAE 数据存储索引中是否正确?
游标耐用吗?也就是说,我是否可以永久存储游标并一次又一次地重复使用它,并确定如果它指向索引中的第 5000 个位置,它将永远指向那里?
如果索引缩减到少于 5000 个条目怎么办?使用此游标会导致错误还是什么都不返回?
对于较大的索引(比如 100,000 或更多条目),我是否可以先为每个 5000 的倍数位置(比如)获取游标,存储它们,然后使用这组游标以 Map/Reduce 方式做一些工作?
我实际上是在使用 Objectify 而不是直接使用 DS,但是据我所知,这不会影响 Cursors 相对于 Indexes 的属性。
最佳答案
游标仅在进行的原始查询的上下文中才有意义。它们不完全是索引位置/偏移量。来自 Cursors and data updates :
The cursor's position is defined as the location in the result list after the last result returned. A cursor is not a relative position in the list (it's not an offset); it's a marker to which Cloud Datastore can jump when starting an index scan for results. If the results for a query change between uses of a cursor, the query notices only changes that occur in results after the cursor. If a new result appears before the cursor's position for the query, it will not be returned when the results after the cursor are fetched. Similarly, if an entity is no longer a result for a query but had appeared before the cursor, the results that appear after the cursor do not change. If the last result returned is removed from the result set, the cursor still knows how to locate the next result.
同样来自 Limitations of cursors :
Cursors are subject to the following limitations:
- A cursor can be used only by the same application that performed the original query, and only to continue the same query. To use the cursor in a subsequent retrieval operation, you must reconstitute the original query exactly, including the same entity kind, ancestor filter, property filters, and sort orders. It is not possible to retrieve results using a cursor without setting up the same query from which it was originally generated.
- Because the NOT_EQUAL and IN operators are implemented with multiple queries, queries that use them do not support cursors, nor do composite queries constructed with the CompositeFilterOperator.or method.
- Cursors don't always work as expected with a query that uses an inequality filter or a sort order on a property with multiple values. The de-duplication logic for such multiple-valued properties does not persist between retrievals, possibly causing the same result to be returned more than once.
- New App Engine releases might change internal implementation details, invalidating cursors that depend on them. If an application attempts to use a cursor that is no longer valid, Cloud Datastore raises an IllegalArgumentException (low-level API), JDOFatalUserException (JDO), or PersistenceException (JPA).
如果您的数据没有改变,您可能可以以 map/reduce 方式使用游标(通过恢复原始查询),包括预先获取它们。
关于java - GAE Datastore 游标是否永久且持久?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41949988/
在 GAE 中,我有一个应用程序将文件存储在 GAE blobstore 服务中。数据存储后,还应将其发送到未部署在 GAE 上的外部 Web 服务。我使用Java。 我的第一个想法是使用 JAX-R
我想找到一个用于验证用户、存储用户的 webapp 框架 并且具有jquery的ajax效果, 那么,你知道这个简单的框架吗? 谢谢 喜欢这个页面:http: //digu.com/reg 最佳答案
为了重新部署 GAE 应用程序,我目前必须在我用于部署的系统上安装 GAE 部署工具。虽然这个过程相对简单,但部署过程是一个手动过程,不能在防火墙后运行,并且部署工具必须安装在每台将用于更新 GAE
This链接显示 GAE 不支持开发服务器上的 cron 作业。那么我的其他选择是什么? 当用户的帐户截止日期已到时,我需要向他们发送电子邮件。 最佳答案 使用本地 cron 服务,并编写一个使用 c
我在运行 Maven GAE Plugin 的 gae:debug 目标时遇到问题.我收到的错误如下。有什么想法吗? 我用“mvn gae:debug”运行它。 [INFO] Packaging we
Google 刚刚宣布支持 App Engine 的 PHP 运行时。我有一个使用 Java 运行时开发的应用程序,它利用了 native App Engine 数据存储区。它目前用作移动客户端的后端
是否有一些前端允许管理员从 Google 应用引擎数据存储区插入、更新、删除记录以及创建修改和删除表,就像您在 mysql 上使用 phpMyAdmin 所做的那样??? 最佳答案 Google Ap
我正在以 GAE 为优势实现 PPO。以下代码是我根据OpenAI的基线实现计算GAE和返回的方式。 advantages = np.zeros_like(rewards) last_adv = 0
这是一个[python代码][1],我想知道它是否也可以用于GAE Java(当代码迁移时)。所以问题是,下面的 python 代码是否可以转换为 Java,而无需任何 Java 所没有的 pytho
当在 GAE 中收到一个 http 帖子时,我从另一个服务器下载一个 txt 文件,进行一些解析,然后返回信息。但是,当我更新这个 txt 文件并尝试通过 GAE 访问它时,似乎有延迟。这是一步一步的
当我运行 gae:run 时,它成功构建 jar 并启动服务器。但看起来服务器没有完全启动,因为我无法转到请求的页面。 当我使用 IDE(不是 maven gae 插件)和由 maven gae 插件
我知道有这样的插件可以在 vim 中调试 python:https://github.com/joonty/vdebug 我正在努力寻找调试 GAE 应用程序的方法,这可能吗?如果是这样,我应该采取什
我在 GAE 上部署了一个 webapp2 python 应用程序。有什么方法可以让我从 GAE 控制台探索源代码或更改项目文件。如果我只想更新已部署的应用程序上的单个 .py 文件而不是再次部署整个
我有一个 Google App 引擎应用程序,我希望它的工作方式有所不同,具体取决于它是在我的本地开发环境中运行(即使用 dev_appserver.py)还是在实际的 GAE 云中运行。 目前,我使
阅读 GAE NDB 数据存储的新文档: https://cloud.google.com/appengine/docs/python/ndb/modelclass#class_methods get
今天我第一次上传我的应用程序,当第一个请求进入以触发应用程序初始化时,它失败了。我已经在 Google GAE DEV 服务器上本地测试了所有内容,Google DEV 服务器和真正的 GAE 环境之
我正在使用 GAE 构建应用程序,并想为此使用 Django。哪个“补丁”更好? app-engine-patch 还是 django-gae-helpers?我指的是它们的功能和 future (其
使用 Google App Engine 标准 Python 2.7,我的dispatch.yaml 中有一个路径来指定“*/flex/*”类型的所有网址以路由到 Flex 服务。 调度.yaml调度
我需要一份关于使用 Flex+BlazeDS+Spring+GAE 的可读教程(在 GAE 数据存储中存储多个表)。有这样的吗? 最佳答案 你必须一步一步来: http://www.springsou
我们要重复 spring-boot-sample-gae 的指令一步一步,但我们仍然无法创建 WAR 文件,并出现以下错误消息: [错误] 无法在项目 gae-demo 上执行目标:无法解析项目 or
我是一名优秀的程序员,十分优秀!