在 Google App Engine - java 中迭代大量记录并聚合整数属性
Google App Engine - Java - JDO
我在数据存储中存储一个对象“Bucket”,该对象具有“totalsize”字段/属性 - 一个整数,是存储桶中关联 blob 的所有大小的聚合。每个 Bucket 有 3 个对应的 blob。该字段提供了所有三个 blob 的总大小(以字节为单位)。当我将 blob 放入数据存储区时,我会聚合此计数。
现在,我说我有数百万个这样的桶。如何获得所有桶中所有totalsize字段的总和?这些存储桶与帐户对象相关。本质上,我想确定每个帐户管理的数据总量。
显然我正在寻找最好的方法来做到这一点。我怀疑检索它们并循环遍历是否有可能。
谢谢!
Google App Engine - Java - JDO
I'm storing an object "Bucket" in the datastore that has a field/property of "totalsize" - an integer that is an aggregate of all the size of the associated blobs of the Bucket. Each Bucket has 3 corresponding blobs. This field gives me the total size in bytes of all three of it's blobs. I'm aggregating this count when I put the blobs into the datastore.
Now, I say I have MILLIONS of these Buckets. How can I get a total aggregate of all the totalsize fields in all of the Buckets? These buckets relate to an Account object. Essentially, I'd like to determine the total amount of data under management per account.
Obviously I'm looking for the best way to do this. I doubt that retrieving them all and looping through is a possibility.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经让 MapReduce 运行起来了,这真是太棒了。为此,我按照此处的说明进行操作:
http://code.google.com/p/appengine-mapreduce/wiki/GettingStartedInJava
I've got MapReduce working and it is amazing. To do it, I followed the instructions here:
http://code.google.com/p/appengine-mapreduce/wiki/GettingStartedInJava