Gemfire的游标等效功能?

huangapple go评论76阅读模式
英文:

Cursor equivalent for Gemfire?

问题

我使用 Gemfire 8.x,我有一个 Gemfire 区域,其中有许多对象(假设有数十亿个),我需要编写一些 Java 代码,从该区域获取一个巨大的结果集并进行一些批处理。

如果这是传统的关系型数据库,我会使用游标来实现,以避免出现 OutOfMemoryError。在 Gemfire 中是否有类似的解决方案?还是说我必须实现某种自定义分页逻辑,使用 OQL 中的 LIMIT 关键字来处理这种大结果集的批处理?

英文:

I use Gemfire 8.x and I have a Gemfire region where there are many objects in it (let's say there are billions of them) and I need to write some Java code which does some kind of bulk processing with a huge result set from the region.

If it was a traditional RDBMS, I would use a cursor for that so that I won't get an OutOfMemoryError. Is there an equivalent in Gemfire? Or do I have to implement some kind of custom paging logic with the LIMIT keyword in OQL for implementing this kind of bulk processing with a large result set?

答案1

得分: 1

在GemFire中,没有CURSOR的等价物,您需要使用LIMIT来检索结果。顺便提一下,编写一个自定义Function可能会更有益(而且可能更好),而不是从客户端应用程序使用OQL,这将允许您在原地处理数据并防止整个数据集移动到客户端。

干杯。

英文:

There's no CURSOR equivalent in GemFire, you need to retrieve the results using LIMIT instead. As a side note, it would be beneficial (and probably better) to write a custom Function instead of using OQL from a client application, that will allow you to process the data in place and prevent the whole data set from moving to the client side.

Cheers.

huangapple
  • 本文由 发表于 2020年10月22日 07:42:48
  • 转载请务必保留本文链接:https://go.coder-hub.com/64473220.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定