Igniters,
I'm working on IgniteSet in Java thin client [1], and I'm not sure how to
deal with iterator release.
On the "thick" API side we use WeakReferenceCloseableIterator [2] to
release iterator resources automatically when the iterator instance is
claimed by GC.
a) Reuse this on the client side somehow.
Pros: consistent behavior, fool-proof
Cons: complexity, nondeterministic resource release
b) Make client-side iterator AutoCloseable
Pros: simple, deterministic
Cons: error-prone for users, not consistent with thick API
Thoughts?
[1] https://issues.apache.org/jira/browse/IGNITE-16897
[2]
https://github.com/apache/ignite/blob/71ff768ac98b3411fee876d42cad9689f1b16c2a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheWeakQueryIteratorsHolder.java#L350