gae.unindexed 在开发服务器上被忽略?

发布于 2025-01-03 06:35:55 字数 835 浏览 2 评论 0 原文

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 操作。我希望这些属性在开发服务器上被忽略,但在生产中可以使用。谁能证实或否认这一点?或者也许解释一下为什么它不起作用?

Are the "gae.unindexed" extensions ignored on the development server for App Engine? I am peristing about 246 entities in one write call which is creating a total about 25 datastore put operations. After some research I determined this was caused by the automatic storage of indexes. The way you get around that is by adding the following @Extenstion as shown in my entity below(at least for 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;

            ...

However after adding two of these annotations on my entity, I still get the exact same 25 put operations. My hope is that these properties are just ignored on the development server but will work in production. Can anyone confirm or deny this? Or maybe explain why it isn't working?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心的憧憬 2025-01-10 06:35:55

您确定没有将数据存储区写入与数据存储区写入混淆吗?

将属性设为未索引会减少数据存储写入,但不会影响将实体持久保存到数据存储所需的写入次数。您是否通过 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?

揽月 2025-01-10 06:35:55

我使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文