Quantcast
Channel: Gigaspaces XAP forum - RSS feed
Viewing all articles
Browse latest Browse all 1486

When using SpaceIterator makes sense?

$
0
0
I am trying to understand how the SpaceIterator works "under the hood" to decide when it makes sense to use it to get maximum from it (unfortunately the description of SpaceIterator in online documentation does not explain recommended usage in detail). Could you please check if described below is correct, and if my conclusions are reasonable. When a space iterator is created, an Aggregator-based query is executed. This query returns from the target space to the client IDs of all objects found by the query; internally the iterator object knows from which partition each ID was loaded. When the caller on the client side iterates over values, the iterator loads batches based on object IDs (the IDs are already transferred to the client). If my understanding of the implementation is correct, I come to the following conclusions: * It makes no sense to use a SpaceIterator in an embedded space. Even in LRU space all objects found by query will be loaded from the underlying external data source and instantiated in memory when the iterator is created, not during the iteration. * It makes no sense to use a SpaceIterator with a projection that returns just IDs of objects. In such case using an Aggregator-based query will be more efficient, because this is what an iterator is doing anyway. * It makes sense to use a SpaceIterator when a client loads a large number of objects from a remote space, and the client requires more than just object IDs. Are my conclusions correct?

Viewing all articles
Browse latest Browse all 1486

Trending Articles