gae.unindexed 在开发服务器上被忽略?
App Engine 的开发服务器上是否会忽略“gae.unindexed”扩展?我在一次写入调用中保留了大约 246 个实体,这总共创建了大约 25 个数据存储区放置操作。经过一番研究,我确定这是由索引的自动存储引起的。解决这个问题的方法是添加以下 @Extenstion,如下面我的实体中所示(至少对于 JDO):
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class RealmEntity extends BaseEntity implements Serializable {
@Persistent
private String name;
@Persistent
@Extension(vendorName = "datanucleus", key = "gae.unindexed", value = "true")
private String population;
@Persistent
@Extension(vendorName = "datanucleus", key = "gae.unindexed", value = "true")
private String region;
@Persistent
private String slug;
...
但是,在我的实体上添加其中两个注释后,我仍然得到完全相同的 25 个 put 操作。我希望这些属性在开发服务器上被忽略,但在生产中可以使用。谁能证实或否认这一点?或者也许解释一下为什么它不起作用?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您确定没有将数据存储区写入与数据存储区写入混淆吗?
将属性设为未索引会减少数据存储写入,但不会影响将实体持久保存到数据存储所需的写入次数。您是否通过 AppStats 查看看跌期权数量?
Are you sure you're not confusing datastore puts with datastore writes?
Making a property unindexed reduces your datastore writes, but won't affect the number of puts required to persist your entities to the datastore. Are you seeing the number of puts via AppStats?
我使用 objectify,开发服务器正确报告了我期望的写入操作数量。它确实考虑了我标记为未索引的属性。
我不知道如何修复您的设置,但我可以反驳您的猜测,并说您的更改应该反映在开发服务器写入操作计数中。
I use objectify and the development server correctly reports the number of write operations I would expect. It does take into account the properties which I have marked as unindexed.
I don't know how to fix your setup, but I can contradict your guess and say that your changes should be reflected in the development server write op counts.