4 Replies Latest reply on Sep 16, 2019 9:23 AM by Will Burns

    How to stream through query results ?

    Jean-Baptiste Trystram Newbie

      Hi,

      Result

      I am using the java remote hot rod client to query entries in a cache then delete the result. However, I expect the number of results to be quite large and that may cause memory issues in my application. Setting a `maxResults` value on the query could help, but then I'd have to execute it multiple times, which isn't optimal.

       

      The documentation mention that streaming through the results is possible [1] but i can't find how to do that. I've looked at the various documentation and could not find a way to retrieve a Stream of objects ?

      Also, just to be sure : there is no way to directly delete the results of a query ? It's a bit cumbersome at the moment since I get back the values, needs to constructs the corresponding keys and use them for the deletion operation.

      I don't need to get the results in my application, it's just a blind deletion. Is there a more efficient way to do it ?

       

      Thanks !

       

      [1] : Indexing and Querying with Infinispan 10.0